Serving The Planet

Vultr CentOS Virtual Private Server SSD: Multiple Domains Setup

Last few weeks of December 2014 been experimenting with Digital Ocean’s SSD VPS solutions … and loved it! However when digging deeper for my own Windows VPS (and DO only doing Linux based hosting) I found out about their competitor: Vultr.

CentOS @ Vultr vs. DigitalOcean ?

Vultr is pretty much the same as DigitalOcean, but because they came later than DO, they’ve got more competitive pricing: $5 per month of Vultr versus $10 per month at DigitalOcean; for the lowest entry level? Is a big difference.

And after a systems administrator told me about it CentOS 6.5 being a faster performing OS, I decided to get a Vultr VPS for personal projects. And okay it’s not quite the same, as the Vultr entry droplet only has 768MB instead of 1GB of RAM. But together with swapfile configuration it will suffice for my personal projects and maybe other projects too? More on that later.

Vultr CentOS multiple domains Setup

Creation of the droplet is as easy as with DigitalOcean. So not going into that indepth.

After you setup the droplet, you will get an email with IP and logins.
Access it through either console from the backend, or SSH (Putty in Windows).

note: there’s no prerequisite to change the root password (like there is with DO), although you like to do so anyway.

Basic setup / installation process

Time required? After figuring it all out myself (with a lot of external help)?
Within the hour you can be up and running.

1) LAMP installation

http://www.howtoforge.com/apache_php_mysql_on_centos_6.5_lamp

Testing webserver will go wrong on vultr, due to firewall restrictions. Perform:

iptables -I INPUT 1 -p tcp ---dport 80 -j ACCEPT
iptables -I INPUT 2 -p tcp --dport 22 -j ACCEPT
iptables -I INPUT 3 -p tcp --dport 443 -j ACCEPT
service iptables save
service iptables restart

When you don’t do at least the first line? You webserver will not work, and give server timeouts. Done?
You can now already migrate all your entire old site. Missing FTP? Use WinSCP. FTP is unsafe anyway.

2) Domain DNS changes

Create/change 2 A records to the IP of your VPS droplet: 1 for www and the other for without www (@ wildcard at TransIP for example).

Other (optional) steps

Not mandatory, but this what I did (based on tips of my super experienced system administration buddy).

Sync clock

to prevent php login errors.

http://www.cyberciti.biz/faq/howto-install-ntp-to-synchronize-server-clock/

Swap space

to prevent MySQL from running out of RAM, as also described here.

https://www.digitalocean.com/community/tutorials/how-to-add-swap-on-centos-6

(yes it’s the same for Vultr)

Webserver directory structure

All your seperate domains can be / should be (you decide for yourself) should be ran from:

/var/www/html/yourproject.com
/var/www/html/yourproject2.com

To do this properly in CentOS? After mkdir you have to do

chown apache:apache yourproject.com -R

which is similar to Ubuntu, but there you assign to www-data:www-data. Also don’t forget to do this if you upload files  after with WinSCP, as they will have root ownership.

You might also like:   Vimeo Plus Support: Groups vs Channel vs Albums

Vhosts File

For configuration purposes it’s best to keep the /etc/httpd/conf/httpd.conf is generic and clean as possible.

Uncomment ServerName and fill in domain.
Uncomment NameVirtualHost *:80

change the line that says “AllowOverride None” into “AllowOverride All”. This enables access to individual .htaccess files aka modrewrite, a prerequite for permalink support in for example WordPress. Bare in mind that this same statement in <directory /> has to remain “none”. And change AllowOverride in <Directory “/var/www/html”> from None to All.

Also change  your email address at:

ServerAdmin root@localhost

That concludes basic vhosts configuration. Then for every domain based on webserver directory structure create a file in /etc/httpd/conf.d/blabla.conf … contents:

<VirtualHost *:80>
  ServerAdmin your@email.com
  DocumentRoot /var/www/html/blabla.com
  ServerName www.blablabla.com
  ServerAlias blabla.com
  ErrorLog logs/blabla.com-error_log
  CustomLog logs/blabla.com-access_log common
  <Directory "/var/www/html/blabla.com">
    Options Indexes FollowSymLinks
    AllowOverride All
    Order allow,deny
    Allow from all
  </Directory>
</VirtualHost>

Made changes? Of course don’t forget to execute from command line:

service httpd restart

php.ini

Because the export of my old blog was >8MB. It would cause timeout problems in phpmyadmin. To temporarily fix those issues. Change these lines into (spread out over the entire /etc/php.ini file):

session.cache_expire = 180
max_execution_time = 180
upload_max_filesize = 32M

and don’t forget to change them back afterwards (for security purposes)

SSL certificate

Not used for rhyker2u.com migration (this blog you’re at the moment and used all these steps for), but useful for future reference:

https://www.digitalocean.com/community/tutorials/how-to-set-up-apache-with-a-free-signed-ssl-certificate-on-a-vps

Conclusion CentOS @ Vultr

Because of manual configuration of iptables at Vultr? And slightly better specs at DigitalOcean? I kinda lean towards DigitalOcean for all my bigger future projects. Also because DigitalOcean features preinstalled WordPress droplets, whereas at Vultr your really have to do it all yourself; even with Ubuntu. But if price matters to you? Vultr is definitely the way forward.

If none of this makes any sense to you? You’re better of with sticking to for example Hostgator or any hoster with a control panel like cpanel/directadmin/plesk.

About Earnie Rhyker

tech pioneer | intellectual BadAss | ethical lifehacker | WordPress Developer & Polyglot | information activist | blogger | added value services provider | multimedia enthusiast | senior linux server administrator | geek | bitcoin investor | laptop entrepreneur | open source contributor | hackintosh fanatic | charity donator | accredited top MLM networker & internet marketer 2014-2016 @ BFH | digital expat

View All Posts

Communities I have been 'hanging out' regularly over the past two decades. 

Note: links go to my profile on those respective sites. Connect with me if you like.

 

Earn With Earnie

This site hasn't been updated since 2022. Visit my new blog -- EarnWithEarnie.com -- instead:

X
error: Content is DCMA protected !!