03.10.2009, 17:40
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
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
Set up the group that proftpd will run under
Okay, now lets install proftpd. First we need to download the source files
Now that we've got them extracted, lets install it
Now we have to edit the configuration file , its located in /etc/proftpd.conf
You can use
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.
Now lets clean up all those source files we downloaded
And start up the ftp server!
Okay, almost done. Now we need to make a FTP account for your server
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
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
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
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.
Want to turn off your server (kill it) ? Use this method
Log into SSH
this command will generate a list of all processes on your server. Look for the ./samp02Xsvr under CMD
This was the one i had
To kill the samp server, all you need to do now is get the processid, in this case it was 13516 and type
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
Example Usage :
View how much free ram you have in MB
If you want to view it in GB use this command
Example Usage :
General System Information command
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
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
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
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
Code:
cd /usr/src_proftpd
Code:
tar xjf proftpd-1.3.2.tar.bz2
Code:
rm -f proftpd-1.3.2.tar.bz2
Code:
cd /usr/src_proftpd/proftpd-1.3.2
Code:
./configure --prefix=/usr --sysconfdir=/etc --localstatedir =/var/run
Code:
make
Code:
make install
You can use
Code:
vi /etc/proftpd.conf
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>
Code:
cd /usr/src_proftpd
Code:
rm -Rf proftpd-1.3.2
Code:
proftpd
Code:
useradd -d/home/yourusername -m yourusername
Code:
passwd yourusername
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
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
but it will be different for everyone depending on what you defined it as.
Log into ssh
Code:
cd /home/samp
Code:
wget http://files.sa-mp.com/samp02Xsvr.tar.gz
Code:
tar xvfz samp02Xsvr.tar.gz
Code:
cd /home/samp/samp02X/
Code:
nohup ./samp02X
Log into SSH
Code:
ps -ef
This was the one i had
Code:
root 13516 1 0 21:07 ? 00:00:00 ./samp02Xsvr
Code:
kill -9 13516
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'
Code:
[root@linx2 ~]# cat /proc/cpuinfo | grep -i 'Model' model : 23 model name : Intel® Core2 Quad CPU Q9400 @ 2.66GHz
Code:
free -m
Code:
free -g
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
Code:
top
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