Page 1 of 1

cgi not working under Puppy

PostPosted: 16. August 2009 10:29
by tlchost
I am using PuppyLinux as a live CD. XAMPP for Linux installed and working fine.
I want to run several virtual sites and have them on my USB drive (/mnt/home).

With the following in httpd-vhosts.conf I can see the website, but when I call a cgi
Apache tells me that it either can not see the file or it does not have permissions
to run it.

<VirtualHost *:80>
DocumentRoot /opt/lampp/htdocs
ServerName localhost
ScriptAlias /cgi-bin/ "/opt/lampp/cgi-bin/"
<Directory "/opt/lampp/cgi-bin">
AllowOverride None
Options None
Order allow,deny
Allow from all
</Directory>
</VirtualHost>

<VirtualHost *:80>
DocumentRoot /mnt/home/ohsosoft/public_html
ServerName ohsosoft
ScriptAlias /cgi-bin/ "/mnt/home/ohsosoft/public_html//cgi-bin/"
<Directory "/mnt/home/ohsosoft/public_html/cgi-bin">
AllowOverride None
Options None
Order allow,deny
Allow from all
</Directory>
ErrorLog /mnt/home/logs/ohsosoft-error_log
CustomLog /mnt/home/logs/ohsosoft-access_log common
</VirtualHost>

the httpd.conf file has
ServerRoot "/opt/lampp"
Should it be different for the virtual sites?

Thanks for any assistance.
Thom

Re: cgi not working under Puppy

PostPosted: 16. August 2009 11:23
by Nobbie
>ScriptAlias /cgi-bin/ "/mnt/home/ohsosoft/public_html//cgi-bin/"

Remove one of the two slashes before cgi-bin/

And check the owner permissions of /mnt/home/ohsosoft/public_html/cgi-bin, it must be readable and executable for the Apache user.

Re: cgi not working under Puppy

PostPosted: 17. August 2009 05:05
by tlchost
Nobbie wrote:>ScriptAlias /cgi-bin/ "/mnt/home/ohsosoft/public_html//cgi-bin/"
Remove one of the two slashes before cgi-bin/
And check the owner permissions of /mnt/home/ohsosoft/public_html/cgi-bin, it must be readable and executable for the Apache user.


Removed double slash....no other changes required....As a test I copied printenv to my cgi-bin folder and it ran.

I noticed my scripts used on various servers all use /usr/bin/perl in the shebang line. Apparently xampp wants to do it another way. Since my goal is to develop locally and upload to the servers, how can I change the behavior of xampp to use /usr/bin/perl, instead of the default values?

Thanks

Re: cgi not working under Puppy

PostPosted: 17. August 2009 08:41
by Nobbie
>Apparently xampp wants to do it another way.

What does that mean?

Re: cgi not working under Puppy

PostPosted: 17. August 2009 12:12
by tlchost
Nobbie wrote:>Apparently xampp wants to do it another way.
What does that mean?


Sorry for the confusion.

The scripts supplied with xampp use this convention
#!/opt/lampp/bin/perl

Puppy has perl installed in /usr/bin/perl

Do I need to change only the shebang line in the script to use /usr/bin/perl or is there
something else I need to do ?

Thanks

Re: cgi not working under Puppy

PostPosted: 17. August 2009 12:31
by Wiedmann
The scripts supplied with xampp use this convention
#!/opt/lampp/bin/perl

Because XAMPP Perl (and all the Perl module) is installed in "/opt/lampp/bin/perl".

Puppy has perl installed in /usr/bin/perl

Fine. Now it's your decision to use XAMPP Perl or Puppy Perl (the system perl) in your cgi scripts. Apache is just using that one, what is declared in the shebang line.