[HOW-TO] Set up your VPS/Dedicated Linux server for SA-MP with FTP!
#1

UPDATE
How to use iptables with centos (ban dos attacks etc) http://wiki.centos.org/HowTos/Network/IPTables
This should work with both 32 and 64bit
If you dont want to use ProFTPD for your ftp server, you can also use the alternative of vsftpd. Here is a guide to be followed (http://www.cyberciti.biz/faq/rhel-ce...ll-ftp-server/).
If your going to use VSFTPD then use the guide for step 3


I know that theres something like this on the wiki, but im going into alittle more depth for people who want to have a full solution.

This is for Centos 5, but you could do it on other distros of linux in a similar fashion.

1) Connecting to your server
2) Installing Webmin - Overall control panel for your server
3) Installing ProFTPD & Setting up FTP Accounts - FTP Access to your files
4) Setting up your SAMP Server directory & Running your SAMP Server

First of all you need a vps or a dedicated server. Once you've got that, follow these steps to get your samp server up and running.

1. Connecting to your server.
You can use a variety of different SSH Clients to connect to your server, i personally prefer Putty the most.
Download
Okay after you've got putty set up, open it up.

Put in your MAIN ip address to your server, and hit open at the bottom.
Make sure that the port connection is 22 unless your hoster specified otherwise.

Login with your information specified by your hoster.
Login as will almost always be root
Your password will be what you defined when you bought the server. You should now have a commandline similar to mine. Congrats, you connected to your server.

2.Installing Webmin
Okay, dont forget that im doing this on Centos, i cant highlight how to do this on every different linux system because it'll just take too long, but the ideas are the same. I highly recommend using linux, so if you haven't already you should switch over :]
Use these commands to install webmin
this will download webmin to your server. now use this command to install it
Code:
rpm -ivh webmin-1.490.noarch.rpm
After its installed you should be able to access webmin by going to
http://yourserversipaddress:10000

3. Installing ProFTPd on Centos 5
first we need all compilers neccessary
Code:
yum install gcc
Code:
yum install gcc-c++
Code:
yum install make
Set up the group that proftpd will run under
Code:
groupadd proftpd
Code:
useradd -d /srv/ftp -g proftpd -s /usr/bin/ftpshell proftpd
Code:
install -v -d -m775 -o proftpd -g proftpd /srv/ftp
Code:
ln -v -s /bin/false /usr/bin/ftpshell
Code:
echo /usr/bin/ftpshell >> /etc/shells
Okay, now lets install proftpd. First we need to download the source files
Code:
cd /usr/src_proftpd
Code:
tar xjf proftpd-1.3.2.tar.bz2
Code:
rm -f proftpd-1.3.2.tar.bz2
Now that we've got them extracted, lets install it
Code:
cd /usr/src_proftpd/proftpd-1.3.2
Code:
./configure --prefix=/usr --sysconfdir=/etc --localstatedir =/var/run
Code:
make
Code:
make install
Now we have to edit the configuration file , its located in /etc/proftpd.conf
You can use
Code:
vi /etc/proftpd.conf
but here im going to show you how to do it in webmin.
First log onto webmin. Then goto others->filemanager
Navigate to etc
Find the file called proftpd.conf
[img width=1024 height=489]http://destinyx.net/webmin.jpg[/img]
Hit the edit button when you've found it and modify the file to this.

Code:
#This is a basic ProFTPD configuration file (rename it to
# 'proftpd.conf' for actual use. It establishes a single server
# and a single anonymous login. It assumes that you have a user/group
# "nobody" and "ftp" for normal operation and anon.

ServerName           "Put in your server name here!"
ServerType           standalone
DefaultServer          on

# Port 21 is the standard FTP port.
Port              21

# Umask 022 is a good standard umask to prevent new dirs and files
# from being group and world writable.
Umask              022

# To prevent DoS attacks, set the maximum number of child processes
# to 30. If you need to allow more than 30 concurrent connections
# at once, simply increase this value. Note that this ONLY works
# in standalone mode, in inetd mode you should use an inetd server
# that allows you to limit maximum number of processes per service
# (such as xinetd).
MaxInstances          30

# Set the user and group under which the server will run.
User              proftpd
Group              proftpd

# To cause every FTP user to be "jailed" (chrooted) into their home
# directory, uncomment this line.
DefaultRoot ~

# Normally, we want files to be overwriteable.
AllowOverwrite     on

# Bar use of SITE CHMOD by default
<Limit SITE_CHMOD>
 DenyAll
</Limit>
Now lets clean up all those source files we downloaded
Code:
cd /usr/src_proftpd
Code:
rm -Rf proftpd-1.3.2
And start up the ftp server!
Code:
proftpd
Okay, almost done. Now we need to make a FTP account for your server
Code:
useradd -d/home/yourusername -m yourusername
Code:
passwd yourusername
you can rename samp to whatever you want your folder and login name to be called, but it has to not exist yet or else it will fail
change your password to whatever you want it to be

Code:
Now you can login using a ftp client like FileZilla via this
Host : Your servers ip address
Port : 21
Username : yourusername
Password : yourpassword
Your username and your password being the ones you defined above under useradd and passwd

4. Almost done. all we have to do now is upload the samp files and run them. From now on im going to be reffering to my home samp directory as
Code:
/home/samp
my username as samp and my password as samp
but it will be different for everyone depending on what you defined it as.

Log into ssh
Code:
cd /home/samp
Code:
tar xvfz samp02Xsvr.tar.gz
Now log into your ftp, click on the samp02X folder, upload all your files, edit the cfg. Now get back into SSH and lets turn on your samp server.
Code:
cd /home/samp/samp02X/
Code:
nohup ./samp02X
Want to turn off your server (kill it) ? Use this method

Log into SSH
Code:
ps -ef
this command will generate a list of all processes on your server. Look for the ./samp02Xsvr under CMD
This was the one i had
Code:
root   13516   1 0 21:07 ?    00:00:00 ./samp02Xsvr
To kill the samp server, all you need to do now is get the processid, in this case it was 13516 and type
Code:
kill -9 13516
There, now your server is turned off!
If your going to be running more then one server i would recommend assigning different ssh groups for each server that you run so that its easier to differentiate.

And heres some other commands you can use on your linux server.

Finding your processor model & name
Code:
cat /proc/cpuinfo | grep -i 'Model'
Example Usage :
Code:
[root@linx2 ~]# cat /proc/cpuinfo | grep -i 'Model'
model      : 23
model name   : Intel® Core™2 Quad CPU  Q9400 @ 2.66GHz
View how much free ram you have in MB
Code:
free -m
If you want to view it in GB use this command
Code:
free -g
Example Usage :
Code:
[root@linx4 ~]# free -m
       total    used    free   shared  buffers   cached
Mem:      1768    1113    1654     0     0     0
-/+ buffers/cache:    1113    1654
Swap:      0     0     0
General System Information command
Code:
top
I hope that helped someone, i could of really used one of these when i first started out with samp and linux :P

Note : This was geared at if your running only one server on your box. If your planning on running more then one server you should use seperate user accounts for each server that is being run


Reply


Messages In This Thread
[HOW-TO] Set up your VPS/Dedicated Linux server for SA-MP with FTP! - by iLinx - 03.10.2009, 17:40
Re: [HOW-TO] Set up your VPS/Dedicated Linux server for SA-MP with FTP! - by Jbosh123 - 10.10.2009, 08:09
Re: [HOW-TO] Set up your VPS/Dedicated Linux server for SA-MP with FTP! - by [mad]MLK - 10.10.2009, 16:09
Re: [HOW-TO] Set up your VPS/Dedicated Linux server for SA-MP with FTP! - by Tigerbeast11 - 10.10.2009, 16:17
Re: [HOW-TO] Set up your VPS/Dedicated Linux server for SA-MP with FTP! - by Dreftas - 10.10.2009, 23:21
Re: [HOW-TO] Set up your VPS/Dedicated Linux server for SA-MP with FTP! - by iLinx - 11.10.2009, 02:32
Re: [HOW-TO] Set up your VPS/Dedicated Linux server for SA-MP with FTP! - by Dreftas - 11.10.2009, 10:20
Re: [HOW-TO] Set up your VPS/Dedicated Linux server for SA-MP with FTP! - by brett7 - 11.10.2009, 11:04
Re: [HOW-TO] Set up your VPS/Dedicated Linux server for SA-MP with FTP! - by iLinx - 11.10.2009, 15:56
Re: [HOW-TO] Set up your VPS/Dedicated Linux server for SA-MP with FTP! - by Dreftas - 11.10.2009, 17:37
Re: [HOW-TO] Set up your VPS/Dedicated Linux server for SA-MP with FTP! - by Dreftas - 12.10.2009, 17:10
Re: [HOW-TO] Set up your VPS/Dedicated Linux server for SA-MP with FTP! - by Pghpunkid - 12.10.2009, 17:24
Re: [HOW-TO] Set up your VPS/Dedicated Linux server for SA-MP with FTP! - by [mad]MLK - 13.10.2009, 23:47
Re: [HOW-TO] Set up your VPS/Dedicated Linux server for SA-MP with FTP! - by Pghpunkid - 16.10.2009, 02:25
Re: [HOW-TO] Set up your VPS/Dedicated Linux server for SA-MP with FTP! - by Westie - 16.10.2009, 09:41
Re: [HOW-TO] Set up your VPS/Dedicated Linux server for SA-MP with FTP! - by Aur0nX390 - 23.10.2009, 19:16
Re: [HOW-TO] Set up your VPS/Dedicated Linux server for SA-MP with FTP! - by eXchainZ-FoReVeR - 24.10.2009, 14:04
Re: [HOW-TO] Set up your VPS/Dedicated Linux server for SA-MP with FTP! - by RoBo - 24.10.2009, 21:09
Re: [HOW-TO] Set up your VPS/Dedicated Linux server for SA-MP with FTP! - by Aur0nX390 - 25.10.2009, 14:33
Re: [HOW-TO] Set up your VPS/Dedicated Linux server for SA-MP with FTP! - by iLinx - 04.11.2009, 13:54
Re: [HOW-TO] Set up your VPS/Dedicated Linux server for SA-MP with FTP! - by Cool_Boy27 - 12.11.2010, 09:34
Re: [HOW-TO] Set up your VPS/Dedicated Linux server for SA-MP with FTP! - by Jousha_Friller - 12.11.2010, 15:31
Re: [HOW-TO] Set up your VPS/Dedicated Linux server for SA-MP with FTP! - by Scenario - 12.11.2010, 16:10

Forum Jump:


Users browsing this thread: 1 Guest(s)