This is a how to on setting up a file host for your maps if you are running on Linux, either on a VPS or Dedicated server. With this how to you'll only have to have maps in one location vs normally done with two, one inside your .xonotic/data folder and one on the map host.
I'm going to assume you have your Linux distro installed already and basic secured. I'll be doing this for Ubuntu server but should the same for most distros. I'm also going to assume that you have Xonotic already downloaded and for GIT version compiled it.
Now open up a command line window
In the /home/your_name/.xonotic folder make a directory called maps
Now lets install lighttpd
Accept all the install defaults, usually just type in y or Y
Now type in
This will bring up the lighttpd config file in the nano editor.
Check that the following lines are not commented out. They should't be anyways.
Leave this line as it for now. You can set it to what ever you want later.
Change this line
to
This will make the server make these file extensions unavailable through the browser. Just in-case you upload them to the wrong folder.
Now add this line below it. It will deny access to any file in the maps/data dir. Not sure if its needed but why not.
Click CTRL+x and then Y to save the changes.
Now type in
Now type in
which will take you to the /var/www directory. Here will we create a symlink that points to /home/your_name/.xonotic/maps
Now type in
Open up you serer.cfg file and look for this like
Uncomment it by remove the # before sv_curl_defaulturl and make it look like this with your info
This will tell the player client where it should download the next map from.
With this your .pk3 map files will be downloadable for the players when they join your server. They will also be downloadable from the browser if the user goes to say your_site.com/maps.
Now when you want to upload your map files they just have to be uploaded to one location /home/your_name/.xonotic/maps
For the final set up
When you start your xonotic server you'll need do use the -game switch like this
For GIT
This will tell the game to use the /home/your_name/.xonotic/data/maps directory for the map .pk3 files. Your server.cfg can and should now be placed in the /home/your_name/.xonotic/data directory and not /home/your_name/.xonotic/maps
Depending on how popular your server is and how many maps you are hosting, having the map server on the same box might cause some lag when players are downloading maps. I haven't noticed this but might be noticeable on a small VPS.
I'm going to assume you have your Linux distro installed already and basic secured. I'll be doing this for Ubuntu server but should the same for most distros. I'm also going to assume that you have Xonotic already downloaded and for GIT version compiled it.
Now open up a command line window
In the /home/your_name/.xonotic folder make a directory called maps
Code:
mkdir maps
Now lets install lighttpd
Code:
sudo apt-get install lighttpd
Accept all the install defaults, usually just type in y or Y
Now type in
Code:
sudo nano /etc/lighttpd/lighttpd.conf
This will bring up the lighttpd config file in the nano editor.
Check that the following lines are not commented out. They should't be anyways.
Code:
server.modules = (
"mod_access",
Leave this line as it for now. You can set it to what ever you want later.
Code:
server.document-root = "/var/www"
Change this line
Code:
url.access-deny = ( "~", ".inc")
to
Code:
url.access-deny = ( "~", ".inc", ".cfg", ".db", ".txt" )
This will make the server make these file extensions unavailable through the browser. Just in-case you upload them to the wrong folder.
Now add this line below it. It will deny access to any file in the maps/data dir. Not sure if its needed but why not.
Code:
# deny access to /maps/data
$HTTP["url"] =~ "^/maps/data/" {
url.access-deny = ("")
}
Click CTRL+x and then Y to save the changes.
Now type in
Code:
service lighttpd restart
Now type in
Code:
cd /var/www
which will take you to the /var/www directory. Here will we create a symlink that points to /home/your_name/.xonotic/maps
Now type in
Code:
sudo ln -s /home/your_name/.xonotic/maps maps
Open up you serer.cfg file and look for this like
Code:
// see Docs/mapdownload.txt for more info
sv_curl_defaulturl "" //fallback download URL
Uncomment it by remove the # before sv_curl_defaulturl and make it look like this with your info
Code:
// see Docs/mapdownload.txt for more info
sv_curl_defaulturl "http://your_ip/maps/" //fallback download URL
This will tell the player client where it should download the next map from.
With this your .pk3 map files will be downloadable for the players when they join your server. They will also be downloadable from the browser if the user goes to say your_site.com/maps.
Now when you want to upload your map files they just have to be uploaded to one location /home/your_name/.xonotic/maps
For the final set up
When you start your xonotic server you'll need do use the -game switch like this
For GIT
Code:
./all run dedicated -game maps
This will tell the game to use the /home/your_name/.xonotic/data/maps directory for the map .pk3 files. Your server.cfg can and should now be placed in the /home/your_name/.xonotic/data directory and not /home/your_name/.xonotic/maps
Depending on how popular your server is and how many maps you are hosting, having the map server on the same box might cause some lag when players are downloading maps. I haven't noticed this but might be noticeable on a small VPS.
[MoFo] Servers - North America - Hosted in Montreal Canada - Admin DeadDred [MoFo]