Installing WordPress on Ubuntu 12.04 LTS

Posted on Saturday, December 22, 2012



These notes cover the installation and basic set up of a WordPress Server on an Ubuntu 12.04 Server.




Install/Setup MySQL


Install mysql on this server


      > sudo apt-get update
      >  sudo apt-get install mysql-server




For the root password set it to “mysqlpassword”









Log into mysql



      >  mysql -u root -p -h localhost























Set up WordPress MySQL user




      >  CREATE DATABASE wp_database;
      >  GRANT ALL PRIVILEGES ON wp_database.* TO "wp_db_admin"@"localhost" IDENTIFIED BY "wp_pass";
      >  FLUSH PRIVILEGES;
      >  EXIT









Install Apache 2/PHP


Install tools needed by WordPresss
(some notes for this were taken from https://help.ubuntu.com/community/Joomla )


      >  sudo apt-get install apache2
      >  sudo apt-get install php5-mysql
      > sudo apt-get install libapache2-mod-php5
      > sudo apt-get install imagemagick
      > sudo apt-get install php5-imagick   
      >  sudo a2enmod rewrite


This is all that needs to be installed for wordpress to work.  Well in fact its overkill.  Wordpress does not use imagemagick out of the box,   I was going to install this plugin http://wordpress.org/extend/plugins/imagemagick-engine/installation/ [1]


Reboot


      >  sudo reboot now







Test Apache


Make sure the apache server is working.  The local IP address of my box is 10.0.11.27 so open the following web page http://10.0.11.227/













Make a folder for the web sites


Make a www folder


      >  sudo mkdir /www


Make new directory


      >  sudo mkdir -p /www/var/www/example
      >  sudo mkdir –p /www/var/log








Set up virtual hosts edit  /etc/apache2/sites-available/default


      >  sudo vi /etc/apache2/sites-available/default



Change it to the following


<VirtualHost *:80>
    DocumentRoot /www/var/www/example
</VirtualHost>
<VirtualHost *:80>
    ServerName www.example.com
    DocumentRoot /www/var/www/example
    LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
    CustomLog /www/var/log/apache_log combined
    LogLevel warn
    ErrorLog /www/var/log/apache_error_log
</VirtualHost>






Create an html file


      >  sudo vi  /www/var/www/example/index.html


Here is what I made the simple web site


<html>
<body>
Example!
</body>
</html>



Restart apache


      >  sudo /etc/init.d/apache2 restart



Open up the site again, internally in my case http://10.0.11.227/
Which will go to the default web site.  If you have the DNS record updated you could use the web site name listed in the default file under

ServerName www.example.com













Here is the web site


Download Install WordPress



      >  cd /www/var/www/example/
      >  sudo wget wget http://wordpress.org/latest.tar.gz
      >  sudo tar -xvf latest.tar.gz
      > sudo rm index.html
      >  sudo mv wordpress/* .
      > sudo rm latest.tar.gz



Rename wp-config-sample.php


      >    sudo mv wp-config-sample.php wp-config.php



Edit the wp-config.php file



      >    sudo vi wp-config.php





Edit the Database configuration

Update this portion


define('DB_NAME', 'wp_database');

/** MySQL database username */
define('DB_USER', 'wp_db_admin');

/** MySQL database password */
define('DB_PASSWORD', 'wp_pass');







Configure WordPress


Open web page again http://10.0.11.227/


You should see something like this




























Enter a Site Tile,  An admin username, in this case I put admin.
Then enter in the password for this user.  I entered in mypassword




















Enter in the administrators email address and click Install WordPress




























Success!  Wordpress has been installed

Click on Log In




























Enter the admin’s user name and password and click Log In.






There you have it, this is the admin page.

The admin’s page is located at

The normal site is located at

(Be sure to adjust the IP address/DNS name for your system)



If I open up http://10.0.11.227/
I see

 

A default starter site.





SMTP mail


I am new to wordpress, but as a first look around I am not too impressed with the email set up vs joomla.

So I am going to install a SMTP email plugin to replace the default email behaviot

There is a WP Mail SMTP plug in at http://wordpress.org/extend/plugins/wp-mail-smtp/










From the WP admin page click on Plugins











Then click on Add New














Enter WP Mail SMTP  and click Search Plugins
















Select Install Now for “WP Mail SMTP”
















Success, click on Activate Plugin





























Click on Settings






Enter your Email address and your From Name.  Make sure “Send All Wordpress emails via SMTP” is selected.




Enter your SMTP information, including your username and password.
Click on Save changes.








If you use Gmail the Settings would be

SMTP Host:    smtp.gmail.com
SMTP Port:     465
                        Use SSL Encryption
                        Yes: Use SMTP authentication

Username:       your email address served by gmail
Password:        your email password
















To test the email enter an email address and click “Send Test”










And here is the test email I received.







This email tool now is located in the Settings



References
 [1]  WP SMTP Plug in 
       Visited 12/2012


No comments:

Post a Comment