[Tutorial] SA:MP Server on a Linux Based Server
#21

Quote:
Originally Posted by iLinx
View Post
Code:
yum -y install httpd
service httpd start
Apache :<

Yeah, I'll do a Nginx+MySQL+PHP tutorial when I have the time.
I might need to check if it's 'okay' for it to be posted in here though, since it's the SA:MP Server Support forum.
Reply
#22

Let's get a web server running!
Howdy folks, me again with a long-winded tutorial.

That being said, I use automation scripts to get web servers deployed because... well... it's easier.
Luckily, these scripts are out in the open and made by some great guys. I'll credit them appropriately, and let you know how to get in contact with them.
Quote:
Requirements:

Quite seriously, I've ran a full SA:MP server and a web server stack in under 128MB of RAM - That said, I'd recommend you opt for at least 256MB RAM for a small community. If you're a large community, scale appropriately.

I've split this into two sections, a Debian based section (Debian/Ubuntu) and RHL based section (CentOS/Fedora/Scientific Linux) as the scripts I use aren't cross compatible with the different package managers.
So in short, please ensure you're using the latest version of your chosen Linux distribution.

Common sense - Seriously, I've deployed these scripts hundreds of times. If you've managed to mess it up, you're doing it wrong.

Quote:
Presumptions:
  • You're able to log into your server via SSH. See the first post if you're not able to.
  • You're able to follow instructions.
Quote:
Credits:
Tutorials

Quote:
RHL Based Distros

A Script?!

Below is a script that pretty much sets everything up automatically in five minutes.
Although you can look at the code yourself, I'll run through what it does:
  1. Adds additional repos
  2. Updates your system
  3. Removes unneeded waste (Apache)
  4. Installs the latest versions of Nginx, PHP and MySQL
Let's install it!

So, quite simply, run these two commands.
and hit enter, or type 'Yes' when prompted.

Код:
yum -y install wget --noplugins
wget freevps.us/downloads/nginx-centos-6.sh -O - |bash
Secure it!

Congratulations! Type in your server's IP and you should get a 'Welcome to Nginx Page'
If you haven't already set up the MySQL server (see the first post) you'll need to secure it up. Luckily, there's a simple command with prompts that'll help you with that.

Код:
 /usr/bin/mysql_secure_installation
Add Websites!

The chap who made this script was kind enough to make a script that automatically generates virtual host files for Nginx. So, presuming your website is virt.io, you'd run the following command

Код:
setup-vhost virt.io
Then you'd upload your stuff to /var/www/virt.io/
Simple, right?

PHPMyAdmin!

Well, I'm not a huge fan of it, but I guess some people need it.
In essence, what we need to do is download it, extract the archive, and plonk the files into your web directory. Simple.

Note: This presumes the latest stable version of PhpMyAdmin is 3.5.2.1 - If this topic is old when you read it, make sure you're downloading the latest version. Adjust the commands where necessary.
Код:
yum install unzip
cd /var/www/yourdomain.com
http://switch.dl.sourceforge.net/project/phpmyadmin/phpMyAdmin/3.5.2.1/phpMyAdmin-3.5.2.1-all-languages.zip
unzip phpMyAdmin-3.5.2.1-all-languages.zip
mv phpMyAdmin-3.5.2.1-all-languages pma
You'll then be able to access phpmyadmin at yourdomain.com/pma/

Easy.

Quote:
Debian Based Distros

Scripts!

Firstly, log into your server via SSH, and create a folder for the scripts.
These scripts automate the process, so there's less for you to mess up.

Код:
mkdir tuxlite
cd tuxlite
Download the scripts!

Then, download and extract the Tuxlite files into that directory using the wget and tar commands.

Код:
wget http://tuxlite.com/scripts/lnmp-debian-m...8869169tar zxf lnmp-debian-multiuser-dotdeb.tar.gz
Edit the Options!

Once this is done, it’s advisable to make a couple changes to the options.conf file.

The TuxLite script automatically sets the root MySQL password, as well as sets the apt repository to use both Debian’s Squeeze and DotDeb’s repositories
Luckily, this is very simple to edit using the nano command, or if you prefer, vi.

Код:
nano options.conf
When the options are set to your liking, you’ll be ready to commence the installation process.

Get Installed!

Firstly, ensure the files can be executed.

Код:
chmod 777 *.sh
chmod 777 options.conf
Then, run the following commands, letting each one complete.
When prompted, enter your MySQL root password, and optionally configure the self-signed SSL certificate.

Код:
./setup.sh apt
./setup.sh lnmp
./setup.sh optimizelnmp
Add Websites!

Now you have a fully working LNMP stack, you can now add individual domains using the domain.sh script.
Please note, you can not add domains under root, so you may need to use the adduser command beforehand.


To add a domain, use the following command whilst in your tuxlite directory.

Код:
./domain.sh add yourusername yourdomain.name
PhpMyAdmin!

Well, I'm not a huge fan of it, but I guess some people need it.
In essence, what we need to do is download it, extract the archive, and plonk the files into your web directory. Simple.

Note: This presumes the latest stable version of PhpMyAdmin is 3.5.2.1 - If this topic is old when you read it, make sure you're downloading the latest version. Adjust the commands where necessary.
Код:
apt-get install unzip
cd /home/yourusername/yourdomain.com/public_html/
http://switch.dl.sourceforge.net/project/phpmyadmin/phpMyAdmin/3.5.2.1/phpMyAdmin-3.5.2.1-all-languages.zip
unzip phpMyAdmin-3.5.2.1-all-languages.zip
mv phpMyAdmin-3.5.2.1-all-languages pma
You'll then be able to access phpmyadmin at yourdomain.com/pma/

Simple.

Well, that's pretty much it.

If something blatantly isn't right, give me a buzz, and I'll fix it up.
Reply
#23

Umm shoulda been in the top part not comments lol but good job
Reply
#24

Quote:
Originally Posted by [EuG]ZeRoGoD
Посмотреть сообщение
Umm shoulda been in the top part not comments lol but good job
Meh, I'll edit the first post with a link to the web server bit. Happy?
Reply
#25

Awsome Tutorial!
Reply
#26

Why isn't this inside the tutorial area?
Reply
#27

Nice but can ya tell how to install restarter ?? a step to step guide please ?
Reply
#28

Quote:
Originally Posted by VOXrr
Посмотреть сообщение
Let's get a web server running!
Howdy folks, me again with a long-winded tutorial.

That being said, I use automation scripts to get web servers deployed because... well... it's easier.
Luckily, these scripts are out in the open and made by some great guys. I'll credit them appropriately, and let you know how to get in contact with them.






Tutorials





Well, that's pretty much it.

If something blatantly isn't right, give me a buzz, and I'll fix it up.

Thanks man for this tutorial, it help me a lot, i need some help configuring my samp server in a centos 6 vps, i've done just like the tutorial, server start, it's runing i send "ps" and its been runing but i can't see the server in samp client, keep retrieving info and nothing else happen, please if you can giveme some help, sorry my bad english i am braziliam
Reply
#29

how to change the gamemode ?
Reply
#30

Quote:
Originally Posted by d0nTtoucH
View Post
how to change the gamemode ?
login into rcon

Code:
/rcon login pass
then use this
PHP Code:
/rcon changemode newgamemodename 
Reply
#31

Quote:
Originally Posted by VOXrr
View Post
Thanks for the feedback guys, it's appreciated



Well, you could phone up your ISP and ask politely for a static IP.
Alternatively, you could find a way to stop your modem from rebooting/disconnecting/turning off, which might prolong your IP lease.
Can you please help me with my error?

I am using nohup ./samp03svr (and nohup ./samp03svr &) it gives me this

Code:
nohup: ignoring input and appending output to ‘nohup.out’
But when I go to my server it isn't started. The port is the same and the IP is.

Any help is AWESOMELY appreciated!
Reply
#32

Quote:
Originally Posted by KtotheYle
View Post
Can you please help me with my error?

I am using nohup ./samp03svr (and nohup ./samp03svr &) it gives me this

Code:
nohup: ignoring input and appending output to ‘nohup.out’
But when I go to my server it isn't started. The port is the same and the IP is.

Any help is AWESOMELY appreciated!
Check your server_log.txt (and server.cfg), might be missing something.
Reply
#33

Quote:
Originally Posted by Neonman
View Post
Check your server_log.txt (and server.cfg), might be missing something.
Fixed my .cfg, looked over changing them from a .dll to a .so. Updated all the plugins and still nothing.
Reply
#34

Quote:
Originally Posted by KtotheYle
View Post
Fixed my .cfg, looked over changing them from a .dll to a .so. Updated all the plugins and still nothing.
Also no logs are being created.
Reply
#35

Nano command not found -_-
Reply
#36

Quote:
Originally Posted by RoC4life
View Post
Nano command not found -_-
Just use Filezilla or WinSCP to edit the file.
Reply
#37

Quote:
Originally Posted by RoC4life
View Post
Nano command not found -_-
If you're using ubuntu, try this

Quote:

sudo apt-get update
sudo apt-get install nano

Reply
#38

thanks
Reply
#39

apper to me this http://prntscr.com/86j3of.
Reply
#40

Hi , could anyone help me fixing this problem please ? And thanks
https://sampforum.blast.hk/showthread.php?tid=586150
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)