1. Install LAMP server on ubuntu server.
sudo apt-get install wordpress
2. Make a symbolic link to the Apache2 directory /var/www/ , The wordpress installation placed in directory /usr/share/wordpress folder
sudo ln -s /usr/share/wordpress /var/www/wordpress
3. install WordPress with the default script, script location: /usr/share/doc/wordpress/examples/.
sudo bash /usr/share/doc/wordpress/examples/setup-mysql -n wordpress localhost
After execute this script, it will creates the MySQL database and user wordpress for the new MySQL database named localhost. If you have installed virtual host on server and/or already know your URL, it is best to name your database the same as your URL. Also if you plan on hosting multiple blogs with different virtual hosts, each needs a differently named database.
sudo bash /usr/share/doc/wordpress/examples/setup-mysql -n wordpress_name blog.domain.com
4. For automatic updates to occur, the folder and all its files and subfolders wordpress must be owned by www-data:
chown -R www-data /usr/share/wordpress
Now, open your web browser to install wordpress, type on address bar http://localhost/wordpress