Setup issue

75 views
Skip to first unread message

Bartosz Radwanski

unread,
Nov 5, 2018, 1:44:48 PM11/5/18
to PHudBase Developers
Hi,


Hope you're all good! I'm having a hard time getting the Webmud (http://www.phudbase.com/webmud.php) to run - I was hoping you could lend a helping hand.


Here's my setup:

- Google Cloud instance running ubuntu 18.04

- For the sake of debugging - all in/out traffic ALLOWED on firewall

- For the sake of debugging - UFW has been disabled

- LAMP stack installed 

- PHP CLI installed

- Code archive unpacked into /var/www/html/phudbase


From the Web Server + PHP point of view, I'm all set - I can see the client by navigating to http://dum-devclient02.dynu.net/phudbase/wm_client/ 


Here are the config files amended as per the instructions:


server.php

/* * Standard host and port settings * Keep in mind that on a live host, you'll want to bind to the outbound IP or host name, not localhost or$ */ define("HOST", "35.198.179.222"); define("PORT", "12346"); define("PORT_POLICY", "843"); // Leave this be: may require running ./server.php as root // /* * The following defines are for the WebSocket Handshake, and should be set according to your server. * If you're testing locally (based on the HOST and PORT above), yours should look like the values below. * * If you're deploying the application on a live server, the values would like more like: * RESOURCE: /wm_server/server.php (as in example.com/wm_server/server.php) * HOST: example.com:12346 * ORIGIN: example.com */ define("WS_RESOURCE", "/phudbase/wm_server/server.php"); define("WS_HOST", "35.198.179.222:12346"); define("WS_ORIGIN", "http://35.198.179.222");


client.js

// Change this as necessary // var wshost = "ws://35.198.179.222:12346/phudbase/wm_server/server.php";


The issue is when navigating to the client on http://dum-devclient02.dynu.net/phudbase/wm_client/  I'm not getting the CONNECTED status, also a message "WebSocket error:" is displayed in the window.Am I missing something really obvious? Should I be running the server via "sudo php -q server.php" as a daemon in the background? I tried running it, but I get the following:


/var/www/html/phudbase/wm_server$ sudo php -q server.php PHP Warning: Use of undefined constant E_WARN - assumed 'E_WARN' (this will throw an Error in a future version of PHP) in /var/www/html/phudbase/wm_server/includes/errorFunctions.inc on line 16 PHP Warning: A non-numeric value encountered in /var/www/html/phudbase/wm_server/includes/errorFunctions.inc on line 16 Attempting to bind to port 12346... PHP Warning: socket_bind(): unable to bind address [99]: Cannot assign requested address in /var/www/html/phudbase/wm_server/includes/classes/Server/SocketServer.class.inc on line 79 Attempting to bind to port 12346... PHP Warning: socket_bind(): unable to bind address [99]: Cannot assign requested address in /var/www/html/phudbase/wm_server/includes/classes/Server/SocketServer.class.inc on line 79 Attempting to bind to port 12346... PHP Warning: socket_bind(): unable to bind address [99]: Cannot assign requested address in /var/www/html/phudbase/wm_server/includes/classes/Server/SocketServer.class.inc on line 79 Attempting to bind to port 12346... PHP Warning: socket_bind(): unable to bind address [99]: Cannot assign requested address in /var/www/html/phudbase/wm_server/includes/classes/Server/SocketServer.class.inc on line 79 Attempting to bind to port 12346... PHP Warning: socket_bind(): unable to bind address [99]: Cannot assign requested address in /var/www/html/phudbase/wm_server/includes/classes/Server/SocketServer.class.inc on line 79 Attempting to bind to port 12346... PHP Warning: socket_bind(): unable to bind address [99]: Cannot assign requested address in /var/www/html/phudbase/wm_server/includes/classes/Server/SocketServer.class.inc on line 79 Attempting to bind to port 12346... PHP Warning: socket_bind(): unable to bind address [99]: Cannot assign requested address in /var/www/html/phudbase/wm_server/includes/classes/Server/SocketServer.class.inc on line 79 Attempting to bind to port 12346... PHP Warning: socket_bind(): unable to bind address [99]: Cannot assign requested address in /var/www/html/phudbase/wm_server/includes/classes/Server/SocketServer.class.inc on line 79 Attempting to bind to port 12346... PHP Warning: socket_bind(): unable to bind address [99]: Cannot assign requested address in /var/www/html/phudbase/wm_server/includes/classes/Server/SocketServer.class.inc on line 79 Attempting to bind to port 12346... PHP Warning: socket_bind(): unable to bind address [99]: Cannot assign requested address in /var/www/html/phudbase/wm_server/includes/classes/Server/SocketServer.class.inc on line 79 Could not bind...


Any assistance will be much appreciated!
Many thanks,

Bartek

Bartosz Radwanski

unread,
Nov 7, 2018, 3:27:54 AM11/7/18
to PHudBase Developers
I have managed to sort this on out - in case someone runs into similar issues, remember to bind to local IP address of the NIC, rather than the external IP :)

Virgil Nilson

unread,
Jan 22, 2020, 11:08:11 PM1/22/20
to PHudBase Developers
Hey Bart, I'm quite an amateur so please forgive my confusion. I'm currently running into this same problem. The only difference being that when I try to do a sudo php -q server.php I get the following error over and over:

PHP Notice:  Trying to get property 'socket' of non-object in /srv/www/tbwmud.com/wm_server/includes/classes/Server/SocketServer.class.inc on line 218
PHP Notice:  Undefined offset: 506 in /srv/www/tbwmud.com/wm_server/includes/classes/Server/SocketServer.class.inc on line 218^C

I've tried googling what a local NIC IP address is, and the best I can figure is the MAC address, which doesn't seem right. Any chance you could elaborate?

Thank you!
Reply all
Reply to author
Forward
Message has been deleted
0 new messages