[Za-pm] Re: apache, cgi-bin, mdk9.1

Steve Cox - dig steve at dig.co.za
Mon Jun 9 12:48:05 CDT 2003


On Sunday, 8 June 2003 18:48, you wrote:
> Okay, I hope I can make this clear enough. If you might be able to help I
> can mail my .conf files off list.
>
> I am running mdk9.1 with apache2, php, perl. Everything was working fine. I
> wanted to add other websites to dev on locally mainly, and went for the
> userdir option. I used that wiz in mandrake and things seemed to work okay.
> I have got my different websites, php works, and perl is running if I call
> the test.pl script from the cgi-bin. My problem. I have a perl script to
> search a csv file, and return the output to a html template and it worked
> b4 my change. It doesnt work now. My script keeps saying it cant open the
> csv file, which happens to be in the cgi-bin as well, at the same level at
> the script. I have been through the permissions over and over they seem
> fine. The csv file is fine. I have tried to call the csv file from the
> browser directly and I get an internal config error. I have tried with the
> csv file in the normal html page dir and I can call it fine. Put that in my
> .pl script, no go, still get that it cant open the .csv file. I have
> butchered my apache .conf files, and I just cant see what I need to change.
> If anyone has some advice or is will ing to look at my .conf files, please
> let me know.
>
> Regards
> Steve Cox.

Okay I got it to work. I have had to specify the .csv file and also the 
template the script writes to with the full path from root, which is like:
/home/aptsa/htmldocs/cgi-bin/stkdata/search.pl
/home/aptsa/htmldocs/template.html

This is not too bad, but I would prefer referring to the files with just:
/cgi-bin/stkdata/search.pl
template.html

This might be going extending the perl part a bit far, but if anyone spots 
anything obvious I would appreciate it.

Is this set in apache or where should I be looking. It is difficult with 
docroot setting which is set as /home reason being the way the different 
sites are set by users, take a look at the following snippets from the 
commonhttpd.conf file I have:

<IfModule mod_userdir.c>
    UserDir htmldocs
</IfModule>
# Start aliases
<IfModule mod_alias.c>
        Alias /icons/ /var/www/icons/
        Alias /doc /usr/share/doc
        Alias /cgi-bin/ /home/*/htmldocs/cgi-bin/
    <IfModule mod_perl.c>
        #Provide two aliases to the same cgi-bin directory,
        #to see the effects of the 2 different mod_perl modes
        #for Apache::Registry Mode
        Alias /perl/ /home/*/htmldocs/cgi-bin/
        #for Apache::Perlrun Mode
        Alias /cgi-perl/ /home/*/htmldocs/cgi-bin/
    </IfModule>
</IfModule>
# End of aliases.
# This should be changed to whatever you set DocumentRoot to.
<Directory /home>
        Options -Indexes FollowSymLinks MultiViews  ExecCGI
        AllowOverride All
        <IfModule mod_access.c>
        Order allow,deny
        Allow from all
        </IfModule>
</Directory>
<Directory /home/*/htmldocs/perl>
        AllowOverride All
        Options -Indexes FollowSymLinks MultiViews ExecCGI
        <IfModule mod_access.c>
        Order allow,deny
        Allow from all
        </IfModule>
</Directory>
<Directory /home/*/htmldocs/cgi-bin>
        AllowOverride All
        Options -Indexes FollowSymLinks MultiViews ExecCGI
        <IfModule mod_access.c>
        Order allow,deny
        Allow from all
        </IfModule>
</Directory>

Regards
Steve Cox.



More information about the Za-pm mailing list