A lot of people have asked us how easy or fast it’s to have a basic blog, like WordPress, running on City Network. The answer was simple enough, go ahead and register on our Order page and then do a 1-click install on our control panel.
But then, some people asked us how fast would that be from scratch, using a City Cloud dedicated virtual server. My answer was quick and painless, “well, minutes of course!” but then I started thinking, how many minutes exactly?
So we took a chronometer and got our hands dirty. Here are the results.
If you are going through the dedicated servers route, even virtual ones, you probably know how to do this already. If not, we recommend using the shared hosting plan which is more direct and pretty much solves a lot of the hassle for you.
But if you need absolute control, these are the minimum requisites:
- Basic understanding of Linux: installation and operation (generally through a remote connection). Understanding of apt package management system.
- A basic understanding of WordPress and blogs in general.
- Basic knowledge of Cloud Computing and City Cloud, although our admin panel makes it really easy to operate dedicated servers, and even so, we also have guides!
Equipped with that knowledge, we are ready to begin.
If you already have an account with us, you can skip this step (you just saved 10 minutes of your time). If not, well, it’s really easy.
Just go to City Cloud home page and click on Create Account.
Afterwards, check your email and follow the link there. Next step is simply verifying your identity, which involves calling us or using your credit card. Don’t worry, we don’t apply any charges to it.
By now you should have the corresponding credentials to enter the City Cloud admin panel.
Go ahead and create a basic server. Let’s just use a Small template with defaults parameters since we don’t need any more than that for the basic installation.
This could take a couple of minutes, while the system provisions your server. Once it’s ready, it will appear on the “Running VMs” section.
Click on details of the running VM (the “i” icon) and copy the IP address and default credentials located on the Notes box. Using your favorite SSH client (we use putty) just enter the server and, only for the first time, the operating system will ask you for a password. Pick a secure one, with upper case letters and numbers mixed in.
We have decided to use Debian GNU/Linux (at the time of writing, “Squeeze” version), so our instructions are focused on that. The process is slightly different if you choose another distribution, but conceptually the steps are the same.
Once inside we are ready to install the web server, in this case we chose Apache 2 but you can use the one you prefer (although additional configuration might be required for WordPress).
Before we continue, let’s switch to root and make sure you have a debian mirror setup on your sources.list file. On our case, we use a Swedish mirror since the datacenter is located in Sweden and it helps downloading the packages real fast.
# Switch to root su - # Add Swedish debian mirror echo "deb http://ftp.debian.org/debian/ squeeze main contrib" >> /etc/apt/sources.list
Then, we make sure we have the latest apt package list. We also install some handy utilities.
apt-get update apt-get install vim
Great, now let’s install the web server. We are going to use Apache 2 (prefork module) and PHP 5.
apt-get install apache2-mpm-prefork php5 ...
We have now the web server installed with the default configuration. This also installs PHP as an Apache module. Now, let’s go for the database server: we are using MySQL on this occasion since it’s a widely proven one and because WordPress uses it, of course.
apt-get install mysql-server ...
This should install the latest stable version of MySQL (at the moment, 5.1). Once the installation finishes, the system will ask us for a MySQL root user password. Enter a secure one, repeat and proceed. With the database server installed, let’s create a database for our blog and assign a user to it, with the following:
mysql -u root -p mysql> CREATE DATABASE wordpress; mysql> GRANT ALL PRIVILEGES ON wordpress.* TO wordpress_user IDENTIFIED BY "put_your_password_here"; mysql> FLUSH PRIVILEGES; ...
Now, we must install the WordPress blog.
apt-get install wordpress ...
This step also takes care of installing some dependencies such as php5-mysql, php5-gd and others. Now, let’s continue with the configuration. We already have the web server, database server and blog installed. We need to create a virtual host for our blog.
Which should have the following text (you can use vim or nano text editors).
<VirtualHost your_ip_address:80> ServerName www.yourdomain.com ServerAdmin email@example.com DocumentRoot /var/www/blog DirectoryIndex index.php <Directory /var/www/blog/> AllowOverride All Order Deny,Allow Allow from all </Directory> </VirtualHost>
Once saved, we need to create a symbolic link for the WordPress files (they are located on /usr/share/wordpress on debian). And then enable our new virtual site on Apache. Usually your ip address could be replaced by an asterisk (*), please refer to the Apache 2 documentation on named hosts for further information.
ln -s /usr/share/wordpress /var/www/blog a2ensite blog apachectl restart
We are almost there, on Debian the default WordPress config file is stored on /etc/wordpress, so one convenient way to setting it up is to copy the default file to a new one using our domain name. And then, we open the new config file with a text editor.
cp /etc/wordpress/wp-config.php /etc/wordpress/config-YOUR_DOMAIN.COM.php vim /etc/wordpress/config-YOUR_DOMAIN.COM.php
Inside, we must setup the following variables with the corresponding information (according to the database name you just created, user and pass).
- define(‘DB_NAME’, ‘wordpress’);
- define(‘DB_USER’, ‘wordpress_user’);
- define(‘DB_PASSWORD’, ‘put_your_password_here’);
- define(‘DB_HOST’, ‘localhost’);
cp /etc/wordpress/wp-config.php /etc/wordpress/config-YOUR_DOMAIN.COM.php
At this point, we should be ready to point our browser to the domain or IP address in question. If everything went well, we should see the WordPress Installation page. There are just a few fields to complete, such as the administrator password and email. Once we have filled the form, we are presented with the opportunity to enter the admin page.
Ready to go!
To verify everything, just point your browser to the IP address or domain of the blog. It should give you the default WordPress page. Congratulations!, you have your very own running server with WordPress installed.
Later, what you usually do is start fiddling with the servers parameters and WordPress configuration. You can also turn off the virtual server, increase the capacity and turn it back on in a minute. This was just a small demonstration of how simple the process is. And it’s generally the same process for various software solutions, not just blogs.
With all the available options and flexibility, the choice from here on, is up to you.