[Tutorial] SA:MP Server on a Linux Based Server
#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...0912493tar 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


Messages In This Thread
[Tutorial] SA:MP Server on a Linux Based Server - by VOXrr - 20.03.2012, 16:45
Re: [Tutorial] SA:MP Server on a Linux Based Server - by [UE]Milan - 20.03.2012, 17:28
Re: [Tutorial] SA:MP Server on a Linux Based Server - by ColorHost-Kevin - 21.03.2012, 14:01
Re: [Tutorial] SA:MP Server on a Linux Based Server - by VOXrr - 21.03.2012, 14:56
Re: [Tutorial] SA:MP Server on a Linux Based Server - by [UE]Milan - 25.04.2012, 09:03
Re: [Tutorial] SA:MP Server on a Linux Based Server - by DaRealShazz - 01.06.2012, 17:12
Re: [Tutorial] SA:MP Server on a Linux Based Server - by 3ventic - 01.06.2012, 19:53
Re: [Tutorial] SA:MP Server on a Linux Based Server - by DaRealShazz - 02.06.2012, 01:10
Re: [Tutorial] SA:MP Server on a Linux Based Server - by Inverse - 02.06.2012, 03:57
Re: [Tutorial] SA:MP Server on a Linux Based Server - by Samp_India - 02.06.2012, 04:07
Re: [Tutorial] SA:MP Server on a Linux Based Server - by DaRealShazz - 03.06.2012, 20:07
Re: [Tutorial] SA:MP Server on a Linux Based Server - by iLinx - 03.06.2012, 21:13
Re: [Tutorial] SA:MP Server on a Linux Based Server - by Genuine - 03.06.2012, 21:33
Re: [Tutorial] SA:MP Server on a Linux Based Server - by DaRealShazz - 04.06.2012, 20:05
Re: [Tutorial] SA:MP Server on a Linux Based Server - by shayan122 - 21.06.2012, 08:52
Re: [Tutorial] SA:MP Server on a Linux Based Server - by Dr4mX123 - 21.06.2012, 08:53
Re: [Tutorial] SA:MP Server on a Linux Based Server - by SampLoverNo123 - 21.06.2012, 09:00
Re: [Tutorial] SA:MP Server on a Linux Based Server - by SkL_MD - 21.06.2012, 09:03
Re: [Tutorial] SA:MP Server on a Linux Based Server - by shayan122 - 21.06.2012, 18:15
Re: [Tutorial] SA:MP Server on a Linux Based Server - by Don_Ciamis - 04.08.2012, 23:28
Re: [Tutorial] SA:MP Server on a Linux Based Server - by VOXrr - 07.08.2012, 13:30
Web Server Time! - by VOXrr - 07.08.2012, 14:11
Re: [Tutorial] SA:MP Server on a Linux Based Server - by [EuG]ZeRoGoD - 07.08.2012, 14:14
Re: [Tutorial] SA:MP Server on a Linux Based Server - by VOXrr - 07.08.2012, 14:18
Re: [Tutorial] SA:MP Server on a Linux Based Server - by fadhilkab - 31.08.2012, 16:01
Re: [Tutorial] SA:MP Server on a Linux Based Server - by Akira297 - 01.09.2012, 06:33
Re: [Tutorial] SA:MP Server on a Linux Based Server - by Black Wolf - 01.09.2012, 06:37
Re: Web Server Time! - by nenelokao - 29.06.2013, 04:12
Re: [Tutorial] SA:MP Server on a Linux Based Server - by d0nTtoucH - 17.01.2014, 17:49
Re: [Tutorial] SA:MP Server on a Linux Based Server - by Guest4390857394857 - 14.03.2014, 04:46
Re: [Tutorial] SA:MP Server on a Linux Based Server - by KtotheYle - 10.07.2014, 08:01
Re: [Tutorial] SA:MP Server on a Linux Based Server - by Astralis - 10.07.2014, 15:47
Re: [Tutorial] SA:MP Server on a Linux Based Server - by KtotheYle - 10.07.2014, 18:16
Re: [Tutorial] SA:MP Server on a Linux Based Server - by KtotheYle - 10.07.2014, 18:31
Re: [Tutorial] SA:MP Server on a Linux Based Server - by RoC4life - 20.01.2015, 08:40
Re: [Tutorial] SA:MP Server on a Linux Based Server - by Samp_India - 20.01.2015, 08:56
Re: [Tutorial] SA:MP Server on a Linux Based Server - by Ironboy - 20.01.2015, 08:59
Re: [Tutorial] SA:MP Server on a Linux Based Server - by RoC4life - 24.01.2015, 04:22
Re: [Tutorial] SA:MP Server on a Linux Based Server - by mahmod - 19.08.2015, 18:18
Re: [Tutorial] SA:MP Server on a Linux Based Server - by YuKki1 - 20.08.2015, 00:32
Re: [Tutorial] SA:MP Server on a Linux Based Server - by DandyCorleone - 17.12.2016, 10:53
Re: [Tutorial] SA:MP Server on a Linux Based Server - by iLearner - 17.12.2016, 11:03
Re: [Tutorial] SA:MP Server on a Linux Based Server - by RayBiH - 17.12.2016, 11:35
Re: [Tutorial] SA:MP Server on a Linux Based Server - by Filbert - 06.09.2017, 16:58
Re: [Tutorial] SA:MP Server on a Linux Based Server - by Astralis - 06.09.2017, 17:01
Re: [Tutorial] SA:MP Server on a Linux Based Server - by Filbert - 06.09.2017, 17:06
Re: [Tutorial] SA:MP Server on a Linux Based Server - by Astralis - 06.09.2017, 17:08
Re: [Tutorial] SA:MP Server on a Linux Based Server - by Filbert - 06.09.2017, 17:17
Re: [Tutorial] SA:MP Server on a Linux Based Server - by SH0x - 08.12.2017, 17:10
Re: [Tutorial] SA:MP Server on a Linux Based Server - by Ilias_ - 10.12.2017, 07:12
Re: [Tutorial] SA:MP Server on a Linux Based Server - by Barnwell - 10.12.2017, 10:34

Forum Jump:


Users browsing this thread: 2 Guest(s)