LIS 390W1A - Lab 15: Installing Wordpress

Assignment

In class today we will be installing Wordpress. Wordpress is a relatively easy piece of software to install. However, be sure to pay attention to the installation process, because most blog software, wikis, and content management systems (CMSs) get installed in a very similar way.

The following steps assume you are installing Wordpress on your GSLIS I: Drive. Similar steps are needed for other web hosts. From these instructions, you can probably figure out how to do it on a different hosting service, but if you have questions, just ask.

  1. The first step is to download the Wordpress software. Wordpress is Free Open Source Software (FOSS), which means you have full rights to download it, use it, read the source code, edit it, etc. Thus, all you have to do is download it:
    • Go to the Wordpress Downloads Page.
    • Download the latest stable release, which should be the version on this page. For this assignment, please download the gzipped tarball, i.e., the file ending in .tar.gz - this file is listed underneath the download button as a hyperlink. The zip file will work too, but most FOSS gets compressed in tarballs, so it is important we learn how to unzip them.
  2. Once the file is downloaded, we need to move it to the server. We will need to use the command line to do this, so if you're using a Mac, open two Terminal windows, and if you're using Windows, open both PuTTY and WinSCP or your command line and file transfer programs of choice.
  3. Unfortunately, because of how the GSLIS infrastructure is set up, the GSLIS I: drive cannot be used for Wordpress the way we are needing to use it for class. Therefore, we will be using some special sandbox space to install it that was just set up today. Unfortunately, this means we will have to deviate from the instructions on this page. I am not sure how I am going to communicate the new details to you for reasons I will explain in class. If you were unable to attend today's class, you will need to see me in office hours.

    Log in to the classroom server and navigate to your space on the I: drive. The following commands will get you there on the command line (don't type the % sign, it is just there to indicate that we're using the command line). Don't forget to replace "netid" with your actual NetID.

    % ssh netid@classrm03.lis.illinois.edu
    % cd /homei/users/netid/courseweb_html/
    
  4. Wherever you want to put the Wordpress installation, do a pwd command to get the path.

    You do not need to put the Wordpress tarball in a new directory because it will unzip into its own directory. However, please note that while the wordpress tarball already has all its files contained within its own directory, not all FOSS that you download does, so in most cases it is safer to create your own directory to install it in, e.g.:

    % mkdir wp
    % cd wp
    % pwd
    
  5. From your other Terminal window or from your GUI SFTP client (e.g., WinSCP), copy over the file to this directory on the GSLIS I: Drive, e.g.:

    % scp wordpress-3.7.1.tar.gz netid@classrm03.lis.illinois.edu:/homei/users/netid/courseweb_html/wp/
    
  6. At this point, you may need to fix the permissions for the file so that the web server can read the files and serve them on the web. To check, type the following, which should get you output that looks something like:

    % ls -al
    total 4508
    drwxrwsr-x+  2 netid netid    4096 Nov 13 03:42 .
    drwxrwsr-x+ 11 netid netid    4096 Nov 13 03:33 ..
    -rw-r--r--+  1 netid netid 4594818 Nov 13 03:43 wordpress-3.7.1.tar.gz
    

    There are three levels of permissions in linux/unix. The first is "user" or "individual", the second is "group", and the third is "other" or "world" or "everybody". When you typed the command "ls -al", the flag "a" means show all files including hidden files, and the flag "l" means show long or verbose version. (If you want more details about how any linux/unix command works, just look up its manual page by typing "man commandname" at the command line, e.g.: "man ls". To exit the manual, type "q" for quit.) In the ls output, the permissions are detailed in this part: drwxrwsr-x+. The first character simply tells you whether the item in the list is a directory "d", a file "-", a symbolic link "l", or something else. The next 9 characters are what we're interested in: the first three are the permissions for the user—that means you, the second three are the permissions for the group—that means anybody else on the server who is logged in with a valid account (approximately), and the final three are the permissions for the world—that means EVERYBODY ON THE INTERNET!!! In each set, the "r" means "read permissions enabled"—you can open the file and read its contents, the "w" means "write permissions enabled"—you can change the contents of the file by overwriting it with a new file, and the "x" means "executable permissions enabled"—if the file is a script or other executable file of some sort then you can run it on the server. The "x" is particularly important for directories, because without it, you cannot cd into into them.

    Permissions are extremely important, so make sure you get them right. For most web servers, the user and group permissions don't matter too much. However, for GSLIS, the web server operates on the group level of access. Therefore, if you want your pages to be served, they have to be open to group level access for reading (and executing).

    On any web server, if you make files world writeable, then you open up your web server to being seriously hacked. NEVER MAKE YOUR FILES WORLD WRITEABLE!!!

    Therefore, on the GSLIS I: drive, you want your permissions to look something like either of these for non-executable files (in order of increasing safety):

    -rw-rw-r--+  1 netid netid 4594818 Nov 13 03:43 wordpress-3.7.1.tar.gz
    -rw-rw----+  1 netid netid 4594818 Nov 13 03:43 wordpress-3.7.1.tar.gz
    

    And something like one of these for executable files (in order of increasing safety):

    -rwxrwxr-x+  1 netid netid 4594818 Nov 13 03:43 wordpress-3.7.1.tar.gz
    -rwxrwxr--+  1 netid netid 4594818 Nov 13 03:43 wordpress-3.7.1.tar.gz
    -rwxrwx---+  1 netid netid 4594818 Nov 13 03:43 wordpress-3.7.1.tar.gz
    

    If they don't look like this then you'll need to fix them using the chmod (change file mode bits) command to add group permissions or remove world permissions as needed.

    If your permissions look like this:

    -rw-------+  1 netid netid 4594818 Nov 13 03:43 wordpress-3.7.1.tar.gz
    

    Then you need to make them group accessible by using the following chmod command:

    % chmod g+rw wordpress-3.7.1.tar.gz
    % ls -al
    total 4508
    drwxrwsr-x+  2 netid netid    4096 Nov 13 03:42 .
    drwxrwsr-x+ 11 netid netid    4096 Nov 13 03:33 ..
    -rw-rw----+  1 netid netid 4594818 Nov 13 03:43 wordpress-3.7.1.tar.gz
    

    If your permissions look like this:

    -rw-rw-rw-+  1 netid netid 4594818 Nov 13 03:43 wordpress-3.7.1.tar.gz
    

    Then you need to remove world access by using the following chmod command:

    % chmod o-rw wordpress-3.7.1.tar.gz
    % ls -al
    total 4508
    drwxrwsr-x+  2 netid netid    4096 Nov 13 03:42 .
    drwxrwsr-x+ 11 netid netid    4096 Nov 13 03:33 ..
    -rw-rw----+  1 netid netid 4594818 Nov 13 03:43 wordpress-3.7.1.tar.gz
    
  7. The next step is to unzip the file. If you read the instructions and downloaded the tarball, the command for unzipping it (extracting it) is this:

    % tar -xzvf wordpress-3.7.1.tar.gz
    

    Where the "x" means extract a tar ball; the "v" means verbose output to show the progress of extracting the files; the "f" means specify an archive or a tarball filename; and the "z" means decompress and extract the contents of the compressed archive created by gzip program (tar.gz). (Thanks to this site for writing the explanation I copied in this paragraph.)

    If you didn't read the instructions above, then extracting a zip file should be as simple as:

    % unzip wordpress-3.7.1.zip 
    

    After unzipping the files, spot check the permissions to be sure they're ok. I believe it should work fine but ask if you're not sure.

  8. The next step is setting up your MySQL service.

    The GSLIS classroom servers do have MySQL access. By default, the database is not set up, but you can activate it automatically (these instructions can also be found here):

    1. Go to the GSLIS GUMMS page (https://gumms.lis.illinois.edu/).
    2. You will be prompted to log in. Use your NetID with your GSLIS password.
    3. On the GUMMS homepage, click on the "Course Web/DB Access" button.
    4. Click on the "Change your coursedb.lis.illinois.edu MySQL Password" link.
    5. On this page, create a password for your MySQL database. DO NOT USE YOUR GSLIS, CITES, OR OTHER IMPORTANT PASSWORD AS THERE IS A CHANCE IT COULD BE COMPROMISED IF YOU ARE CARELESS IN WRITING YOUR PHP SCRIPT!!! The password you are creating in this step is not a secure password, and will be stored in many open text files that could easily be viewed by other people, so don't use a password that is personal or embarrassing. But please make sure you remember your password.
    6. When you click submit, a MySQL database will be automatically created with your NetID as your username. The database will be located on the following server: coursedb.lis.illinois.edu

    If you have trouble following any of these steps, you might find this tutorial video useful.

  9. Now that MySQL is set up, we need to create the database that we will be using for Wordpress. While we could do it by writing a php script, it is easier to do it from the MySQL command line:

    1. Go to your Terminal or PuTTY window that is logged into the classrm server and type in the following command, replacing the "-unetid" with -u followed by your netid with no spaces in between:

      % mysql -h coursedb.lis.illinois.edu -unetid -p
      

      Notice that you now have a new command-line interface. This is the MySQL command line interface and you are working directly in the database server itself.

    2. To create a database in MySQL, type in the following command in the MySQL command line, again replacing "netid" with your NetID (and do not forget the semicolon!):

      mysql> create database netid_wordpress;
      

      Because of how the GSLIS servers are set up to work, you must include your netid as a prefix for this database name. However, you can put whatever you want after the underscore. I just recommend wordpress because that is the software we are installing.

    3. Now, to exit the MySQL command line, simply type in "exit".
  10. At this point, we can essentially follow the quick-install instructions from the Wordpress website.

Submission

To turn in your assignment, please email me a link to your successful Wordpress installation.

Grading Criteria

Out of 25 points total.

  • Does it work? 25 points