CSE 311: Lab 3: Wiki Server

Due 11:59 PM, Thursday, April 17, 2014

Introduction

In this lab, you will configure your VM to run a web server, including a wiki server. You will also need to adjust some security settings, and configure a backup of the server's contents. As with the previous lab, you will need to search the manual for some configuration options.

Picking your partner

You may do the lab alone, or with one partner. If you work with a partner, only one student will hand in the assignment for you. Be sure to list both partners' names on the handed-in assignment.

Getting started

You will use your VM from lab 2 to complete this assignment.

Hand-In Procedure

When you are ready to hand in your lab code and write-up, upload the following to blackboard under Lab 3:

Note: Within a few days, the system administration staff will clone your VM, which will temporarily take it offline.

Because cloning the VM is a somewhat involved procedure, please do not submit multiple times unless the change in your grade will be substantial.

In this and all other labs, you may complete challenge problems for extra credit. If you do this, please include in your handin text a short (e.g., one or two paragraph) description of what you did to solve your chosen challenge problem and how to test it. If you implement more than one challenge problem, you must describe each one.

This lab will be graded on a 15 point scale.

Installing Apache

You will need to begin by installing and configuring apache, via apt-get. Use version apache 2.

NB: Port 80 is blocked outside of campus. You should be able to access port 80 on your VM from any on-campus computer; if this doesn't work, use telnet to test whether the port is accessible.

Exercise 1. (2 points) Install and configure apache2. You may need to refer to the manual for the configuration parameters here.

Create a simple, personalized test page in html that you can use to test your basic configuration. Name it index.html, and access it by putting your IP address in your web browser.

Installing MediaWiki

Install and configure mediawiki. MediaWiki is the same software that runs Wikipedia. There is a manual and installation guide here.

Exercise 2. (2 points) Install and configure mediawiki.

Test that your wiki works by creating a user account and a few personalized pages.

Configuring MediaWiki

Vandalism, especially by automated scripts, is a problem for wikis. In order to protect your wiki from unauthorized edits, adding unwanted advertisements, or worse yet, malware, you should take a few simple precautions.

Exercise 3. (2 points) Configure your wiki to require a user account to edit any pages. It is fine to leave the pages readable to the public. Require an administrator to approve the account, and test that account creation works.

Exercise 4. (2 points) Configure your wiki to require a captcha in order to create an account or post and external link. Although this is not a fool-proof way to block bots, this can reduce the risk.

Exercise 5. (2 points) Verify that the wiki server can email a user a forgotten password. This should "just work", but you should confirm that it does.

Cron jobs and backup

An important part of any administrator's job is backing up a system. In the final portion of this lab, you will configure your system to back up the server's web pages and wiki contents each day. This will involve writing a few simple scripts, as well as using the cron job scheduler.

Cron is a system that allows you to schedule jobs to run at a fixed time or interval. This system is highly flexible, and you can learn more by typing man crontab. However, most Linux distributions make highly common event frequencies easy to configure. In particular, you may notice the directories: /etc/cron.daily, /etc/cron.hourly, /etc/cron.weekly, and /etc/cron.monthly. If you put a script in one of these directories, it will automatically run at the appropriate interval. NB: Scripts in these directories must have the executable bit set (see man chmod) and cannot have an extension.

In general, the output of a cron script is emailed to root---a valuable setting when a backup job fails. For the purposes of debugging, I would have your backup script print a message on success and confirm that you get this email, and then have the system only email on failure. Note that you can also run these scripts by hand for testing.

Exercise 6. (5 points) Configure your system to back up the contents of your web site and the wiki database on a daily basis; ensure that you receive email if something goes wrong. You are welcome to use one of the scripts provided by mediawiki to dump the database, although you may need to modify it somewhat.

Although a full-fledged backup system would backup to a remote system, say over NFS, for now you may create a directory named /mnt/backup, which you write your backups into.

Challenge! (5 bonus points) Extend your backup script to keep incremental backups, similar to Apple's Time Machine. A utility called rdiff-backup is useful for this task.

This completes the lab. Hand in the assignment as explained above. The system staff will clone your VM a few days after you hand in the assignment via blackboard, which temporarily takes the VM offline. After the VM is cloned for grading, you may use it to complete lab 4.


Last updated: 2014-05-09 22:40:26 -0400 [validate xhtml]