Skip to content

Ubuntu LAMP Server running WordPress

February 14, 2011

Installation instructions

Make sure your package repositories and installed programs are up to date by issuing the following commands.
To refresh the list of available packages:

#apt-get update
To upgrade installed packages to latest versions:
#apt-get upgrade --show-upgraded

To install LAMP:

#tasksel
Select LAMP Server.

During the install you will be asked to provide a root password for mysql.

Now check to see if php is working #nano /var/www/info.php

Add the following lines:

<?php
  phpinfo();
  ?>

Exit and save as /var/www/info.php

Restart apache2

#/etc/init.d/apache2 restart
Now open a browser and type
http://LAMP-Server-IP-Address/info.php

To fully manage your lamp Server database, install phpmyadmin.

#apt-get install phpmyadmin

Now open a browser and type:

http://LAMP-Server-IP-Addesss/phpmyadmin

Install WordPress

 #apt-get install wordpress
 #find / -name wordpress
 #ls /usr/share
 #mv /usr/share/wordpress /var/www

Setup MySQL

 mysql -u root –p

Enter your MySQL root user password from above, and you’ll find yourself at the MySQL> local client prompt. First, create a database for WordPress to use:

 CREATE DATABASE wordpress;

Once the database is created, you’ll need to create a database user for WordPress to use.

 CREATE USER admin;

Then create a password for your new user (note that your password will actually go within the quotation marks, and is case-sensitive):

 SET PASSWORD FOR admin = PASSWORD(“password”);

Now that you’ve got your WordPress database and your WordPress database user, you’ll need to grant the user all permissions on the database (again, the password goes within the quotation marks, and is case sensitive):

 GRANT ALL PRIVILEGES ON wordpress.* TO admin@localhost IDENTIFIED BY ‘password’;

(Make sure to append “@localhost” to wordpressuser; otherwise you’ll get a database error when you try to start WordPress for the first time.)

Configure WordPress to talk to the MySQL database. To do so, you must create a wp-config.php file in the WordPress directory. Fortunately, WordPress includes a handy wp-config-sample.php you can use as a template.

 nano /var/www/wordpress/wp-config-sample.php

Once there, change the following values (This assumes you used the default database names and passwords listed above):

Change database_name_here to wordpress.
Change user_here to admin.
Change password_here here to the password you selected in the GRANT ALL ON wordpress.* TO wordpressuser IDENTIFIED BY ‘password’; command.
Save your changed file to /var/www/wordpress/wp-config.php.

Everything should now be ready. Open up a web browser, and navigate to http://ipaddress/wordpress. If you configured everything correctly, you should then be greeted by the WordPress configuration page.

Please refer to further install help for WordPress.

Advertisements

From → Labs

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: