Skip Navigation
IT Connect
Connecting You to Information Technology at the UW

 

Installing WordPress

IT Connect > Web > Publishing > Wordpress

Server Upgrade Completed

UW-IT upgraded the faculty, staff, depts, and courses web servers, on May 3rd, 2012. Documentation has been updated to reflect the new MySQL server and web development environment changes. Users still running MySQL servers on ovid21.u.washington.edu still need to migrate to the new ovid.

Learn More about the Upgrade

Prerequisites

  1. MySQL Server
    Wordpress requires a database system, so if you don't already have it installed on your account, you'll need to install MySQL.

  2. MySQL Database
    You also need to create a database for Wordpress. The name is not too important, but most users choose "wordpress." Look at our instructions for creating a database using the MySQL command-line client, or use phpMyAdmin.

  3. Create and Edit your php.ini file (Optional)
    You may want to create and edit your php.pip file. This is not strictly required, but uploading files may not work as intended if not set. While most of our default PHP settings are correct, Wordpress uploads function more reliably when you set your temporary upload directory manually.

    In order to change your upload directory, you need to copy the file to your public_html directory (following the directions on the link below) and then edit any settings you wish to change. Unless you know what you're doing, you should just edit the upload_tmp_dir setting. Depending on the application and how you're using it, other settings might also be a good idea.

    Instructions for Creating and Editing Your php.ini File

  4. Sign up for the UW Wordpress Users Mailing List (Optional)
    If you would like to be notified about new versions of Wordpress, security updates, caching tips, and other relevant information about running a Wordpress site on the UW servers, we recommend signing up for the UW Wordpress Users Mailing list:

    https://mailman1.u.washington.edu/mailman/listinfo/wordpress

    You can also ask questions from fellow Wordpress users on campus.

Installation

  1. StepsActions
  2. Log into your web development host using a terminal emulator. Not sure how to do this? Click here for directions.

  3. Change directories to your public_html directory.

    cd public_html
  4. Download WordPress using wget.

    wget http://wordpress.org/latest.tar.gz
  5. Unzip the file you just downloaded:

    tar -xzvf latest.tar.gz
  6. WordPress has a configuration script that will allow you to configure it to connect to your database via the web. We'll use that.

    Open your favorite browser and go to http://account_type.washington.edu/uw_netid/wordpress/wp-admin/setup-config.php.

    Replace account_type with staff, faculty, depts, courses, or students. Use whichever of these you normally use to view your website. Replace uw_netid with your UW NetID.

    Start the setup process by clicking on "let's go!".

  7. Enter the database connection details. You should know these if you just set up MySQL.

    Database Name: wordpress (or whatever you named the database you created)
    User Name: Use a username you have created in MySQL with access to the wordpress database. If you didn't create a separate user, this will most likely be root.
    Password: The password for the MySQL user mentioned above. If you're using root, it will be your MySQL password.
    Database Host: webdev host.u.washington.edu:port# (see note below)
    Table Prefix: (leave this empty)

    Note: The "Database Host" field is the most confusing one here. You'll need to enter the hostname of either ovid or vergil, depending on where your MySQL server is running. Most students will use vergil.u.washington.edu. Most other users will use ovid01.u.washington.edu. If the first one doesn't work, try the other. The port# will be the port number that you started MySQL on. This is located in your .my.cnf file if you don't remember. For a departmental website that is running MySQL on port 31337, their host line will look like this:

    ovid01.u.washington.edu:31337
  8. Continue the installation by clicking on "run the install!".

  9. Click on "First Step". Enter a title and your email address, and continue.

  10. Now log on to WordPress with the random password given to you and change the admin password to something you can remember.

  11. You're all set up. You can delete the latest.tar file you originally downloaded. Now write a blog entry.

Making WordPress Appear in the Web Root

Using these instructions you can make your WordPress blog appear in the root of your Web directory without the potential problems of putting all of your WordPress files in the Web root. These instructions are based on instructions for Giving WordPress its Own Directory.

Note: If not completed properly, these instructions can make your WordPress installation unusable without manual database manipulation to make it work again. Be sure to fully read through these instructions and make sure you understand them before beginning.

  1. StepsActions
  2. Copy the index.php file from your "wordpress" directory to the "public_html" directory.

    cp ~/public_html/wordpress/index.php ~/public_html/
  3. Edit the index.php file to refer to the proper location.

    pico ~/public_html/index.php

    Change the line that says:

    require('./wp-blog-header.php');

    to the following:

    require('./wordpress/wp-blog-header.php');

    Save and close the file using Pico. (Click for instructions on how to use pico).

  4. Go to the administration dashboard. Go to Settings > General.

  5. Remove "/wordpress" from the end of the "Site address (URL):" value. The value should then look like "http://type.washington.edu/UWNetID" where "type" is the type of account you're using and "UWNetID" is the UW NetID of the account you're using.

    Important: Do not edit "WordPress address."

  6. Click "Save Changes."

  7. Go to Settings > Permalinks.

  8. Select the permalink structure you prefer, and click the "Save Changes" button.

  9. Now visit your site and see if WordPress is displayed properly.

Improving Performance

By default, Wordpress dynamically generates a webpage every time a visitor views it. In many cases, this is unnecessary and can lead to slow loading times and overwhelmed servers in times of high traffic. Webpage caching can often assist in speeding up general site performance and make it a better visiting experience for your users. While Wordpress doesn't have any built-in caching capability, there are a number of plugins which can perform website caching. You can view more information about how to speed up your site at the Wordpress Codex:

WordPress Optimization/Caching

Note: W3 Total Cache is not fully compatible with UW servers. WP Super Cache is recommended instead.

Authentication Setups

There's a plugin for WordPress that will allow you to use UW NetID authentication to log in to your blog. This means that if you've logged into Web Alpine or MyUW or other UW websites during this session, you'll already be logged into your blog. That's pretty handy.

UW NetID Required for Posting

This setup will require you to log in with your UW NetID in order to post entries, edit the configuration or other administrative tasks.

  1. Log into WordPress as the administrator.

  2. Create a WordPress user with the same username as your UW NetID. This will be the user that you normally log in as, so you might want to consider giving the user administrator privileges. Note that when you create users in Wordpress, the Nickname field is used for their username.

  3. In order to protect all of your administrative functions you'll have to enable UW NetID authentication for wp-login.php, xmlrpc.php and the wp-admin directory.

    You can do this by adding two .htaccess files.

    Open the first file using pico (it's okay if this is blank):

    pico ~/public_html/wordpress/.htaccess

    Then add the following to the file. You should replace your_uwnetid with the list of UW NetIDs that you want to be able to post to your blog.

    <Files wp-login.php>
    AuthType UWNetID
    require valid-user
    </Files>

    <Files xmlrpc.php>
    AuthType UWNetID
    require user your_uwnetid
    </Files>

    Save and close the file using Pico. (Click for instructions on how to use pico).

  4. Now, open the other .htaccess file (it's okay if this is blank when you initially open it).

    pico ~/public_html/wordpress/wp-admin/.htaccess

    Now add the following text to that file:

    AuthType UWNetID
    require user your_uwnetid

    Save and close the file using Pico. (Click for instructions on how to use pico).

  5. On the command line, go to the plugins directory of your WordPress install. This is located at wordpress/wp-content/plugins. If your WordPress directory is called "wordpress", you can use this command:

    cd ~/public_html/wordpress/wp-content/plugins
  6. Download the plugin using wget.

    wget http://downloads.wordpress.org/plugin/http-authentication.4.1.zip
  7. Unzip the plugin.

    unzip http-authentication.4.1.zip
  8. Hopefully you're still logged in as the administrator account. Go to the Plugins screen and activate "HTTP Authentication."

  9. You're done. Verify that everything's working by posting to your site.

UW NetID Required for Comments and Posting

Before you read this part, go through the instructions UW NetID Required for Posting. Most of the work for this setup will already have been done when you get through that one.

  1. StepsActions
  2. Log into WordPress as the administrator.

  3. Go to "Settings" and then "Discussion." Check the box labeled "Users must be registered and logged in to comment."

  4. Go to "Settings" and then "HTTP Authentication." Check the box labeled "Automatically create accounts?" This means that anyone with a NetID who doesn't already have a user account will automatically have one created for them on the Wordpress blog. In the "Email address domain" enter "uw.edu." Click on "save changes."

  5. Add the following section to the .htaccess file in your WordPress directory.

    <Files wp-comments-post.php>
    AuthType UWNetID
    require valid-user
    </Files>
  6. You're done. Open your website and post a comment to test your setup.

UW NetID Protected Blog

This is the most strongly protected setup in which users will have to log in with their UW NetID in order to even read your blog.

  1. StepsActions
  2. There are two options you'll have to update in order to get the blog to load things properly when you turn authentication on in the .htaccess file. You can get to these settings by clicking on "Options."

    The options "WordPress address (URI)" and "Blog address (URI)" will both need to be changed to begin with "https" rather than "http."

  3. Create a WordPress user with the same name as your UW NetID. This will be the user you normally log in as, so you might want to consider giving the user administrator privileges.

  4. In order to get the plugin working you'll have to enable UW NetID authentication for your WordPress directory.

    You can do this by following the instructions for Authorizing Any Valid UW NetID.

    Assuming you want anyone with a UW NetID to be able to read your blog, you can use this .htaccess file in your WordPress directory:

    AuthType UWNetID
    require valid-user
  5. Hopefully you're still logged in as the administrator account. Go to the Plugins screen and activate "HTTP Authentication."

  6. That should do it. Contact help@u.washington.edu if you have any problems.