Changes

Jump to: navigation, search
Finalize the Setup
=Finalize the Setup=
#Configure Debian to autorun our server on boot
##Run Create a new service file by running <pre>sudo nano /etc/init.d/quakejs</pre>
##Fill the file with the following <pre>### BEGIN INIT INFO&#10;# Provides: quakejs&#10;# Required-Start: $network&#10;# Required-Stop: $network&#10;# Default-Start: 2 3 4 5&#10;# Default-Stop: 0 1 6&#10;# Short-Description: QuakeJs Server&#10;# Description: Starts/Stops/Restarts the QuakeJS Server Daemon&#10;### END INIT INFO&#10;&#10;set -e&#10;&#10;PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin&#10;DESC="QuakeJS Server"&#10;NAME=quakejs-server&#10;USER=quake&#10;DIR=/home/quake/quakejs&#10;DAEMON=node build/ioq3ded.js +set fs_game baseq3 set dedicated 1 +exec server.cfg&#10;#PIDFILE=/var/run/$NAME.pid&#10;SCRIPTNAME=/etc/init.d/$NAME&#10;&#10;# Gracefully exit if the package has been removed.&#10;test -x $DAEMON || exit 0&#10;&#10;sleep 2&#10;sudo -u $USER $DAEMON $1 $OPTIONS&#10;</pre>
##Make our new file executable by running <pre>sudo chmod +x /etc/init.d/quakejs</pre>
##Enable it by running <pre>sudo update-rc.d quakejs defaults</pre>
##You can test this by running <pre>sudo systemctl start quakejs</pre> and/or rebooting your machine by running <pre>sudo reboot</pre>
#Lastly we need to remove ''sudo'' privileges from user ''quake''
##Get back to our original sudo user (not ''quake'') by running the following command which undoes ''su - quake'' <pre>exit</pre>
##Remove ''quake'' from the ''sudo'' group by running <pre>gpasswd -d quake sudo</pre>
 
That's it! Whenever your ''quakejs'' server boots up it will automatically start the ''quakejs'' game server and Apache2 webserver. When a computer on your LAN visits http://quakejs/ they'll automatically download the files they need from http://quakejs/assets/ and then connect to the QuakeJS server at quakejs:27960.
 
Get a few friends together, have them point their browsers to http://quakejs/ and start fragging!

Navigation menu