Reason: I had recently changed VPS services but the new provider did not offer free data backup. I was a bit bummed but the price was very cheap so I had to figure out another way. WHM has an option in the backend to FTP backup data to a different server. I searched around for free FTP service but they only offered up to 2gb. If I needed more (at least 30gb in my case), I had to pay for it and I didn’t want to take on another monthly payment so I decided to create my own simple FTP server for cpanel backups. I had 20mb connection from Comcast and since it will be running late night, I won’t notice any performance drop from my ISP.
Here is what you need:
- Download Centos 6.3 or the latest version http://centos.org/
- Server (or computer)
- Go to http://centos.org/
- Download the iso file that will work with your server architecture. (32 or 64 bit) I use 64 bit in my case.
- Burn Centos onto a DVD. In my case, I installed it as a virtual machine in ESXi VMware so I just uploaded the ISO to my server.
- Configure your server for raid if needed. I bought a Dell 1950ii Power Edged server for about $150. It came with 4x146gb hard drives. I needed raid for data redundancy so I had it configured in RAID 5 mode. It’s highly advised to do so in case a hard drive fails.
- Install Centos and use the GUI process. Follow the instructions. NOTE: When you get to the Network configuration screen, you need to setup a static IP. I used this in my setup:
- IP = 192.168.1.100
Don’t forget to enable the network card to load on startup; otherwise the server will not have a connection on restarts.
- Once the server is installed, log into the server from the prompt. Username is root. Password is the password you created during setup.
- Now vsftpd needs to be installed. Run this command below and follow through:
#yum install vsftpd
- Now we need to configure Vsftpd. Run the command to open up the vsftpd.conf file in editor mode:
- Hit “i” so you can insert into the document. Then make sure Anonymous is NO
- To save and exit, click “ESC” to escape. Then type “:x”, his enter. This exits the doc and saves it.
- Now we need to turn on vsftpd during boot. We need to invoke these commands:
#chkconfig vsftpd on
#service vsftpd start
- Next we configure the IPtables.
- Add the following to the doc right before the one that looks just like it. You’ll see it when you open the doc. There’s one there with “-dport 22”. Add it above that one, then save and exit.
-A INPUT –m state –state NEW –m tcp –p tcp –dport 21 –j ACCEPT
- Now we edit the iptables-config file like so:
And make sure that IPTABLES_MODULES=”Ip_conntrack_ftp”
- Save and close the file.
- Restart Firewall by invoking this command
#service iptables restart
- Create a user with this command:
#Useradd yourusername –d /home/yourusername
Then add the user password:
- Disable SElinux by editing the file below and making sure SELINUS=Disabled
- Save and exit the file
- Restart server
FTP to the Server remotely
- Connect to your router by entering the IP of the router into the browser. In my case it’s 192.168.1.1
- Enter in the router username/password. If you have not changed it, look at the router manual for the user credentials.
- Find port forwarding in your router’s configuration. You’ll need to map port 21, 22 to the server’s IP that you’ve configured above. Save and exit. You’re done with router.
- 4. Open up a browser and go to google.com. Type “whats my IP” in the search field and hit enter. It’ll will tell you “Your public IP address is xxx.xxx.xxx.xxx” (the x are your IP address”)
- Now that you have your external WAN IP address, you can remote in from another computer out of your network…. Like from school or anywhere around the world. In filezilla, just used the IP address that came up. The only down fall is that if you’re on a residential broadband, your WAN IP will change periodically.
Come back for more on linking WHM backup to this FTP server.
Get the latest from my blog when you sign up. Special offers are only offered to those who sign up. Specific DIY are emailed to users when they become available. Sign up today to get notified.