Home > College, Computers, Guides, Programming, Wordpress > Easy Website on Your University of Oregon Web Space

Easy Website on Your University of Oregon Web Space

February 1st, 2009

Wordpress on Your University of Oregon Web Space

NOTE: shell.uoregon.edu is now sftp.uoregon.edu

Ever wanted to have your own webpage at http://uoregon.edu/~YourDuckID? Ever wanted to setup a clean-looking, easy-to-maintain website for a student group your are associated with? Well now the whole process is a snap! Every University of Oregon student is given space to set up their own website.

It’s a fairly complex process to set up all the necessary tools (PHP and MySQL) manually, so I wrote a program to do it for you (mostly) automatically! All you need to do is login to your uoregon.edu account and follow a couple simple instructions.

Why WordPress?

WordPress is tool that lets you create, design and maintain a website without knowing anything about computers or the internet. Anyone can do it! It is meant to be a tool for bloggers, but it functions perfectly for those who just want a normal website.

WordPress can be as simple or as powerful as you need it to be. In my opinion, it is the perfect tool for student groups because of how often management changes. With WordPress, anyone can pick it up and make any changes without any knowledge on how to create websites. The real power of WordPress is that you can create/edit pages from a web interface using an WYSIWYG (visual) editor. You can see a demo of this web interface here (username: admin // password: demo).

Other features:

  • Customizable themes so you can easily style your website and give it it’s own distinct look.
  • Amazing plugins to let you add any kind of functionality to your website (e.g. adding a contact form to your site).
  • Multi-user enivronment so you can add other bloggers/editors to help you edit the website. This is especially useful for student groups with a lot of contributors.
Warning: No support is guaranteed
Before we go any further, I wanted to let everyone know that although I am writing this guide to be accessible to anyone, I also can’t promise that there will be support for it if something breaks down the road. There’s a 98% chance that nothing will ever go wrong. What you’re doing here normally requires a bit of technical knowledge, but I’ve attempted to make it easy for anyone to do. If something does go wrong, I can’t say for sure how much The Help Desk at the UO will want to help you.

If you do have some problems, post a comment at the end of this post and I’ll do my best to help you out.

Getting Started

Before you can complete these instructions you will need a program that let’s you access the files on your sftp.uoregon.edu account. Accessing this account is called “SSHing” into it. This is fairly simple for Mac OS X users, but is a bit more complicated if you are using Windows.

You can enable shell access by going to:
http://duckid.uoregon.edu
Select “Manage Optional Account Access”
Then hit “Enable Shell Access”

Windows Users

Note: If you own a Mac, skip to the next section called “Mac Users”.

First, you need to download and install a program called PuTTY (or just download v0.60 directly).

Once it is installed, run it and follow these steps.

PuTTY Host Options
Enter sftp.uoregon.edu under the host field. It should look the image to the right.

Press OK. You should get a message saying there is a “Security Alert”. Just press Yes.

Now you’re almost ready to go. Just enter your Duck ID (the same one you use to login to your email and blackboard) and your password. If you’re doing this for a student account, the process is exactly the same, but with the username/password that you would use to login your groups email address. It should look like this:
PuTTY login screen

You’re ready to move on! Go on down to the “Running the Script” section below.

Mac Users

Mac OS X users have it much easier because the program you need is already installed.

Spotlight Terminal SearchYou just need to run the Terminal application. The quickest way to get it it is by using the searching for it using the search box (Spotlight) in the top right corner of the screen.

Once that program is up and running you just need to use your Duck ID (the same one you use to login to your email and blackboard) and your password. If you’re doing this for a student account, the process is exactly the same, but with the username/password that you would use to login your groups email address. Here’s what it looks like when I use my Duck ID (jblancha) and password:
osxterminal

Running the Script

Now that you have SSH’ed into you account, you’re ready to run the script!

Type each of the following commands in and press enter after each line. The first command will take a couple moments to run, so don’t type the next one until it is done.

wget http://auzigog.com/perm/wordpress_shell.sh
chmod 0755 wordpress_shell.sh
./wordpress_shell.sh

The last command will run the script I wrote to do all the work for you.

The first thing you need to do is type n and press enter to indicate that you are not an advanced user. Now you should see a bunch of lines being output to the screen.

*** Do you want to install MySQL using the 'mysql_install_db' command? You should do this ONE TIME ONLY
Are you an advanced user who needs the MySQL passwords later? [y/n]: n
// Creating .htaccess in your public_html directory (/home6/spanst/public_html) so all files ending in .php will execute
// Creating php.cgi in your home directory (/home6/spanst) so all files ending in .php will execute
// Generating a port number (between 5000 and 6000) to run MySQL from
// For reference, the port number that MySQL is running on is: 5430
// Making a MySQL configuration file for your account
// Installing the MySQL database. This may take a few moments...
// Setting a root password for wordpress
// Creating a username and password for wordpress
// Configuring a cron job to ensure the MySQL Daemon doesn't go down
// Downloading and placing wordpress files. This may take a moment....
// Creating public_html/wp-content/uploads for uploaded images/files
// Configuring wordpress

// Here is some stuff you can ignore if you don't know what it is:
   PORT: 5430
   MySQL 'root' account password: ########
   MySQL 'wordpressuser' account password: ########
   MySQL database for wordpress: wordpressdb
   MySQL host for connections: sftp.uoregon.edu:5430

SUCCESSS! Visit http://uoregon.edu/~spanst to finish the installation of your blog!

Note: Please remove index.html from your ~/public_html folder so that WordPress can actually work

Note: Please write down the four lines that start with MySQL in case you or someone else ever needs those passwords to fix things down the road.

As the script indicates, you’re done! You can now visit http://uoregon.edu/~YourDuckID/ to give your blog a name. When it asks you for an email address, be sure to use a real one because it that is where your username and password will be sent.

To login to the control panel (where you edit pages and blog posts), go to http://uoregon.edu/~YourDuckID/wp-admin/.

There’s some more information below that you might find helpful, but you’re basically done! If you’ve successfully used this script, please leave a comment below so I know that people are finding it useful. Spread the word to other individuals and groups so everyone can create a useful website!

Extending WordPress

You’re done with the important part. If you want to customize WordPress, here are some suggestions.

  • Install a theme to give your site its own look. Check out my favorite themes. (Instructions)
  • In the control panel, go to Settings → Permalinks → Select “Day and Name” → Save Changes
  • Add a contact form to your site
  • Add other authors/editors to your site by going to the control panel and Users → Add New
  • Setup Akismet to block spam comments on your blog posts

If you need any other help in working with WordPress, check out their support site.

Good luck! Please leave a comment below if you have any comments or questions!

What the heck did the script do?

If you’re not a big nerd, just scroll down to the comments section. If you’re a more technical user and are curious what happened, here’s an overview. You can find very detailed instructions for all of this on my wiki.

  1. Use a .htaccess file to redirect all .php requests to a CGI script
  2. Use the CGI script to make sure all .php files are run under PHP5 (instead of being served as text files
  3. Install a copy of MySQL for your account on a specific port number.
  4. Create a MySQL database for WordPress
  5. Set up a cron job to make sure MySQL comes back up if the server ever restarts
  6. Download and unzip the latest version of WordPress
  7. Automatically edit your WordPress config file with all the information it has just generated

Credits

The only reason I was able to figure out this process in the first place was because of the following people

  • Micro’s guide to MySQL on shell – Not the best instructions in the world, but absolutely necessary.
  • Easy PHP on shell – Tristan at the EMU marketing department made most of this possible with his instructions for getting PHP files to run properly (instead of being served as text files). Tristan actually wrote a WordPress installation guide similar to this one last month.
  • Justin McCraw – Helped me remember the simplest set of steps to get this done
  • Bruce and Spencer at the UO for helping with specific issues I had along the way

College, Computers, Guides, Programming, Wordpress , , , , , ,

  1. February 2nd, 2009 at 03:24 | #1

    Excellent guide! The script is an amazing tool. I even learned a few new BASH tricks from looking at what you’ve done. I don’t know how you have time to write such detailed and nice looking blog posts. Thanks for the shout out!

  2. February 13th, 2009 at 00:46 | #2

    Awesome tips, awesome script, thanks a lot.

  3. April 5th, 2009 at 20:28 | #3

    Great post. I love the blog in general. And you’re photo portfolio is incredible. I’m gonna keep you in mind for the future if I ever pictures done. Hope that’s ok!

  4. Kevin McNaught
    July 2nd, 2009 at 22:27 | #4

    Hey, great blog post! I tried out your script and it worked perfectly. The one question I have is how I can uninstall what I’ve just done… I am trying to learn PHP & MySQL and want to have a fresh start.

  5. Auzigog
    July 6th, 2009 at 09:53 | #5

    Glad it worked for you, Kevin! I wasn’t sure if it worked after the system admins changed how shell works.

    Unfortunately, I am not sure how to “undo” everything that happens. The script runs a command that effectively “installs mysql” for your account.

    I would suggest you just don’t try to undo what the script did. Most servers are going to come with MySQL and PHP in the state that they are now in after running my script.

  6. July 27th, 2009 at 18:03 | #6

    Nice detailed instructions and script Jeremy.
    This basically the exact same thing Fantastico does on a regular web host correct?

  7. Auzigog
    July 28th, 2009 at 00:03 | #7

    Thanks, Ron! Yeah, it’s basically what Fantastico does. I’m sure their method is probably a bit cleaner, though.

  8. September 8th, 2009 at 11:59 | #8

    Jeremy,

    Do you know if this script still works with the change to sftp.uoregon.edu?

    Should this still work the same?

  9. Auzigog
    September 8th, 2009 at 22:17 | #9

    It should!

    Let me know if it doesn’t.

  10. Joseph Loubert
    December 17th, 2009 at 18:36 | #10

    Nice guide. I’ve been able to get PHP and MySQL working, but rather shoddily. It seems that the problem is that the PHP sessions aren’t visible to both servers (as I’m sure you know, the University webpage is hosted across the two servers ‘webserv1′ and ‘webserv2′). Eg, if I sit and refresh the page for a while, some of the time it will look like I’m logged in, and sometimes it won’t.

    Is there some way to deal with this?

  11. Joseph Loubert
    December 23rd, 2009 at 08:43 | #11

    @Joseph Loubert
    To answer my own question, the easiest way around this is to create the directory /home#/username/sessions/, and change the shebang line in php.cgi to:

    1. !/usr/local/bin/php5 -d session.save_path=/home#/username/sessions

    I am still curious about why I haven’t seen this behavior reported elsewhere. Do sessions just work for everybody else?

  12. Cameron S.
    January 16th, 2010 at 09:56 | #12

    Jeremy, while following your instructions for Window’s I came across a problem. After entering the host, sftp.uoregon.edu, and opening up the black user screen, I entered my username, then the password but after pressing enter following the password nothing came up. It just went to the next line. Am i doing something wrong? thanks in advance.

  13. Taylor
    February 23rd, 2010 at 19:29 | #13

    Hello,

    I used your script to set the basics for the UO Sailing team website and then went on to do the Disc Golf Site except this time when I ran the script I got “Error establishing a database connection” instead of the normal WordPress Jazz. http://uoregon.edu/~discgolf.

    Any Ideas?

    Thanks,

  14. March 3rd, 2010 at 16:08 | #14

    Dear Jeremy,

    I am curious if the script will run with a Drupal installation, instead of WordPress?

  15. Auzigog
    March 21st, 2010 at 18:41 | #15

    @Adam: You can run the scrip, write down all the usernames, passwords and ports and then delete the files for WordPress and try to install Drupal and use the WP database. It won’t be really easy, but it would be a start.

  16. Auzigog
    March 21st, 2010 at 18:41 | #16

    @Taylor: Sorry. I’m not sure why you’re getting that error. Might try googling to see if anyone else has had a similar experience.

  17. March 26th, 2010 at 12:21 | #17

    Hi Jeremy,

    Thank you for getting back to me.
    Should I delete all of the worpress files in the public html folder?
    Is there anything in the mysql folder to delete?
    Also, you mentioned usernames and passwords, where would those be located? I do not have wordpress set up yet, so I have no users or other authentication set up.
    Would the drupal install go in the public html folder?

  18. April 11th, 2010 at 09:50 | #18

    Hey Jeremy,
    This is kind of old news, but I didn’t see it mentioned anywhere. By default, shell access is disabled for all new users or those that had never used it. You can enable shell access by going to:
    http://duckid.uoregon.edu
    Select “Manage Optional Account Access”
    Then hit “Enable Shell Access”
    Otherwise, you’re password will not be accepted during the SSH part of the guide.

  19. Auzigog
    April 20th, 2010 at 14:10 | #19

    @Adam P.: Hey. I just got Drupal running on my shell account. Try following these (very very sloppy) directions: http://wiki.auzigog.com/Drupal_on_shell.uoregon.edu_UO_Web_Space#Migration_instructions

    The usernames and passwords are displayed in the terminal after you run the script. You should write them down.

    Yeah, Drupal would go in the public_html folder.

  20. August 2nd, 2010 at 23:21 | #20

    open up PowerShell and add on to it with some modules; then we learned how to creat

  21. August 14th, 2010 at 15:56 | #21

    Hey, I can’t seem to get this working. It appears as though someone already installed mysql from my home dir. I have the wordpress.sh, the public_html dir and a .htaccess file – all with the correct credentials. What the heck is my mysql root password? Why do I get a permission denied error when visiting my site if someone already set this up?

  22. August 14th, 2010 at 17:32 | #22

    I forgot to put “username” after the second grep above and also kill the relevant pid’s.

    Another thing is that the db_host value in the wordpress config file needs to be shell.uoregon.edu if you are logging ssh’ing into shell. (sftp doesn’t seem to work for me – off the campus network perhaps?)

  1. February 1st, 2009 at 20:41 | #1
  2. March 19th, 2009 at 14:45 | #2
  3. January 13th, 2010 at 20:59 | #3
  4. March 3rd, 2010 at 11:43 | #4