tags:

views:

37

answers:

1

I'm using MAMP-pro to serve my domain to the outside world.

I'm not a very experienced sys-admin, though I've slogged my way through a few basic things. I know what apache is, and I can read-most-of but not generate-without-guide related .conf files.

I've got a perl script which I've tested from the command line and it works (outputs as desired.)

When I try to access said script from the browser, I get 404.

I've tried placing the script at:

  • /Users/me/Sites/mydomain.com/htdocs/mycgi.pl
  • /Users/me/Sites/mydomain.com/cgi-bin/mycgi.pl
  • /Users/me/Sites/mydomain.com/htdocs/cgi-bin/mycgi.pl

and accessing it as:

and all the various combinations, all to no avail (404.)

The script and its container directory have permissions 755.

So, what other steps am I missing? Are there any good set-up guides? I tried the MAMP-Pro manual, but it is filled with such information as "the cancel button cancels the current operation" and not really anything useful. Google turned up several hits that all seem to talk about how to make this work on localhost, but I'm trying to serve this to the outside world.

Any hints?

Thanks!

+2  A: 

The official online documentation has a section on virtual hosts. When creating a host for www.mydomain.com you can choose the DocumentRoot which is called "Disk location" within MAMP PRO. If you still get a 404 error, take a look into the error_log for a more specific reason (i.e., where Apache tries to find the file in question).

Jonas
The error log was the key, and it turns out that, despite having a document-root of /myDisk/myDomain/htdocs/, MAMP-pro was still expecting to find the script a /Applications/MAMP/cgi-bin/. I'll continue to investigate, but was hoping to have separate cgi-bin directories for each domain hosted.
Olie
Under the Hosts > Advanced menu in the "Customized virtual host general settings" box, enter something like this:ScriptAlias /cgi-bin/ /where/ever/you/want/your/cgi-bin/
Jonas