Has anyone successfully altered MAMP's cgi-bin (or docroot) directories in the conf.httpd?
I'm working in MAMP and need to create an alias to my project dicectory开发者_Go百科 so that I don't have to move my code out of my IDE project and into the MAMP folder.
I've configured the conf.httpd as specified but am getting 404s and 403s.
There don't appear to be any settings in the MAMP gui settings that would alter where it points cgi-bin to and it's either simply ignoring my httpd entries or I'm declaring them incorrectly (I'm not an httpd expert).
My cgi entry looks like this:
ScriptAlias /cgi-bin/ "/full/path/to/cgi/folder"
in this case /full is my drive root (not the webserver root) though I've tried both and neither works.
Has anyone done this? I'd love to know.
I found a fix, courtesy of a Japanese website, it's sure lucky I read Japanese. Yes, you need to change the httpd.conf via the menu entry File>Edit Template>Apache>httpd.conf. The solution is not to move the existing cgi-bin folder but to add a second cgi-bin folder with a second Directory directive. This is a piece of code and the context it goes in, this works in MAMP Pro 2.05
# "/Applications/MAMP/cgi-bin" should be changed to whatever your ScriptAliased
# CGI directory exists, if you have that configured.
#
<Directory "/Applications/MAMP/cgi-bin">
AllowOverride None
Options None
Order allow,deny
Allow from all
</Directory>
# Add the following lines
# This example sets the CGI-BIN folder to a folder
# in the user's home directory Documents/MAMP_Site
<Directory "/Users/myusername/Documents/MAMP_Site">
Options ExecCGI
AddHandler cgi-script .cgi .pl
</Directory>
ok... this was painful (and idiotic).
the httpd file that's in the MAMP/conf/apache/ directory is apparently not used for anything (if it is, I can't figure out what.
You have to go into the MAMP app and select file->edit template->apache THERE you will see the actual httpd file that MAMP uses to start up and there you can set ScriptAlias as well as whatever else you want.
And it works.
精彩评论