0

What Kind of VPS Do I Need To Run WordPress?

This is a very common question and there are tons of information on the Internet about what the minimum requirements are and what to avoid so let me clear up some of the confusion.

This is part of an ongoing series of “WordPress Wednesdays” and in the month of October we will discuss on this website what kind of virtual private server do we need to run WordPress, a popular content management system that operates a significant amount of websites including blogs, websites just like this and even many news websites such as from CBS Local all run WordPress because of it’s flexibility.

OpenVZ or Xen?
A very good question indeed!

OpenVZ would be the bare minimum I would use for WordPress hosting while if you have a medium to large traffic website or require a lot of plugins, caching, etc. I would go with Xen VPS hosting for WordPress hosting which is generally only a few more dollars more in comparison to OpenVZ but the performance is worth those few extra dollars.

Hardware?
A VPS server’s CPU and hardware are often overlooked by individuals who are primarily focused on price!

WordPress is not CPU intensive, however MySQL which powers the WordPress content management system is, so if you go out and get a $3 VPS which has 128mb RAM, 10gb of disk space and only one CPU – do not be surprised if that medium or high traffic WordPress based website starts to crawl!

I’m sure you see guys on forums talking about they have WordPress running on a 32mb – 64mb VPS but please do not even consider shorting yourself on memory. If you want 32mb of memory dedicated to running your WordPress blog, why did you even leave shared web hosting?

A budget motivated website owner will get a custom VPS with more than enough RAM, disk space and bandwidth but only get one or two CPUs for a website that receives thousands of visits during peak hours!

Don’t short yourself on CPU!

To put things into perspective, how many single core processor desktops and laptops do you own?

If you own one, they’re slow as molasses when you’re trying to watch high definition video right? Same concept with a virtual private server – one CPU works for DNS servers, OpenVPN servers and web servers offering static files like images and HTML files but if MySQL is involved in your project and a dependency, 2 CPU cores are a minimum I would consider with 4 or more CPUs as what would be acceptable to me.

It does not matter if you have Intel Xeon or AMD based CPUs on your server. 8 CPUs at 1Ghz with an AMD based system is just as good as 2 CPUs running at 3Ghz on an Intel Xeon system.

The problem you had when you were on shared hosting running your WordPress site was your CPU and memory was limited. Most memory available to shared web hosting customers is anywhere from 8 – 32mb to run their PHP web applications. If you have multiple plugins, including a sitemap generator, this is where you would get all the weird errors, blank pages and what generally drove you away from shared hosting to virtual private server hosting.

Conclusion:
With our first lesson on “WordPress Wednesdays”, we have learned that OpenVZ and Xen does not really matter when it comes to running a WordPress site.

With OpenVZ, all the resources are shared with “your neighbors” on the same VPS node like shared web hosting and with Xen, your resources are guaranteed. Xen is only a few more dollars than OpenVZ but I think resource guarantees are worth the few extra dollars.

We also learned that CPU is something often overlooked by VPS hosting customers but should be emphasized more than anything. Would you drive a sports car if it only had a two cylinder engine inside of it that would be fast as a lawnmower or do you want the V8 engine, with 8 cylinders powering the sports car, which could be similar to an 8 CPU core system?

Thank you and tune in for next Wednesday’s article where we discuss if we should consider Apache or nginx with our WordPress website.

0

[HOW TO] Install OpenVPN on RHEL/CentOS VPS

OpenVPN is a free, open source software for setting up computer-to-computer virtual private networks (VPNs). Just follow these steps to install OpenVPN on a CentOS/RHEL VPS:

 

1. Install required dependencies:

# yum install gcc make rpm-build autoconf.noarch zlib-devel pam-devel openssl-devel

 

2. Download OpenVPN:

# wget http://openvpn.net/release/lzo-1.08-4.rf.src.rpm

# wget http://dag.wieers.com/rpm/packages/rpmforge-release/rpmforge-release-0.3.6-1.el5.rf.x86_64.rpm

 

3. Prepare dependencies:

# rpmbuild –rebuild lzo-1.08-4.rf.src.rpm

# rpm -Uvh /usr/src/redhat/RPMS/x86_64/lzo-*.rpm

# rpm -Uvh rpmforge-release-0.3.6-1.el5.rf.x86_64.rpm

 

4. Install OpenVPN:

# yum install openvpn

 

5. Copy the OpenVPN directory to a more convenient place:

# cp -r /usr/share/doc/openvpn-2.2.0/easy-rsa/ /etc/openvpn/

 

6. Build server keys. When prompted to enter information, you can simply press enter to skip:

#cd /etc/openvpn/easy-rsa/2.0

#chmod 755 *

#source ./vars

#./vars

#./clean-all

#./build-ca

#./build-key-server server

#./build-dh

 

7. Create an OpenVPN configuration file:

# cd /etc/openvpn

# vi server.conf

 

Copy the following sample config into the document with the correct IP address (your VPS’s main IP), and the port you want to run OpenVPN on, then press ESC, then :wq and enter to save and exit the document.

 

local 123.123.123.123 #- change it with your server ip address

port 1234 #- change the port you want

proto udp #- protocol can be tcp or udp

dev tun

tun-mtu 1500

tun-mtu-extra 32

mssfix 1450

ca /etc/openvpn/easy-rsa/2.0/keys/ca.crt

cert /etc/openvpn/easy-rsa/2.0/keys/server.crt

key /etc/openvpn/easy-rsa/2.0/keys/server.key

dh /etc/openvpn/easy-rsa/2.0/keys/dh1024.pem

plugin /usr/share/openvpn/plugin/lib/openvpn-auth-pam.so /etc/pam.d/login

client-cert-not-required

username-as-common-name

server 10.8.0.0 255.255.255.0

push “redirect-gateway def1″

push “dhcp-option DNS 208.67.222.222″

push “dhcp-option DNS 4.2.2.1″

keepalive 5 30

comp-lzo

persist-key

persist-tun

status server-tcp.log

verb 3

 

8. Start OpenVPN:

# openvpn /etc/openvpn/server.conf

Check that it outputs “Initialization Sequence Completed.” If it does, press ctrl-c to quit.

 

9. Setup required NAT rules:

# echo 1 > /proc/sys/net/ipv4/ip_forward

# iptables -t nat -A POSTROUTING -s 10.8.0.0/24 -j SNAT –to 0.0.0.0

(Modify “0.0.0.0″ to your server’s IP)

 

Create a user to log in to your VPN with:

#useradd username -s /bin/false

#passwd username

 

10. Create an OpenVPN configuration file on your PC with the name vpn1.ovpn. Copy the sample below into the document, modify it with your server’s IP and the port you set earlier, and place the file in your OpenVPN configurations folder:

client

dev tun

proto udp

remote 123.123.123.123 4567 #- your OPENVPN server ip and port

resolv-retry infinite

nobind

tun-mtu 1500

tun-mtu-extra 32

mssfix 1450

persist-key

persist-tun

ca ca.crt

auth-user-pass

comp-lzo

verb 3

 

11. Download ca.crt from /etc/openvpn/easy-rsa/2.0/keys and place it in the same OpenVPN configs folder.

12. Start the OpenVPN service on the VPS:

# openvpn /etc/openvpn/server.conf

 

Log in to the VPN using OpenVPN or another desktop client, with the username/password you created earlier.

 

This article is also available in the VPS6 Knowledgebase:

https://vps6.net/my/knowledgebase/32/How-to-Install-OpenVPN-on-CentOS-VPS.html