Tutorial

How To Install WordPress on Ubuntu 14.04

Published on April 24, 2014
How To Install WordPress on Ubuntu 14.04
Not using Ubuntu 14.04?Choose a different version or distribution.
Ubuntu 14.04

Introduction

At this time, WordPress is the most popular CMS (content management system) on the internet. It allows you to easily set up flexible blogs and websites on top of a MySQL backend with PHP processing. WordPress has seen incredible adoption and is a great choice for getting a website up and running quickly.

In this guide, we’ll focus on getting a WordPress instance set up with an Apache web server on Ubuntu 14.04.

Prerequisites

Before you begin this guide, there are some important steps that you need to complete on your server.

We will be proceeding through these steps as a non-root user with sudo privileges, so you will need to have one available. You can find out how to create a user with sudo privileges by following steps 1-4 in our Ubuntu 14.04 initial server setup guide.

Additionally, you’ll need to have a LAMP (Linux, Apache, MySQL, and PHP) stack installed on your VPS instance. If you don’t have these components already installed and configured, you can use this guide to learn how to install LAMP on Ubuntu 14.04.

When you are finished with these steps, you can continue with this guide.

Step One — Create a MySQL Database and User for WordPress

The first step that we will take is a preparatory one. WordPress uses a relational database to manage and store site and user information.

We have MySQL installed, which can provide this functionality, but we need to make a database and a user for WordPress to work with.

To get started, log into the MySQL root (administrative) account by issuing this command:

mysql -u root -p

You will be prompted for the password you set for the MySQL root account when you installed the software. You will then be given a MySQL command prompt.

First, we can create a separate database that WordPress can control. You can call this whatever you would like, but I will be calling it wordpress because it is descriptive and simple. Enter this command to create the database:

<pre> CREATE DATABASE <span class=“highlight”>wordpress</span>; </pre>

Every MySQL statement must end in a semi-colon (;), so check to make sure this is present if you are running into any issues.

Next, we are going to create a separate MySQL user account that we will use exclusively to operate on our new database. Creating one-function databases and accounts is a good idea from a management and security standpoint.

I am going to call the new account that I’m making wordpressuser and will assign it a password of password. You should definitely change the password for your installation and can name the user whatever you’d like. This is the command you need to create the user:

<pre> CREATE USER <span class=“highlight”>wordpressuser</span>@localhost IDENTIFIED BY ‘<span class=“highlight”>password</span>’; </pre>

At this point, you have a database and a user account, each made specifically for WordPress. However, these two components have no relationship yet. The user has no access to the database.

Let’s fix that by granting our user account access to our database with this command:

<pre> GRANT ALL PRIVILEGES ON <span class=“highlight”>wordpress</span>.* TO <span class=“highlight”>wordpressuser</span>@localhost; </pre>

Now the user has access to the database. We need to flush the privileges so that the current instance of MySQL knows about the recent privilege changes we’ve made:

FLUSH PRIVILEGES;

We’re all set now. We can exit out of the MySQL prompt by typing:

exit

You should now be back to your regular command prompt.

Step Two — Download WordPress

Next, we will download the actual WordPress files from the project’s website.

Luckily, the WordPress team always links the most recent stable version of their software to the same URL, so we can get the most up-to-date version of WordPress by typing this:

cd ~
wget http://wordpress.org/latest.tar.gz

This will download a compressed file that contains the archived directory contents of the WordPress files to our home directory.

We can extract the files to rebuild the WordPress directory we need by typing:

tar xzvf latest.tar.gz

This will create a directory called wordpress in your home directory.

While we are downloading things, we should also get a few more packages that we need. We can get these directly from Ubuntu’s default repositories after we update our local package index:

sudo apt-get update
sudo apt-get install php5-gd libssh2-php

This will allow you to work with images and will also allow you to install plugins and update portions of your site using your SSH login credentials.

Step Three — Configure WordPress

Most of the configuration that we will be doing will be through a web interface later on. However, we do need to do some work from the command line before we can get this up and running.

Begin by moving into the WordPress directory that you just unpacked:

cd ~/wordpress

A sample configuration file that mostly matches the configuration we need is included by default. However, we need to copy it to the default configuration file location to get WordPress to recognize the file. Do that now by typing:

cp wp-config-sample.php wp-config.php

Now that we have a configuration file to work with, we can generate some secret keys that help to secure the installation. WordPress provides a secure generator for these values so that you do not have to try to come up with good values on your own. These are only used internally, so it won’t hurt usability to have complex, secure values here.

To grab secure values from the WordPress secret key generator, type:

curl -s https://api.wordpress.org/secret-key/1.1/salt/

You will get back unique values that look something like this:

Warning! It is important that you request unique values each time. Do NOT copy the values shown below!

Output
define('AUTH_KEY', '1jl/vqfs<XhdXoAPz9 DO NOT COPY THESE VALUES c_j{iwqD^<+c9.k<J@4H'); define('SECURE_AUTH_KEY', 'E2N-h2]Dcvp+aS/p7X DO NOT COPY THESE VALUES {Ka(f;rv?Pxf})CgLi-3'); define('LOGGED_IN_KEY', 'W(50,{W^,OPB%PB<JF DO NOT COPY THESE VALUES 2;y&,2m%3]R6DUth[;88'); define('NONCE_KEY', 'll,4UC)7ua+8<!4VM+ DO NOT COPY THESE VALUES #`DXF+[$atzM7 o^-C7g'); define('AUTH_SALT', 'koMrurzOA+|L_lG}kf DO NOT COPY THESE VALUES 07VC*Lj*lD&?3w!BT#-'); define('SECURE_AUTH_SALT', 'p32*p,]z%LZ+pAu:VY DO NOT COPY THESE VALUES C-?y+K0DK_+F|0h{!_xY'); define('LOGGED_IN_SALT', 'i^/G2W7!-1H2OQ+t$3 DO NOT COPY THESE VALUES t6**bRVFSD[Hi])-qS`|'); define('NONCE_SALT', 'Q6]U:K?j4L%Z]}h^q7 DO NOT COPY THESE VALUES 1% ^qUswWgn+6&xqHN&%');

These are configuration lines that we can paste directly in our configuration file to set secure keys. Copy the output you received now.

Next, let’s open the configuration file in a text editor:

nano wp-config.php

Find the section that contains the dummy values for those settings. It will look something like this:

. . .
#define('AUTH_KEY',         'put your unique phrase here');
#define('SECURE_AUTH_KEY',  'put your unique phrase here');
#define('LOGGED_IN_KEY',    'put your unique phrase here');
#define('NONCE_KEY',        'put your unique phrase here');
#define('AUTH_SALT',        'put your unique phrase here');
#define('SECURE_AUTH_SALT', 'put your unique phrase here');
#define('LOGGED_IN_SALT',   'put your unique phrase here');
#define('NONCE_SALT',       'put your unique phrase here');
. . .

Delete those lines and paste in the values you copied from the command line:

/var/www/html/wp-config.php
. . .

define('AUTH_KEY',         'VALUES COPIED FROM THE COMMAND LINE');
define('SECURE_AUTH_KEY',  'VALUES COPIED FROM THE COMMAND LINE');
define('LOGGED_IN_KEY',    'VALUES COPIED FROM THE COMMAND LINE');
define('NONCE_KEY',        'VALUES COPIED FROM THE COMMAND LINE');
define('AUTH_SALT',        'VALUES COPIED FROM THE COMMAND LINE');
define('SECURE_AUTH_SALT', 'VALUES COPIED FROM THE COMMAND LINE');
define('LOGGED_IN_SALT',   'VALUES COPIED FROM THE COMMAND LINE');
define('NONCE_SALT',       'VALUES COPIED FROM THE COMMAND LINE');

. . .

After that, the only modifications we need to make are to the parameters that hold our database information.

We will need to find the settings for DB_NAME, DB_USER, and DB_PASSWORD in order for WordPress to correctly connect and authenticate to the database we created.

Fill in the values of these parameters with the information for the database you created. It should look like this:

<pre> // ** MySQL settings - You can get this info from your web host ** // /** The name of the database for WordPress */ define(‘DB_NAME’, ‘<span class=“highlight”>wordpress</span>’);

/** MySQL database username */ define(‘DB_USER’, ‘<span class=“highlight”>wordpressuser</span>’);

/** MySQL database password */ define(‘DB_PASSWORD’, ‘<span class=“highlight”>password</span>’); </pre>

These are the only values that you need to change.

When you are finished, save and close the file.

Step Four — Copy Files to the Document Root

Now that we have our application configured, we need to copy it into Apache’s document root, where it can be served to visitors of our website.

One of the easiest and most reliable way of transferring files from directory to directory is with the rsync command. This preserves permissions and has good data integrity features.

The location of the document root in the Ubuntu 14.04 LAMP guide is /var/www/html/. We can transfer our WordPress files there by typing:

sudo rsync -avP ~/wordpress/ /var/www/html/

This will safely copy all of the contents from the directory you unpacked to the document root.

We should now move into the document root to make some final permissions changes

cd /var/www/html

You will need to change the ownership of our files for increased security.

We want to give user ownership to the regular, non-root user (with sudo privileges) that you plan on using to interact with your site. This can be your regular user if you wish, but some may suggest that you create an additional user for this process. It is up to you which you choose.

For this guide, we will use the same account that we set up during the initial server setup guide, which we called demo. This is the account I am performing all of the actions of this guide as.

The group ownership we will give to our web server process, which is www-data. This will allow Apache to interact with the content as necessary.

We can quickly assign these ownership values by typing:

<pre> sudo chown -R <span class=“highlight”>demo</span>:www-data * </pre>

This will set up the ownership properties that we are looking for.

While we are dealing with ownership and permissions, we should also look into assigning correct ownership on our uploads directory. This will allow us to upload images and other content to our site. Currently, the permissions are too restrictive.

First, let’s manually create the uploads directory beneath the wp-content directory at our document root. This will be the parent directory of our content:

mkdir /var/www/html/wp-content/uploads

We have a directory now to house uploaded files, however the permissions are still too restrictive. We need to allow the web server itself to write to this directory. We can do this by assigning group ownership of this directory to our web server, like this:

sudo chown -R :www-data /var/www/html/wp-content/uploads

This will allow the web server to create files and directories under this directory, which will permit us to upload content to the server.

Step Five — Complete Installation through the Web Interface

Now that you have your files in place and your software is configured, you can complete the installation through the web interface.

In your web browser, navigate to your server’s domain name or public IP address:

<pre> http://<span class=“highlight”>server_domain_name_or_IP</span> </pre>

You will see the WordPress initial configuration page, where you will create an initial administrator account:

Wordpress initial config

Fill out the information for the site and the administrative account you wish to make. When you are finished, click on the install button at the bottom.

WordPress will confirm the installation, and then ask you to log in with the account you just created:

WordPress confirm install

Hit the button at the bottom and then fill out your account information:

WordPress login

You will be presented with the WordPress interface:

WordPress admin interface

By default, WordPress creates URLs dynamically that look something like this:

<pre> http://<span class=“highlight”>server_domain_name_or_IP</span>/?p=1 </pre>

This isn’t exactly the most useful interface for visitors or search engines, so most users want to modify this. WordPress has the ability to create “pretty” permalinks which will clean up the URL into a more human-friendly format.

There are a few things we need to do to get this to work with Apache on Ubuntu 14.04.

Modifying Apache to Allow URL Rewrites

First, we need to modify the Apache virtual host file for WordPress to allow for .htaccess overrides. You can do this by editing the virtual host file.

By default, this is 000-default.conf, but your file might be different if you created another configuration file:

sudo nano /etc/apache2/sites-available/000-default.conf

Inside of this file, we want to set up a few things. We should set the ServerName and create a directory section where we allow overrides. This should look something like this:

<pre> <VirtualHost *:80> ServerAdmin webmaster@localhost DocumentRoot /var/www/html <span class=“highlight”>ServerName server_domain_name_or_IP</span> <span class=“highlight”><Directory /var/www/html/></span> <span class=“highlight”>AllowOverride All</span> <span class=“highlight”></Directory> . . . </pre>

When you are finished, save and close the file.

Next, we need to enable the rewrite module, which allows you to modify URLs. You can do this by typing:

sudo a2enmod rewrite

After you have made these changes, restart Apache:

sudo service apache2 restart

Create an .htaccess File

Now that Apache is configured to allow rewrites through .htaccess files, we need to create an actual file.

You need to place this file in your document root. Type this to create an empty file:

touch /var/www/html/.htaccess

This will be created with your username and user group. We need the web server to be the group owner though, so we should adjust the ownership by typing:

sudo chown :www-data /var/www/html/.htaccess

We now have the correct ownership of this file.

We may need to adjust the permissions however. This depends on how you prefer to work. WordPress will generate the necessary rewrite rules for you. If it has write permissions to this file, it can implement the rules automatically. If it does not, you will have to manually edit this file to add the correct rules.

Which configuration you choose depends on how much you value convenience over security. Allowing the web server write access to this file will definitely be more convenient, but some say that it is an unnecessary security risk.

If you want WordPress to automatically update this file with rewrite rules, you can ensure that it has the correct permissions to do so by typing:

chmod 664 /var/www/html/.htaccess

If you want to update this file manually for the sake of a small security gain, you can allow the web server only read privileges by typing:

chmod 644 /var/www/html/.htaccess

When you are finished doing the server-side changes, you can easily adjust the permalink settings through the WordPress administration interface.

On the left-hand side, under the Settings menu, you can select Permalinks:

WordPress permalinks

You can choose any of the preconfigured settings to organize URLs, or you can create your own.

WordPress perma options

When you have made your selection, click “Save Changes” to generate the rewrite rules.

If you allowed the web server write access to your .htaccess file, you should see a message like this:

WordPress perma update

If you did not allow the web server write access to your .htaccess file, you will be provided with the rewrite rules you need to add to the file manually.

Copy the lines that WordPress gives you and then edit file on your server:

nano /var/www/html/.htaccess

This should give you the same functionality.

Conclusion

You should now have a WordPress instance up and running on your Ubuntu 14.04 VPS. There are many avenues you can take from here. Below we’ve listed some options:

Thanks for learning with the DigitalOcean Community. Check out our offerings for compute, storage, networking, and managed databases.

Learn more about our products

About the author(s)

Justin Ellingwood
Justin Ellingwood
See author profile
Category:
Tutorial

Still looking for an answer?

Ask a questionSearch for more help

Was this helpful?
 
50 Comments
Leave a comment...

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

May I set database and user in a same name?

Sure no reason you cannot. It is generally suggested that you don’t use a userid that hackers can guess - you’ll find that they are relentless in their attempts to hack and if you use “admin”, “root”, etc. they will be pounding on your installation 365x24x7 until they break in or you block their IP address and you’ll be blocking a LOT of them.

Justin Ellingwood
DigitalOcean Employee
DigitalOcean Employee badge
April 28, 2014

ichityx: You sure can. If that helps you remember the correct details, go ahead!

So would installing your custom theme just be a matter of going into the wp-contents/theme directory and just uploading your theme. And what if the theme already has content, would it just be a matter of downloading the db and then importing it through phpmyadmin?

Thanks.

Installing a theme is like a two minute job no need to be using phpmyadmin. If possible use the theme installer built into wordpress, select the ones you like, activate them and if you don’t like them switch back, viola! You can of course download them place them in your themes folder and then select them in wordpress but that’s the difficult way. HTH.

Hi,

I followed your instructions to the T but unfortunately I cannot EDIT any themes. I managed to get this working once on the default theme but not on newly installed ones.

Could you check the permissions are definitely correct? I know this is permissions related and I cannot figure out how to get it working. The one time I managed to edit the default theme, WordPress kept prompting for my FTP username and password to install anything so I know this is permissions related.

Please help.

Curious, are you using Wordpress to download the themes or are you downloading manually? If the latter you might need to do chmod on the permissions of the theme folder to match the other theme folders. HTH

To elaborate, I have tried adding the “direct” input method to the wp-config file, I’ve checked the permissions and ownership and groups for wp-content (me/www-data with Create and Delete) and nothing is working.

Andrew SB
DigitalOcean Employee
DigitalOcean Employee badge
May 20, 2014

@fak3email: Make sure the www-data can access the themes folder:

<pre> sudo chown -R :www-data /var/www/html/wp-content/themes </pre>

Hi, thank you but I’ve already done that, all permissions have been checked.

sudo chown -R :www-data /var/www/html/wp-content/uploads

After this step, I have create and delete for myself as the owner and also Create and Delete for the group www-data. However, at the step before when assigning the owner and group, www-data only has “Access” rights on all folders. Are these permissions correct? Shouldn’t www-data have Create and Delete access to wp-content? These instructions I followed only gave Access to www-data on wp-content.

Additionally, the HTML folder originally had root:root but since following these instructions it is now Me:Me

Even when I change the permissions on all folders manually, I still cannot edit themes directly within WordPress.

Kamal Nasser
DigitalOcean Employee
DigitalOcean Employee badge
May 29, 2014

@fak3email: Try running this command: <pre>sudo chown -R www-data:www-data /var/www/html/wp-content/themes</pre>

Any guides for installing Wordpress on LEMP instead? Search seems unwilling to produce evidence thereof, but I’m really really hoping. I’ve been doing every step manually rather push-click-image to learn some things, but in no way qualified to set-up each step securely without guides (and further research and refinements later).

Nvmd, I just boneheaded rather than doing the right thing from the start, https://www.google.com/search?q=digital+ocean+wordpress+ubuntu+14.04+lemp

Andrew SB
DigitalOcean Employee
DigitalOcean Employee badge
June 5, 2014

@infinitelink: Here you go: https://www.digitalocean.com/community/articles/how-to-install-wordpress-with-nginx-on-ubuntu-14-04

We should have some site improvements rolling out soon that will improve search greatly.

Dang wish I knew about this. I really LOVE nginx (aka engine-x) and tried installing wp on there with disastrous results but will try again. nginx is supposed to have AMAZING performance.

I wrote an install script based on this tutorial. Should I post the link here or is that violation of intergalactic law?

Andrew SB
DigitalOcean Employee
DigitalOcean Employee badge
June 11, 2014

@eidlyn: Feel free to post a link!

I get prompted for a username and password which I do not know, can someone help me out?

This installs straight to my IP instead of my domain at www, how do I edit this?

Andrew SB
DigitalOcean Employee
DigitalOcean Employee badge
June 18, 2014

@Mike: Do you have DNS records pointing your domain to your IP? You’ll also want to set ServerName to: <pre> ServerName www.example.com </pre> in your Apache configuration: <pre> sudo nano /etc/apache2/sites-available/000-default.conf </pre>

I’m having an issue I’m hoping someone can help with. I followed these instructions and got Wordpress running with no problems. First off, thanks for the comprehensive guide - it’s especially useful to first-timers like me! Now, I wanted to access my Wordpress site over the internet, so I set up port forwarding on my router (I’ve done this tons of times for security cameras I’ve installed). I can get to the site, however it looks like crap when I come from the outside. Almost like style sheets aren’t being applied or something. Also, if I click on any link (like to view the first entry) it hangs for while and then says page not found. Is this a permissions issue, or perhaps something in how my router is forwarding/replying to requests? Any help is appreciated!

Prolly a way late reply but hopefully it helps others in your situation (and I don’t know if you’ll get this… seems digitalocean… as much as I love their tutorials… are trying to get me to pay for an account to comment)… but what you need to do is log in to your wordpress account and from dashboard > settings you need to change the wordpress address (URL)… and maybe even the site address (URL) from the domain to your IP address (ie http://192.168.0.123). At least this worked for me when I was running wordpress on my local LAMP server… it has to do with the way wordpress links to directories. Make sure that if you’re trying to access internally to use your internal IP… externally use your external IP. Hope this helps, took me a day and probably added a few gray hairs to figure this out.

This tutorial’s great for learning Linux basics on a dev server. If you’re looking to run a live WordPress site or multiple on the same server, it’s better to use <a href=“https://serverpilot.io”>ServerPilot</a> to configure and manage the server.

Serverpilot charges you to install ssl $10/m - they take some of the folders out from the Digital Ocean installation to prevent you from installing your ssl without purchasing their license.

I got it working. I just needed to go into settings and change the ip address to my public IP address instead of the internal one that was there. Now everything is working well.

Great documentation, I followed the steps and it works flawlessly for me.

Why do I have this problem when I try to edit “header.php” “You need to make this file writable before you can save your changes”

@AndrewSB Thanks! This is the shell script that I wrote to automate this process for Wordpress as well as instructions on how to use it:

http://intlend.uk.to/jfa/shell/install-wordpress-on-ubuntu-14-04/

I set up this Wordpress site using the instructions from this page.

I, too, was able to get wordpress up and running. Thanks! However, I’d like to move this wordpress instance down a level to /var/www/html/wordpress1 (currently under /var/www/html) because I now need to add another wordpress site called wordpress2 plus some other directories under …/html. Trying to keep a fairly uncluttered …/html if that makes sense.

Kamal Nasser
DigitalOcean Employee
DigitalOcean Employee badge
July 9, 2014

@abshirejim: You can simply move the directory and update the virtualhost’s DocumentRoot accordingly:

sudo mkdir /var/www/html/wordpress1
sudo mv /var/www/html/* /var/www/html/wordpress1
sudo mv /var/www/html/.* /var/www/html/wordpress1

thx you ^^

Hi,

I did all the process till I checked the installation on IP address and it say Error establishing a database connection. I restarted 3 times and cant figure what to do. I’m a rookie here and need help to fix that stuff…Really painful when you try so many time without any result!

Kamal Nasser
DigitalOcean Employee
DigitalOcean Employee badge
July 27, 2014

@tommy.cioc: Is MySQL running?

sudo service mysql status

You can start it by running:

sudo service mysql start

hi please anyone help after completing step4 while trying to access the wordpress in browser by typing http://localhost/ i was getting apache2 ubuntu default page ,instead of wordpress welcome page any one help . And i have running ldap from same machine

I know this is way to late but for future users that might run into this problem. You have to rename the index.html otherwise it will go first to that one instead of index.php. you can do this applying the following command. mv index.html index.html.bk Now the default will be index.php

@fak3email or anyone else facing permissions and ownership issues not able to delete or upload plugins for example. The solution I hunted down is in the comments section of the WordPress with Nginx on Ubuntu guide.

All I had to do was change the ownership of /var/www/html using the following:

sudo chown -R www-data. /var/www/html Once that was done, I was able to update plugins and install themes with no issue.

The above fixed my problem and these guides, the comments giving info etc. are very helpful. Thanks again for doing this DigitalOcean!

Thanks! It work really fine!

@william754322 Thank you! I’ve been trying to fix this for the past 24 hours!

Yes, I had the same ownership issues after migration, and did the same thing (sudo chown -R www-data. /var/www/html). It works fine, but it’s not the best way to do it, i think, because WE ARE GIVING all the permissions to the Apache and it is NOT SAFE. May be I’m wrong, I don’t know. I still cant find the right way to do this. Can someone describe the standard way to setup users and permissions for Wordpress on Ubutu with LAMP, please? I’m new to all this and I’m searching second day throw web and can’t find how it has to be done.

Best answer! Please update in tutorial.

First off I would like to say hello to you.

I am new at this ubuntu server.

My first question before I do these steps you have above.

I am wanting to set up my own web page and run it from my location. what i mean by this is I am not paying for hosting or database service.

I am wanting to run my page from my location and would like for people to be able to see it when they put in like www.jump.com. that is for an example not what I am going to name my page.

Can this be done with the steps you have above and if so could you show me how to do this. Thanks in advance

Kamal Nasser
DigitalOcean Employee
DigitalOcean Employee badge
August 8, 2014

@SHSMod: Yes. You can follow this tutorial if you’re running Ubuntu 14.04 on your server.

You will also need to purchase a domain name, and point its DNS records to your server’s IP address. Then, make sure port 80 is open in your firewall and is forwarded to your server’s IP address (look up instructions on configuring port forwarding on your router).

Once you’ve done that, browsing to http://yourdomain.com should load whatever website you’re hosting on your server.

Thanks for the info. so there is no way for me to get out of purchasing a domain??

@william Thank you for the tip, was pulling my hair out figuring this out.

touch /var/www/html/.htaccess sudo chown :www-data /var/www/html/.htaccess chmod 664 /var/www/html/.htaccess

After doing those last 3 steps. I can’t access wordpress this is what it tells me.

Forbidden

You don’t have permission to access /wd-admin/ on this server. Apache/2.4.7 (Ubuntu) Server at 192.168.0.107 Port 80

Kamal Nasser
DigitalOcean Employee
DigitalOcean Employee badge
August 11, 2014

@SHSMod: The URL should be /wp-admin, not wd-admin. :)

Thanks I went in and updated this. but still getting.

Forbidden

You don’t have permission to access /wp-admin/ on this server. Apache/2.4.7 (Ubuntu) Server at 192.168.0.107 Port 80

I fixed it by using webmin to change the user. but will this mess up the .htaccess?

Kamal Nasser
DigitalOcean Employee
DigitalOcean Employee badge
August 11, 2014

@SHSMod: Are there any errors in Apache’s error log file?

sudo tail /var/log/apache2/error.log

[Mon Aug 11 13:25:17.500120 2014] [core:crit] [pid 1126] (13)Permission denied: [client xxx.xxx.x.xxx:xxxxxx] AH00529: /var/www/html/.htaccess pcfg_openfile: unable to check htaccess file, ensure it is readable and that ‘/var/www/html/’ is executable

I see 4 lines of that. not sure if this is the error you were talking about but the only thing i see. also the ip address that was there was wrong as well not sure if that is what the issue is but it was not my ip address.

Kamal Nasser
DigitalOcean Employee
DigitalOcean Employee badge
August 11, 2014

@SHSMod: Looks like Apache isn’t able to read the htaccess file. Run the following command:

sudo chmod -R o+r /var/www/html

Does that fix it?

If not, can you post the output of:

sudo stat /var/www/html/.htaccess

We also need to set db collation to utf-8

CREATE DATABASE wordpress CHARACTER SET utf8 COLLATE utf8_unicode_ci;

When I try to run the stat line that you posted this is what it tells me.

stat: cannot stat ‘/var/www/html/.htaccess’: No such file or directory

Great guide. Congratulations, your guides are very good because not only teach what to do and how, but also why to do. Thank you.

hi i got problem to upload new themes this result me an error like this Unable to create directory wp-content/uploads/2014/09. Is its parent directory writable by the server?

Great tutorial. Everything worked for me, but the permalinks. I followed the instructions, but get a 404 page when trying to visit a page or post, and I tried both, allowing Wordpress to automatically update the file, and manually. But if change the permalinks settings back to the original, the links work.

Any help is appreciated.

Thank you for writing such a clear article. So many times in the past I found myself jumping from out of date article to out of date article trying to piece the installs together. Then invariably users arguing over permissions and how to install it right, to later find out they had no idea what they were talking about and I just gave Everyone write access to a folder on the web. I also wanted to thank you for taking the time to answer everyone’s questions.

Really a great tutorial!

Combined with the tutorial about installing the LAMP stack, I was able to move my websites from a Windows 2003 server to an Ubuntu 14.04 server while changing the URL in the process.

Hi, Detailed article, but still have problem completing wordpress installation.

when i try to access Wordpress installation page using IP address I get database connection error. Checked mySQL it’s working fine and running.

Any idea how to resolve it?

I did everything exactly like it said and I get Error establishing a database connection at step 5. I checked my config file and everything is correct. I should add that I’m using mariadb. Someone please help.

i have an owncloud service running already and wanted word press to be on the same server. i can acces my owncloud at 82.180.xx.xxx/owncloud and wanted to acces my wordpress at 82.180.xx.xxx/wordpress. but when i am comming to the command sudo chown -R demo:www-data * i am getting this output ?

the path /var/www/html/wordpress is in my installation /var/www/wordpress so it would work togheter with owncloud

daniel@Owncloud:~$ sudo chown -R demo:www-data * chown: invalid user: ‘demo:www-data’

My setup is :

Ubuntu 14.04 LTS server Lamp Owncloud (working Wordpress (Not working

Try DigitalOcean for free

Click below to sign up and get $200 of credit to try our products over 60 days!

Sign up

Join the Tech Talk
Success! Thank you! Please check your email for further details.

Please complete your information!

Become a contributor for community

Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.

DigitalOcean Documentation

Full documentation for every DigitalOcean product.

Resources for startups and SMBs

The Wave has everything you need to know about building a business, from raising funding to marketing your product.

Get our newsletter

Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.

New accounts only. By submitting your email you agree to our Privacy Policy

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.