mkahn has asked for the wisdom of the Perl Monks concerning the following question:

Hello Wise ones, I'd like to have the defult page from a directory point to a perl script, eg. www.any.com/directory/

I created a symbolic link from index.html to ../cgi-bin/myscript, but the mime type isn't correct, so it just dumps the text of the script to the browser. This is on a shared bsd host. Any clues?

Thanks, Mark

  • Comment on symlink mimetype agreement, apache, index.html

Replies are listed 'Best First'.
Re: symlink mimetype agreement, apache, index.html
by Zaxo (Archbishop) on Aug 23, 2002 at 23:30 UTC

    In .htaccess in the desired directory:

    DirectoryIndex ../cgi-bin/myscript.cgi

    The script will execute as if it were in the configuration directory.

    After Compline,
    Zaxo

      Thanks for replying everyone. Zaxo, Urock!
•Re: symlink mimetype agreement, apache, index.html
by merlyn (Sage) on Aug 23, 2002 at 23:28 UTC
    If the CGI area is created with a ScriptAlias, then a symlink won't work, because the mapping of URL to Filename has already happened and the "this is a CGI script" bit wasn't set.

    You have many options available to you, but they almost all depend on changing configuration settings. If you're the webmaster, you need to do some reading. If you're not the webmaster, you need to talk to the webmaster to get what you want.

    That's one of the problems of diagnosing web-related issues at places like here at the Monastery: there's just so many variations of what is going on.

    -- Randal L. Schwartz, Perl hacker

Re: symlink mimetype agreement, apache, index.html
by Popcorn Dave (Abbot) on Aug 23, 2002 at 23:10 UTC
    I don't know if this will help but here it is. :-)

    I'm currently redesigning a page that is a CGI script for the main page. When I talked to my hosting people, I was told that they had it set up to look for index.html first - I assume .htm or .html - then if that wasn't found it looked for index.whatever. This allows people to still do the www.mysite.com and for me to run something like index.cgi. I'm assuming there is soemthing they've configured in Apache - but that's only an assumption.

    Hope that steers you in the right direction.

    Some people fall from grace. I prefer a running start...