Installing Unix-SPIRES on a MacOSX system is fairly easy from Open-Source.
Activating a Web Server on your MacOSX system is also very easy:
Launch "System Preferences..." from the Apple menu, and choose "Sharing".
Unlock that page if necessary (see the lock at the bottom left). If it
is locked, click on the lock icon to unlock it. You'll be asked for your
authorization (Administrator password). Then click on "Web Sharing".
That should start it. If it does, you'll be shown two URL's at the bottom
of the page. One has your ~username, the other doesn't. These two URL's
are what I call your personal and public URL's. Both are accessible from
the Web or by yourself internally. The difference between them has to do
with what executes where. We'll cover that later.
IMPORTANT! The rest of this page only applies to Mac OSX prior to Leopard.
If you are on Leopard (or later), then click on this Leopard Version link.
If Web Sharing doesn't start, you have a problem with the config
file, which is located at: /etc/httpd/httpd.conf (Make a note of this).
If you started your web server, you need to shut it down to make changes.
Again, with "System Preferences...Sharing", click on the choice box for
"Web Sharing" (if it isn't already checked), and "Stop" it. You
are doing this so you can alter the /etc/httpd/httpd.conf file. There are
some things that need to be "activated" to be able to handle scripts.
Once you've shut down the web server, quit from System Preferences...
Now launch Terminal.app to enter your Unix environment. What happens
next depends upon what text editors you have available. Although "vi"
may seem difficult to use, I prefer it because of its simplicity.
You could use "emacs" or "bbedit" instead of vi. It is your choice.
You can launch vi from inside of Terminal.app, like this:
sudo vi /etc/httpd/httpd.conf
You will have to enter your Admin password because this file is owned by "root".
You navigate with four keys: "return" to move down a line; "space" to move
right; "-" to move up a line; and "h" to move left. You can use /text to
search forward for particular text. Lastly, you delete a character by
positioning on it and typing "x". It's really that simple.
There are several lines that are "comments" that need to be uncommented.
Comment lines have a pound-sign (#) in column 1. The following need to
be uncommented, and are shown below in their uncommented state:
LoadModule env_module libexec/httpd/mod_env.so
---
LoadModule perl_module libexec/httpd/libperl.so
LoadModule php4_module libexec/httpd/libphp4.so
---
AddModule mod_env.c
---
AddModule mod_perl.c
AddModule mod_php4.c
---
AddType text/html .shtml
AddHandler server-parsed .shtml
Ignore the --- lines, they only indicate intervening stuff.
Be sure to "Save" your changes. In vi, do that with ":wq".
Basically you are activating the env, perl, and php4 modules, and you
are allowing the Apache server to deal with include files that end in
the .shtml suffix. All of this is documented on web pages like these:
http://www.macdevcenter.com/pub/a/mac/collections/webserving.htmlThe "Apache Web Serving with Jaguar..." pages are particularaly good. Anyway, back to /etc/httpd/httpd.conf modified by "vi". You should save back the modified code with ":wq" which both saves and quits. You should now be back in Terminal.app with a standard prompt line. As a measure of safety, I STRONGLY RECOMMEND you do the following, especially if you were unable to start the Web Server. httpd -V httpd -t The first gives you a lot of information about the Web Server. The second checks the config file, to make sure you didn't mess it up. If you did mess it up, "sudo vi" it again until you get it right. ===== Alternative Method for changing httpd.conf ===== You can copy the following script to a file, make it executable, and execute it. Sample instructions are shown AFTER the script. ===== Copy the script below to your clip-board ===== #!/bin/bash if [ -f "/etc/httpd/httpd.conf" ]; then myed=`which ed | grep '/ed'` if [ -n "$myed" ]; then sudo ed /etc/httpd/httpd.conf <<EOF /LoadModule env_module/ s'#'' /LoadModule perl_module/ s'#'' /LoadModule php4_module/ s'#'' /AddModule mod_env\.c/ s'#'' /AddModule mod_perl\.c/ s'#'' /AddModule mod_php4\.c/ s'#'' /AddType.*\.shtml/ s'#'' /AddHandler.*\.shtml/ s'#'' w q EOF else echo "No editor" fi else echo "No httpd.conf" fi ===== Copy the script above to your clip-board ===== Do NOT include the ===== lines in your copy, just what is between them. Then, In Terminal.app, paste the copied script in response to the 'cat'. % cat - >myscript - - - paste at this time - - - - - - terminate with Ctrl-D (^D). % chmod 755 myscript % ./myscript Be prepared to enter your Administrator's Password. Also, be sure your copied/pasted text has everything beginning in column 1. In particular, the #!/bin/bash line and the EOF line must be in column 1. Good Luck.Continue to next part
Click on this link to return to the main SUSPIRES index.