mylinuxnotes

Thursday 20071018

LAMP Before Lunch

Filed under: Drupal, LAMP, MediaWiki, howto — jeff @ 3:31 pm

I got a lab server up and running in a couple of hours. Ubuntu is awesome! The functionality includes: LAMP, a Drupal website on the front end, a MediaWiki site for organizing the lab’s SOPs and other documents, and an SSH server so lab members can use linux bioinformatics software remotely, and stream X onto their Windoze and Mac desktops. I’m recording this here because there were a lot of unnecessary or contradictory instructions available online.

All you need: Static IP/domain name assigned (thanks to the department’s IT support), an old otherwise-useless desktop PC (a 400 MHz Dell with 256 Mb memory), and the Ubuntu (Feisty) Desktop CD (I wanted X off the bat, so didn’t use the server CD).

1. Install and update Ubuntu (took ~30 minutes)

2. Install the server software

$ sudo aptitude install apache2 firestarter openssh-server php5-mysql libapache2-mod-php5 mysql-server

3. Set up the firewall

$ sudo firestarter

Use the GUI wizard to set up iptables to allow incoming traffic on ports 22 and 80 (before you run firestarter, ALL of your ports are open by default).

4. Set up mysql to have a root password (don’t forget the semicolon at the end of every line when you are in the mysql> prompt):

$ sudo mysql -u root
mysql> UPDATE mysql.user SET Password=PASSWORD(‘your_new_password‘) WHERE User=’root’;
mysql> FLUSH PRIVILEGES;
mysql> quit

5. Install MediaWiki and Drupal.

$ sudo aptitude install mediawiki drupal-5.1

The installation will take care of all the basic database configuration. You will be asked to provide the install scripts with the mysql administrative password that you just created, and you will also be asked to create some new passwords. The email server will ask you how to set it up. Do as you wish, but personally I left email unconfigured (ie broken). This breaks the email-confirmation features of Drupal and MediaWiki, but it also is a safeguard against unwanted external users having access to an email server. :)

Now you can setup mediawiki at http://localhost/mediawiki and Drupal at http://localhost/drupal

The first thing I did was disable anonymous user account creation in both systems, since we have a small group and it’s okay if an administrator has to set up an account for new people.

Also, when someone visits the URL, at the moment they see an ugly Apache default blank screen. Yuck. To automatically forward visitors to the drupal homepage, create this file:

$ sudo gedit /var/www/index.html

And put the following code into the file:

<html>
<head>
<META http-equiv=“refresh” content=“0; URL=drupal”>
</head>
</html>

Now, when a browser visits http://YOUR.SERVER/ it will be redirected to http://YOUR.SERVER/drupal. And, of-course, if you want someone visiting your site to know how to get to the wiki, you can provide them with a link to http://YOUR.SERVER/mediawiki in your Drupal website.

Configuring and customizing Drupal is cake using your web browser. For MediaWiki, you will have to delve into the LocalSettings.php file (located in the /usr/share/mediawikiX.X directory), unless you’re okay with the default settings.

No Comments Yet »

No comments yet.

RSS feed for comments on this post. TrackBack URI

Leave a comment

Blog at WordPress.com.