3

I want to create a site based on Wordpress that is only accessible from my own machine (localhost). In other words, I do not want my computer to be a server. I just want it to have all the files necessary for a website in /var/www/, so that I can later copy-paste those files an another machine which will be a server.

Therefore I installed the wordpress package and I am about to install a graphical interface to manage the files. What should I do? Do I need somthing called LAMP?

I have seen this question on WordPress Answers, but I wonder if someone could provide instructions that are more Ubuntu specific or easier to follow, especially if they are relevant to the Unity interface.

5 Answers 5

8

You can use sudo tasksel to install a local LAMP server.

After selecting LAMP you can install it (you may need to scroll down the list to find the 'OK' button) and while installing, tasksel will ask you for the password for the MySQL installation (which is very important not to forget!).

Then you can open your browser and type http://localhost and you should see It works.

3
  • +1 for using tasksel -- ubuntu / debian specific systems implement this type of "automagic" setup.
    – lazyPower
    Jan 29, 2012 at 23:22
  • "Automagic" meaning that I should not do any configuration after the installation?
    – Agmenor
    Jan 30, 2012 at 0:17
  • So, in Tasksel I have the "LAMP server" option checked. What should I do next?
    – Agmenor
    Jan 30, 2012 at 2:03
2

2016 solution

A very good guide can be found from mentioned urls at the bottom. Here is a breakdown for you,

install mysql

sudo apt-get install mysql-server php5-mysql

Install Apache

sudo apt-get install apache2 libapache2-mod-php5

after installing mysql and apache you should get localhost up and running. Try to check/verify from browser by typing localhost as a URL. Now, lets get started with WordPress installation.

Installing WordPress

cd /var/www/html
sudo wget http://wordpress.org/latest.tar.gz
sudo tar zxvf latest.tar.gz –strip-components=1

(use sudo) if required.

Then using the sudo command set the permissions so you will be able to modify the files and allow the web server to access them as well like this:

sudo chown -R www-data *
sudo chgrp -R www-data *

After all of this, It's time to create database in mysql, i will show a short way to do it ;)

mysql -u root -p
mysql> CREATE DATABASE wordpress;
mysql> GRANT ALL PRIVILEGES ON wordpress.* TO “wordpress”@”localhost” IDENTIFIED BY “foopassword”;
mysql> FLUSH PRIVILEGES;
mysql> EXIT

Don't forget to do necessary changes such as username and database name change according to your desire. After doing mysql thing, Rename the wp-config-sample.php file to wp-config.php from your wordpress folder and using your favorite text editor you will need to add the name of your database, mysql username and password to the config file.

If you had follow the instructions correctly, then its your lucky day :) you can now simply browser your wp site by navigating to localhost/yourfoldername

Reference Urls:
https://www.digitalocean.com/community/tutorials/how-to-install-wordpress-on-ubuntu-14-04
http://linoxide.com/ubuntu-how-to/ubuntu-apache-php-mysql-wordpress/

1
  • Readers should note that though it says 2016 solution, this won't work for 16.04 (and one of the sources indicates its for 14.04)
    – muru
    Jun 20, 2016 at 11:04
1

First install XAMPP, then unzip wordpress.zip and change permissions. It should be made writable. Do not edit config-sample.php file.

Create a database using PHPMyAdmin, then move the unzipped folder to xampp directory. Start XAMPP, open up your web browser and type localhost/xampp/wordpress/wp-admin/install.php.

Follow the instructions. Leave the password field empty and database prefix empty.

0

Maybe you would like to try Xampp

It turns your computer into a "private server" you can use, with MySQL and Apache technologies. All the instructions are on the website. I hope this is what you are looking for!

0

Setting up Wordpress website on localhost using XAMPP is the best solution you have. It gives you an option to explore themes and plugins as well.

Step 1 – Install XAMPP XAMPP control panel

Once you have launched XAMPP you have control panel from which you can start programs. If you have any port errors fix those errors first. For fixing port errors and start XAMPP to install WordPress on Locahost XAMPP. Then you should go to phpmyadmin to create a database.

For installation of WordPress you must follow a guide that will definitely gives you a step by step guidance.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.