Installation Instructions for Intranet software version 2.03

8/31/2003

Here are instructions for setting up a server to run the software under Mac OS X client. Instructions for other platforms will follow at some later date.

1. Install MySQL. Version 4.x of mysql has not been fully tested with this software, so you may want to use the latest 3.x version. Follow the instructions at http://www.entropy.ch/software/macosx/mysql/. Be sure to also install MYSQLStartupItem.pkg, which comes with the mysql download, if you want your database to start automatically when your server is started.

2. Install php. Follow the instructions at http://www.entropy.ch/software/macosx/php/.
You need to install both the Apache module and the CGI (command line) version. Both are available, along with installation instructions, pre-compiled for OS X at Marc Liyanage's site.
You will need to use a php.ini file that changes some of the default install options. (In particular, you need to be sure that your php.ini contains the following line: register_globals = On. The included php.ini also increases the allowable time and size for user uploads.) Copy the php.ini file that is included in the Install directory to /usr/local/php/lib. Then change the ownership and permissions:
sudo chown root /usr/local/lib/php/php.ini; sudo chmod go+r /usr/local/php/lib/php.ini

3. Enable Sendmail. Follow the instructions at http://www.macdevcenter.com/pub/a/mac/2002/09/10/sendmail.html.

4. Enable Apache. (Launch System Preferences. Click the Sharing pane. Turn on Personal Web Sharing.)

5. Move all of the contents of the Install directory into the desired location. (If you want the site to be accessible from the root directory of your webserver - i.e. if you want users to get to it by going to http://myintranet.com - then move the files into /Library/WebServer/Documents.)

6. Change the permissions of the directory containing the installed files so that it is writable by the webserver. (In the terminal: chmod a+w /Library/WebServer/Documents)

7. Move emailpost.php to /usr/adm/sm.bin. You may need to create both of these directories. (cd /usr; sudo mkdir adm; cd adm; sudo mkdir sm.bin)
Edit emailpost.php, changing the path in the marked variable at the beginning of the file to point to the directory in which you installed the php files. (If your php cgi binary is not in the location listed in the first line of emailpost.php, you will need to modify that line as well.)
Now you need to configure sendmail to execute emailpost.php when an email is received. Add the following line to /etc/mail/aliases (a file you should have created in the course of configuring sendmail as outlined by the url in step 3):
lists: |emailpost.php
You can change "lists" to any name you wish to be the address to be used by those posting a message to a messageboard by email. As you did if you set up any aliases in step 3 type the following:
sudo newaliases
or run your update script.

8. In order to have the webserver and mail services be available automatically after a reboot, edit the file /etc/hostconfig. Change the relevant lines to read:
HOSTNAME=$TheHostNameYouHaveBeenGiven
MAILSERVER=-YES-
WEBSERVER=-YES-
SSHSERVER=-YES-
where $TheHostNameYouHaveBeenGiven is, for example, amazon, if your url is amazon.com.

9. Your server is ready to go! For best results and especially if sendmail does not seem to be working, reboot the server. Point your web browser to open install.php (probably at http://127.0.0.1/install.php).

10. For Dastabase Hostname, enter localhost. For Username, enter root. For password, enter the root password you entered when you set up mysql. For Name of Main Organization, enter a short one-word name related to your overall organization (e.g., SLS for Stanford Law School or Stanford for the whole campus). Click Install. If you run into problems and have to try again, choose a slightly different Name for the main organization. This name only appears as part of various urls and is not generally seen by the users.

11. Click the link to login to the main organization and follow the instructions. Your site is up and running!

12. To back up your database, type '/usr/local/mysql/bin/mysqldump -A -u root -p > mybackup.sql'. At the prompt type the password you set when you set up mysql. To back up the installation directory and all the files uploaded by users, type 'sudo tar cf mybackup.tar PATHOFYOURINSTALLDIRECTORY'. To restore from a backup, untar the data file (tar xf mybackup.tar) and move to appropriate place. And to restore the database, type 'mysql -u root -p < mybackup.sql'. You will have to decide how best to manage backups (probably using cron) for your site.

This is the second draft of these instructions, which are still far from complete. Feel free to drop me a line with questions. christianturner@mac.com

This software is public domain.