This is a Step by Step Guide For the New Users With All the Commands To Install WordPress on Ubuntu 13.10 on Rackspace Cloud Server. We have written the guide in a manner so that, any new user can follow and deploy or Transfer WordPress within 3-4 hours. For the expert users, it will take 30-45 minutes. But wait, we will tell you the recipe how you can also deploy another instance within 15 minutes using the building server instance from image feature. Commands, normally are basically the same be it on Rackspace or any web host. But, this guide How To Install WordPress on Ubuntu 13.10 on Rackspace Cloud Server has points which are specific for Rackspace only.
Rackspace uses own mirror repository, the default images itself are a bit hardened compared to out of box downloaded version from official repository. We do not recommend to follow this guide for non Rackspace users as you will possibly need to harden the points manually. The sayings are from our experiences, it is not any official declaration or rather Rackspace has not told these points. We always will suggest to read the updated how to’s on Rackspace’s official guide pages as well.
How To Install WordPress on Ubuntu 13.10 on Rackspace Cloud Server : Softwares We Have Used
As we have used OS X 10.9, we preferred to use iTerm2 to SSH to the Server. You can use Terminal App both for OS X and GNU Linux. You have to use PuTTY for Microsoft Windows. FileZilla can be used as SFTP software. All softwares are Open Source and Free Software. On the Server, we have installed :
---
- Apache2
- PHP
- MySQL server and client
- PHPMyAdmin
- Webmin
This is preliminary setup and you will require to install some dependencies like PHP-CURL to use all the features of some WordPress Plugins like W3 Total Cache. Our older guide to Install WordPress on Rackspace Cloud Server has some links which might help you.
How To Install WordPress on Ubuntu 13.10 on Rackspace Cloud Server : Steps
You can check any of my newer video guides related to Rackspace Cloud Server to check how to spin up a Server from control panel, copy the IP address and SSH to the Server. We do not want to start from that point. We have used one server with 1 GB RAM, Performance Flavor. First SSH to server (the used 123.78.567.89 is an arbitrary IP, you must replace with your own) :
Rules : Tilde (~) represents a command, you must not copy that part and paste to your command line tool. Hash ( # ) represents our instruction.
1 | ~ ssh root@23.253.218.181 |
In return, it will ask for Password. Copy paste the password and hit Enter key. For a safer setup, you need to generate SSH Keys on your computer and paste on Rackspace Cloud Panel before you spin a server. We are taking this guide for developmental purpose – we have skipped the step. Output :
1 2 3 4 5 | # example The authenticity of host '23.253.218.181 (23.253.218.181)' can't be established. ECDSA key fingerprint is 89:35:46:1b:cb:77:14:8f:86:54:36:38:bt:3c:fa:c0. Are you sure you want to continue connecting (yes/no)? # press y and hit Enter key |
We usually change the password :
1 2 3 | ~ passwd # it will ask to enter a new UNIX password and repeat it # no password will be visible as masked characters - nothing will appear |
Next step is to update and upgrade :
1 2 | ~ sudo apt-get update && sudo apt-get update # && joins two commands |
Install LAMP server with one command :
1 2 | ~ sudo apt-get install lamp-server^ # MySQL will ask for password, fill them |
Restart Apache server :
1 2 | ~ sudo service apache2 restart # It is normal restart |
Point towards your IP address from browser like :
1 | http://23.253.218.181 |
The page should display the words œIt works!” This is a default index.html webpage generated by Apache. We must delete it before installing WordPress :
1 | ~ rm /var/www/index.html |
Point towards your IP address from browser, it will not show any such œIt works!” page, instead return error. At this point, you can login to SFTP using FileZilla using the same credentials, port is ( 22 ) and see the empty folder at :
1 | /var/www/ |
For single server – single domain setup, this is the default public folder. We are describing a typical single server – single domain setup. We usually arrange multiple websites in this fashion with virtual host :
1 2 3 4 5 6 | # website 1 /var/www/www.thecustomizewindows.com # subdomain 1 /var/www/demo.thecustomizewindows.com # website 2 /var/www/www.thecustomizewindows.net |
Add an user as root is too common to guess :
1 | ~ adduser username |
By default, only root
has all of the administrative privileges. We are going to give the username
the root privileges :
1 2 3 4 5 6 | ~ visudo # output is a config file, ^ means you need to hold control key plus that specified key, example # ^W means it writes the file # edit here # User privilege specification root ALL=(ALL:ALL) ALL |
Add your username
with ALL=(ALL:ALL) ALL
privileges. When you will perform any root tasks with username
account, you will need to use sudo
before the command. All the commands run with sudo is saved to the file /var/log/secure
.
To ssh with new user account, you need to run :
1 | ~ ssh -p 22 username@23.253.218.181 |
Obviously, the root user’s privileges should be changed, otherwise adding username
has no value. To do it, you need to edit /etc/ssh/sshd_config
file in this way :
1 2 3 4 5 6 7 | Port 22 # our direction => change the port number Protocol 2 # our direction => change to no PermitRootLogin yes # add at bottom AllowUsers username |
Reload SSH :
1 | ~ reload ssh |
This is actually the right setup. However, new users can mess-up and get locked in. If you fear of getting messed up, omit steps described from Add an user unto the above command. We need to install a firewall. We use uncomplicated firewall (ufw), but probably it is better to learn to use later (you can end up badly).
You can check the PHP5 modules by this command :
1 | ~ apt-cache search php5- |
If we want to install php5-curl
(needed to connect with OpenStack functions, also required by W3 Total Cache to use Rackspace Cloud Files) :
1 | ~ sudo apt-get install php5-curl |
If I want to install PHP5 GD too, I will run :
1 | ~ sudo apt-get install php5-curl php5-gd |
One space will required to be added to add as many modules you want to install. Now, we will install PHPMyAdmin :
1 2 3 | ~ sudo apt-get install phpmyadmin # Select Apache2 as server # Select YES when asked about whether to Configure the database for phpmyadmin with dbconfig-common |
After the installation has completed, we will add phpmyadmin to the apache configuration :
1 2 3 4 5 | ~ sudo nano /etc/apache2/apache2.conf # add this line and save Include /etc/phpmyadmin/apache.conf # reload apache ~ sudo service apache2 restart |
Point towards :
1 | http://23.253.218.181/phpmyadmin/ |
You will get the login to PHPMyAdmin. But this is quite risky to fully keep opened. So, either you will use some method to make it inaccessible from browser and turn it to ON, on your need or create .htaccess and htpasswd file. This is for practical usage.
Now the webmin installation part. Read the recently published guide on How To Install Webmin System Administration Panel on Rackspace Cloud to complete your setup.
At this point; you should point your domain towards the IP using Cloud DNS. If you keep TTL to 300 seconds / 5 minutes, it practically propagates instantly. Do not install WordPress until the propagation is complete unless it is a test setup. The reason is ==> new users mess-up with IP address and domain name in WordPress instance. So, your IP 23.253.218.181
is now example.com
.
First, you need to install php5-gd, that is not included in our easy LAMP server setup :
1 | ~ sudo apt-get install php5-gd |
Now cd to your Public folder :
1 2 3 4 5 6 7 8 9 | ~ cd /var/www ~ wget http://wordpress.org/latest.tar.gz # un-tar it ~ tar -xzvf latest.tar.gz # cd to wordpress folder ~ cd wordpress # move all the files to root ~ mv * .. # dot dot ==> one level up in Linux. In OSX / any UNIX it is one dot |
If you feel uncomfortable, use FileZilla to move all the folders to root (means /var/www location). At this point, we need to change ownership, group, permission :
1 2 3 | ~ sudo chown root:www-data /var/www -R ~ sudo chmod g+w /var/www -R ~ sudo chgrp -R www-data /var/www |
www-data is Apache. Always :
1 | ~ cd /var/www |
then run the commands. I have seen a person to run sudo chown root:www-data
in front of me while at root and end pathetically! You will get such errors that sudo command will not work. Be careful.
Now, you need to create a database first. You can use command line or use PHPMyAdmin. PHPMyAdmin has docs to create database! Otherwise, create from command line :
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | ~ mysql -u root -p # MySQL Welcome message will appear. Do not copt " > " > CREATE DATABASE wordpress; Query OK, 1 row affected (0.00 sec) > CREATE USER wordpressuser@localhost; Query OK, 0 rows affected (0.00 sec) > SET PASSWORD FOR wordpressuser@localhost= PASSWORD("password"); Query OK, 0 rows affected (0.00 sec) > GRANT ALL PRIVILEGES ON wordpress.* TO wordpressuser@localhost IDENTIFIED BY 'password'; Query OK, 0 rows affected (0.00 sec) > FLUSH PRIVILEGES; Query OK, 0 rows affected (0.00 sec) > exit Bye ~ # wordpress and password must be changed |
Now, go to your :
1 | http://example.com |
Automatically WordPress will generate the config file and ask the database details. Editing wp-config is not needed plus it also ensures that our File permissions are writable by WordPress. In case you face any error, search our website, you will get the solution.
This is the complete setup of WordPress. There are smaller things like, gracefully restarting Apache, Apache will give error while restarting – you will have to add ServerName example.com
in Apache config file. You will need to change AllowOverride All, change php.ini settings etc.
Now, taking image, up to certain steps you will do correctly. Create an image at that point from control panel. If you mess-up, simply delete the messed up server and spin a new server from the image. It is exactly like Time Machine, but manual. The UNIX Admins usually keep an image with perfect setup. That is why we said at the beginning – you can also deploy another instance within 15 minutes using the building server instance from image feature. When you are taking an image up to WordPress Installation – it is becoming a kind of automated script. For one server one domain, you need not to edit the virtual host or run difficult commands. It is actually challenging when multiple virtual hosts are used with different server technologies.
Tagged With install wordpress on rackspace