Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

kgarner

macrumors 68000
Original poster
Jan 28, 2004
1,512
0
Utah
I hope someone can clear this up for me. I have been following the WebServing with Jaguar Series at MacDevCenter.com so that I can start learning PHP and MySQL. Anyway, I got everthing turned on right for SSI and could use includes when working from the /Library/WebServer/Documents folder.

The problem is I want to keep everything in my Sites folder. So I configured my User configuration file (shortname.conf) according to the article using these settings:

<Directory "/Users/shortname/Sites/">
Options Includes Indexes Multiviews
AllowOverride None
Order allow,deny
Allow from all
</Directory>

ScriptAlias /~shortname/cgi-bin/ "/Users/shortname/Sites/cgi-bin/"

And I copied my index.shtml file from the /Library/WebServer/Documents folder to my Sites folder. The index.shtml file contains the following:

<html>
<body>
<h1>Served By Panther, Mac OS X 10.3</h1>
<pre>
<!--#include virtual="/cgi-bin/test-cgi"-->
</pre>
</body>
</html>

I moved the test-cgi script to the cgi-bin folder I created in my Sites folder and tried it out.

I see the Served by Panther line, bu the test-cgi is not shown and I don't get any errors. I have tried <!--#include virtual="/~shortname/cgi-bin/test-cgi"--> but to no avail. Any ideas?
 

tomf87

macrumors 65816
Sep 10, 2003
1,052
0
In your /etc/httpd/httpd.conf file under the ScriptAlias, you need to have:

<Directory "/Users/shortname/Sites/">
Options Includes Indexes Multiviews
AllowOverride None
Order allow,deny
Allow from all
</Directory>

ScriptAlias /~shortname/cgi-bin/ "/Users/shortname/Sites/cgi-bin/"

<Directory "/Users/shortname/Sites/cgi-bin/">
Options ExecCGI
AllowOverride None
Order allow,deny
Allow from all
</Directory>
 

kgarner

macrumors 68000
Original poster
Jan 28, 2004
1,512
0
Utah
In case anyone else is having a similar problem, here is what I did. The steps in the article were almost right. You do need to put those entries in your /etc/httpd/users/shortname.conf file. Also you do need to add the other <Directory ...> that tomf87 suggested. Here is what I put in my .conf file.

<Directory "/Users/shortname/Sites/">
Options Includes Indexes Multiviews
AllowOverride None
Order allow,deny
Allow from all
</Directory>

ScriptAlias /~shortname/cgi-bin/ "/Users/shortname/Sites/cgi-bin/"

<Directory "/Users/shortname/Sites/cgi-bin/">
Options None
AllowOverride None
Order allow,deny
Allow from all
</Directory>

Basically I copied the <Directory>, the ScriptAlias, and the ScriptAlias <Directory> from the /etc/httpd/httpd.conf file, and then I modified them with the proper file path.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.