代码之家  ›  专栏  ›  技术社区  ›  Yevgeny Simkin

是否有人成功地修改了MAMP的cgi-bin(或docroot)目录conf.httpd?

  •  2
  • Yevgeny Simkin  · 技术社区  · 14 年前

    我在MAMP中工作,需要为我的项目dicectory创建一个别名,这样我就不必将代码从IDE项目移到MAMP文件夹中。

    mampgui设置中似乎没有任何设置会改变它指向cgi bin的位置,它要么只是忽略了我的httpd条目,要么我错误地声明了它们(我不是httpd专家)。

    我的cgi条目如下所示:

    ScriptAlias /cgi-bin/ "/full/path/to/cgi/folder"
    

    在本例中/full是我的驱动器根目录(不是web服务器根目录),尽管我尝试了这两种方法,但都不起作用。

    有人这样做过吗?我很想知道。

    2 回复  |  直到 14 年前
        1
  •  2
  •   Charles    13 年前

    # "/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>
    
        2
  •  0
  •   Yevgeny Simkin    14 年前

    MAMP/conf/apache/目录中的httpd文件显然没有用于任何用途(如果是,我不知道是什么)。

    您必须进入MAMP应用程序并选择file->edit template->apache 在那里,您将看到MAMP用来启动的实际httpd文件,并且您可以在那里设置ScriptAlias以及任何您想要的东西。

    而且很有效。