Creating a new web server is piece of cake at Rackspace Cloud. Here is a demo video of how to set up a new instance with your favorite Linux distribution. I have used Fedora 12 for my new spaniards.es servers, and here is the script I’ve used to install everything needed so far:
-
# Install HTTPD
-
yum -y install httpd rsync
-
-
# Install PHP
-
yum -y install php php-mbstring php-mysql mysql
-
-
#############################################################
-
# FIREWALL
-
# Open http port 80 (and ssh)
-
iptables -F
-
iptables -A INPUT -p tcp –dport 22 -j ACCEPT
-
iptables -P INPUT DROP
-
iptables -P FORWARD DROP
-
iptables -P OUTPUT ACCEPT
-
iptables -A INPUT -i lo -j ACCEPT
-
iptables -A INPUT -m state –state ESTABLISHED,RELATED -j ACCEPT
-
iptables -A INPUT -p tcp –dport 80 -j ACCEPT
-
iptables -L -v
-
service iptables save
-
-
# Start HTTPD server
-
/etc/init.d/httpd start
-
-
# Install memcached
-
yum -y install memcached
-
memcached -d -u apache
-
yum -y install php-pecl-memcache
-
-
# Restart HTTPD server
-
/etc/init.d/httpd restart
DNS configuration can be done through the admin pages, so there is no need for manual configuration. Copying the data from your old server can be done with rsync and having mysql installed is handy to test db connections from the console.
In less than 10 minutes you can have a new web server up and running :)
Last night I got an account at Rackspace Cloud and created three brand new CentOS Linux servers. Now I have to set them up: two web servers and one database server. My goal: Move Spaniards.es website to this new hosting.
Why move?
Currently I am hosting Spaniards.es on two dedicated servers at Ace-Host.net. So far, so good, but the site has started to get slow (more the web server than the db server, which is running great so far). Some days I found the site running at 30 times the processor capacity (according to ‘top’), which is a lot. The biggest problem I have right now is the caching on the web server. I have installed both XCache and Memcached, but can get them to work since that server was my first ever dedicated server an has a CPanel installation that drives me nuts.
Sooner or later I had to move that webserver into a new clean installation, but I have decided that if I have to move, I’ll do it to a cloud. No more dependencies on a physical hardware, no more worries.
Why not EC2
Well, I’ve ried EC2 and it is not that I don’t like it. It is just that it is so much work. After seeing how CloudServers work on RackSpace, I have no doubt.
When is Spaniards.es going to be moved?
There is no date yet. First I have to set up the servers, make sure everything works fine, set up the domains, dns, mail, etc. Hopefully in a couple of weeks, if I can find enough time to do so.
You shouldn’t notice it, but I have moved all my research demos from dev.enekoalonso.com/research to enekoalonso.com/research. It is just a little change, but will help keeping things more organized, I think.
To avoid breaking old links, I have added a 301 redirect:
-
Options +FollowSymLinks
-
RewriteEngine on
-
-
# For http://dev.enekoalonso.com/research
-
RewriteCond %{REQUEST_URI} ^/research$
-
RewriteRule .* http://enekoalonso.com/research [R=301,L]
-
-
# For http://dev.enekoalonso.com/research/*
-
RewriteRule (.*) http://enekoalonso.com/research/$1 [R=301,L]
Let me know if you find any issues.
I had done this already at work, but for some reason my MacBook Pro still didn’t “understand” PHP. Well, I’ve decided it’s time to activate it:
-
# Use your favorite editor
-
mate /etc/apache2/httpd.conf
-
# Uncomment the line:
-
#LoadModule php5_module libexec/apache2/libphp5.so
-
# Restart apache
-
sudo apachectl restart
Done.