Jump to content

Linux Server Auto Install Project Zomboid Scripts


Connall

Recommended Posts

YOU DON'T NEED TO DO THIS ANYMORE YOU CAN RENT A READY TO GO SERVER. LIST HERE: http://theindiestone.com/forums/index.php/topic/9856-project-zomboid-server-hoster-sites/

 

TESTED ON DEBIAN WHEEZY, SUPPORT FOR UBUNTU UNKNOWN WILL BE COMING LATER IF NEED BE

 

LOOKING FOR LINUX INSTALLATION GUIDE? GO HERE http://theindiestone.com/forums/index.php/topic/5841-buying-running-a-linux-project-zomboid-server/

 

SCRIPTS FIXED AS OF 23/06/2014

 

Hey there,

 

Are you struggling to install a Project Zomboid server? Trying to cut your way through all that Linux mumbo jumbo? Well then do I have the script for you.

 

One of the biggest things I usually get, whether it's through PM's or posts on my Linux server guide is that some people are just struggling too much with the guide. Some people are just not technically minded with these sort of things, so it looks like reading a SCUD's schematics in Russian. With that in mind, this is the first part of a multi part project in making the installation and maintenance of servers that little bit easier.

 

This way of installing requires minimal knowledge of Terminal etc and makes think that much easier. The downside is you have less knowledge about Linux making things a little bit harder to troubleshoot. So obviously use these if you really are struggling, but support for issues that arise might be a tad bit harder to explain on how to solve.

 

Anyway you can choose to use this method, or the full Linux installation guide. The choice is yours on what to do. This version will still require you to download FileZilla and Putty.

 

Script Information

 

The scripts currently come in four parts. two parts for installing the server and grab other necessary scripts as well. One to use when updating the game (currently fixed to a beta branch which I hope to change later on, basically means anytime the game switches over to another branch will recover an upgrade.) and one to start the server (can also restart the server if ran when a server is running.) It's slightly buggy at this point in time as I try and find a better solution to starting the server. If it fails then you can just have to run through terminal. Hopefully I'll have the issue resolved relatively quickly.

 

If you're technically minded and want to take a look under the hood of the script I've put it up on Github: https://github.com/Connall/Project-Zomboid-Server-Scripts

 

So feel free to take a look.

 

Guide to Using Script

 

So first off, obviously go download the software I mentioned above. Putty and FileZilla. For sake of ease anything you see that's formated like this:

Formatted like this.

means that is something you type into the terminal. Got it? Good, great... alright... moving on.

 

First make sure you have the necessary IP Address to connect to the server, provided by the hoster. Boot open putty and connect to the server using that address. Log into the root user account for the server and do the following.

wget http://www.terminal-control.com/pz-server/scripts/pz-server-install.sh

Once that's all done, do:

bash pz-server-install.sh

That will run the script. Follow the instructions that the console says. Make sure to take note of what password you choose for pz-server user since you will need to be able to connect to that user frequently. Once the script has finished close putty and open FileZilla.

 

You’ll now need to edit the projectzomboid-dedi-server.sh and set your RAM values. This is dependant on how much RAM your server has, I personally didn't set them to use my complete server capacity, I did about half but the choice is up to you. (Kirrus: Don't set more than 80% of your VM's capacity.) Use FileZilla and double click on the file and it should open it up in an editor, find these two lines:

 

   -Xms1024m \

   -Xmx1024m \

 

And edit the values to your choosing. Save and close the file and it will prompt you for the root password of FileZilla so put it in and it will be updated. When using FileZilla, do not use quick connect but the server manager. When it asks for protocol do NOT use FTP, use SFTP otherwise you will be unable to connect to the server.

 

Now open putty back up and log into the pz-server user and run this command.

bash pz-server-start.sh

This should start up the server. If it seems to be acting strange then you can do it this way instead:

screen -dr

(Checking to see if there is a screen running.) If it doesn't say no screen detached, skip next step.

screen

Enter through it until you face something that looks like:

 

pz-server@server -

 

thing.

 

Do:

cd /home/pz-server/Steam/steamapps/common/ProjectZomboid

then

./projectzomboid-dedi-server.sh

that will get the server started if the script seems to be acting up.

 

Future...

 

I do plan to make this a more in depth system as time goes on, to hopefully move through complete server autonomy. I want to turn this into a bit of a project hopefully. So will see where it takes me. 

 

Support

 

Obviously the scripts should work fine since I've tested them a couple of times but always be on the lookout for any errors that might be spawning in the console in case they might shed light on the situation. I've tested this on Debian Wheezy so I know it should work fine (except for the problems mentioned above) but obviously unknown problems can pop up, so if this is the case then just post in here (please don't PM me) and I'll see if I can't resolve the problem.

 

License

 

For those that care it's using a Attribution-NonCommercial 4.0 International: http://creativecommons.org/licenses/by-nc/4.0/

I doubt the script would get the attention of anybody who would be using it for commercial purposes, but I just decided to do it that way just in case. (Original Attribution and non removal of credits is also required.)

 

I would appreciate if scripts being released as an adapt were done so when it's clear I'm no longer around and can not work on the project anymore.

 

Programmers

 

As I said above, everything is on Github if you want to take a look at the source code to check for anything malicious (which there isn't) before running it on your server, if you feel like pointing something out on a way to improve it then go nuts, I'll listen but I imagine the big ones like checking if program is already installed or check if file exists are already things I want to be tackling in the coming updates (hopefully.)

 

Disclaimer

 

While I make sure the scripts work and won't mess up/with a server, I still must say that you use these scripts at your own risk. I'm not responsible for any perceived damage they may cause and that if using these scripts on a server with existing important data, then I recommend backing up this data before using the scripts. If something does go wrong, a quick fix is usually an OS re-install away.

 

Now obviously I don't believe the scripts should be causing catastrophic problems, but I don't want anybody blaming me for their serving becoming messed up.

 

FAQ

 

Q. Why you doing this?

 

A: I needed a project. I was originally going to write some guides for Multiplayer to exist beside my Linux Server setup guide but the ever changing nature of multiplayer caused a couple of guides to become obsolete. So I decided to tackle an issue on something I knew about and I like helping people, so there's that.

 

Q: How is this going to be expanded?

 

A: One thing I really want to aim to do is make a website interface and cut out the terminal in it's entirety but that's a long time down the road I think. Most likely working on stuff like automating backups and fixing the running server and fixing beta branches. Really just see where the road takes me.

 

Q: I have knowledge about x can I help?

 

A: This is a very personal project for me as a way of building up my knowledge so at the moment I'm not particularly looking for help. You can offer me help, and I'll keep you in mind if I decide to expand this out otherwise I'm just going to keep going at this, chipping it away by myself.

 

Q: Support for OS Y

 

A: If it's a Linux derivative and can run Project Zomboid, odds are a script will come with it. However this is really for people who don't understand Linux all that well, so don't expect me to help every single little os.

 

Q: What about Windows?

 

A: I kind of feel that setting up a server for Windows is easy enough already without requiring more help, so support for it will not be coming. Same goes for Mac's.

 

Q: What about updating scripts?

 

A: At the moment you still have to run the wget command. I'll probably introduce a script update script for the time being use wget for the following addresses if needed 

 

http://www.terminal-control.com/pz-server/scripts/pz-server-install.sh

http://www.terminal-control.com/pz-server/scripts/pz-server-part2.sh

http://www.terminal-control.com/pz-server/scripts/pz-server-start.sh

http://www.terminal-control.com/pz-server/scripts/pz-server-update.sh

 

Install should be gotten in root user, while start and update should be gotten through pz-servers user.

 

 

Enjoy!

 

 

Credits

 

Myself (Connall Lindsay) - Script Creator

Kirrus - Assistance

Everybody who read and commented on the guide, really appreciate it. <3

Link to comment
Share on other sites

  • 2 weeks later...

Can get through most of the install correctly, but I still seem to get hung up on the same part as when I manually installed.

 

After successfully running the install script, I edit proper RAM values for the server and log in as pz-server.  However, when I try to "bash pz-server-start.sh," I get:

pz-server@frontier-entertainment:~$ bash pz-server-start.shRunning debian wheezy, continuing=====WELCOME TO PROJECT ZOMBOID SERVER START SCRIPT==========Script Created by: Connall Lindsay=====Killing all screens...Starting screen.../var/run/screen/S-pz-server/11992.pts-1.frontier-entertainment: No such file or directoryServer started.pz-server@frontier-entertainment:~$ 

When I try to "screen -dr" first, I get, "There is no screen to be detached."  So I "screen," and I get:

pz-server@frontier-entertainment:~$ screen/var/run/screen/S-pz-server/11992.pts-1.frontier-entertainment: No such file or directory

And if I simply don't use screen at all, I wind up with:

pz-server@frontier-entertainment:~$ cd /home/pz-server/Steam/steamapps/common/ProjectZomboidpz-server@frontier-entertainment:~/Steam/steamapps/common/ProjectZomboid$ ./projectzomboid-dedi-server.shbash: ./projectzomboid-dedi-server.sh: /bin/bash^M: bad interpreter: No such file or directorypz-server@frontier-entertainment:~/Steam/steamapps/common/ProjectZomboid$

Any idea what I'm doing wrong?

Link to comment
Share on other sites

@Connall:

pz-server@frontier-entertainment:~$ ls -ltotal 20-rw-r--r-- 1 pz-server pz-server 1363 Apr  7 15:05 pz-server-part2.sh-rw-r--r-- 1 pz-server pz-server  905 Apr  7 15:05 pz-server-start.sh-rw-r--r-- 1 pz-server pz-server 1389 Apr  7 15:05 pz-server-update.shdrwxr-xr-x 7 pz-server pz-server 4096 Apr 22 05:47 Steamdrwxr-xr-x 6 pz-server pz-server 4096 Apr 22 05:14 steamcmdpz-server@frontier-entertainment:~$ cd /home/pz-server/Steam/steamapps/common/ProjectZomboidpz-server@frontier-entertainment:~/Steam/steamapps/common/ProjectZomboid$ ls -ltotal 12drwxr-xr-x 19 pz-server pz-server 4096 Apr 22 05:44 projectzomboid-rwxr-xr-x  1 pz-server pz-server  881 Apr 22 05:50 projectzomboid-dedi-server.sh-rwxr-xr-x  1 pz-server pz-server  864 Apr 22 05:14 projectzomboid.shpz-server@frontier-entertainment:~/Steam/steamapps/common/ProjectZomboid$

@harakka:  dos2unix seems to have worked; I can successfully start the server manually now.  As far as screen goes, I've used it successfully in the past to run a Minecraft server.  No clue why it isn't working now.  o.0

 

EDIT:

Huh; after having used dos2unix, the server start script seems to work properly, too, as does screen.  Thanks for the help!  xD

Link to comment
Share on other sites

  • 1 month later...

Hey. I'm not able to run the script on my server at all. While I could do the manual install process, I would rather I not make any mistakes.

 

I get this error after putting in the bash command:

 

root@mmeier:~# bash pz-server-install.sh
pz-server-install.sh: line 37: syntax error near unexpected token `else'
'z-server-install.sh: line 37: `else
 
I'm running a Debain 7 Wheezy x64 server on NFO Servers.
 
Please help.
Link to comment
Share on other sites

 

Hey. I'm not able to run the script on my server at all. While I could do the manual install process, I would rather I not make any mistakes.

 

I get this error after putting in the bash command:

 

root@mmeier:~# bash pz-server-install.sh
pz-server-install.sh: line 37: syntax error near unexpected token `else'
'z-server-install.sh: line 37: `else
 
I'm running a Debain 7 Wheezy x64 server on NFO Servers.
 
Please help.

 

 

Looking at it now.

 

Edit: Oddly nothing went wrong on my end, it went all fine. Wonder why...

 

Do

ls -l

in the folder you start in and delete and pz-server-install files using the

rm pz-server-install.sh

command. Redownload the install script and try again.

Link to comment
Share on other sites



Resolving www.terminal-control.com (www.terminal-control.com)... 192.223.24.135

Connecting to www.terminal-control.com (www.terminal-control.com)|192.223.24.135|:80... connected.

HTTP request sent, awaiting response... 200 OK

Length: 2013 (2.0K) [text/x-sh]

Saving to: `pz-server-install.sh'

 

100%[======================================>] 2,013       --.-K/s   in 0s

 

2014-06-08 16:05:33 (257 MB/s) - `pz-server-install.sh' saved [2013/2013]

 

root@mmeier:~# bash pz-server-install.sh

pz-server-install.sh: line 37: syntax error near unexpected token `else'

'z-server-install.sh: line 37: `else

root@mmeier:~#

 

 

Makes me a sad zomboid :(

Link to comment
Share on other sites

 

Resolving www.terminal-control.com (www.terminal-control.com)... 192.223.24.135
Connecting to www.terminal-control.com (www.terminal-control.com)|192.223.24.135|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 2013 (2.0K) [text/x-sh]
Saving to: `pz-server-install.sh'
 
100%[======================================>] 2,013       --.-K/s   in 0s
 
2014-06-08 16:05:33 (257 MB/s) - `pz-server-install.sh' saved [2013/2013]
 
root@mmeier:~# bash pz-server-install.sh
pz-server-install.sh: line 37: syntax error near unexpected token `else'
'z-server-install.sh: line 37: `else
root@mmeier:~#
 
 
Makes me a sad zomboid :(

 

 

Alright delete the file again and redownload from the server. Pushed an update that might be causing the problem, see what happens. :D

Link to comment
Share on other sites

 

Well.. the error changed... that some thing :D

 

root@mmeier:~# bash pz-server-install.sh
pz-server-install.sh: line 71: syntax error: unexpected end of file
root@mmeier:~#
 
Also, thank you so much for your help!

 

 

I might cry in a corner. Right see if I can pin this down again, this is an interesting error.

 

Edit: Can't find why this is happening, will look more into it tomorrow since I should really get some sleep. :)

Link to comment
Share on other sites

When attempting the line

bash pz-server-install.sh 

I get the error:

pz-server-install.sh: line 70: syntax error: unexpected end of file

Get the same error on both Ubuntu and Weezy.

 

Yeah I'm aware, been busy lately so haven't been able to look into the issue.

Link to comment
Share on other sites

 

When attempting the line

bash pz-server-install.sh 

I get the error:

pz-server-install.sh: line 70: syntax error: unexpected end of file

Get the same error on both Ubuntu and Weezy.

 

Yeah I'm aware, been busy lately so haven't been able to look into the issue.

 

 

Line 43, might need to end with a semicolon? Don't think it's required with that spacing, but worth a try.

Link to comment
Share on other sites

Well, here am i again too. I had the same error as zyros and TheGmork. The only error in the first script is that it has somewhere an incorrect line-ending. I replaces all line-ending (backspace + enter) after each fi. However, the next scripts also have errors (at my vps).

 

These errors seem to be incorrect line-einding too (altho different ones). I fixed those by installing fromdos (apt-get install fromdos) and use the fromdos command on every single downloaded script file (pz-server-backup.sh, pz-server-start.sh, pz-server-update.sh) while loggedin as the pz-server user. After that, the scripts ran fine. I havent checked if the server will run tho. just sharing these pre-mature findings =)

Link to comment
Share on other sites

Ok, I have my server running. But I feel like I've just had someone holding my hand for the entire set up. (Thank you though, so useful!)

 

In my eyes I can't manage a Project Zomboid server without learning more about the Linux CMD interface...Can anyone point me to any relevant resources to help me learn how to use this interface comprehensively? 

Thank you, I'm sure others will find this useful too.



Is this a good resource to use? Or is some of this information irrelevant for running a Linux-based server? 
http://linuxcommand.org/learning_the_shell.php

 

Sorry, I feel that this post strays from the original topic, I can have it remove if wished.

Link to comment
Share on other sites

Ok, I have my server running. But I feel like I've just had someone holding my hand for the entire set up. (Thank you though, so useful!)

 

In my eyes I can't manage a Project Zomboid server without learning more about the Linux CMD interface...Can anyone point me to any relevant resources to help me learn how to use this interface comprehensively? 

Thank you, I'm sure others will find this useful too.

Is this a good resource to use? Or is some of this information irrelevant for running a Linux-based server? 

http://linuxcommand.org/learning_the_shell.php

 

Sorry, I feel that this post strays from the original topic, I can have it remove if wished.

 

http://theindiestone.com/forums/index.php/topic/5841-buying-running-a-linux-project-zomboid-server/

 

My other guide covers what you really need to know and use for something like this. Outside of that there isn't really anything you need to know except basic commands like changing directories and removing files.

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...