|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Settig up cgi-bin on Dedicated Server w/ Apache
I need to setup a cgi-bin for my website that is on a new dedicated server I just got. I created a cgi-bin directory in /home/mydomain, but it's not visible and the files in there do not show up
What httpd.conf settings would I need in order to use a cgi-bin?Thanks, Mark
__________________
http://www.evolutionm.net |
|
#2
|
|||
|
|||
|
How do you have it layed out? I don't have a dedicated server but I have a computer I play around with on my lan and I have a both public_html and cgi-bin in my /home/matt directory. Then for my vhost in httpd.conf I have:
<VirtualHost 192.168.1.102> ServerAdmin me@hotmail.com DocumentRoot /home/matt/public_html ServerName matt.lan.com ScriptAlias /cgi-bin/ "/home/matt/cgi-bin/" </VirtualHost> That has always worked for me.
__________________
-MattWil |
|
#3
|
|||
|
|||
|
>> but it's not visible and the files in there do not show up
If you want files other than CGI scripts to show up then don't use ScriptAlias. Like I said once every two days, a ScriptAlias'ed cgi-bin can't contain anything other than true CGI scripts. You can't have the following in that cgi-bin: .htaccess banner.jpg env.php foobar.html If you don't want that tight restriction, just mkdir a cgi-bin directory under your public_html and set its <Directory> block with Options +ExecCGI. A ScriptAliased cgi-bin should have Options None and AllowOverride None. If you are on Redhat then you need to adjust that because Redhat team is still making that silly mistake repeatedly. |
|
#4
|
|||
|
|||
|
Thanks, I got the cgi-bin to work now, but I believe mod_perl is not installed as a .pl script just displays the entire text. Is there anything I need to add to httpd.conf to make it work?
Mark |
|
#5
|
|||
|
|||
|
do you have this line inside your httpd.conf file
AddHandler cgi-script .cgi .pl ? |
|
#6
|
|||
|
|||
|
>> AddHandler cgi-script .cgi .pl ?
No. mod_perl script is NOT CGI script, and you don't need to chmod it 755 and Options ExecCGI is not needed as well. When it's installed properly you just need to add: Code:
<IfModule mod_perl.c>
AddHandler perl-script .pl
PerlHandler Apache::Registry
PerlSendHeader On
</IfModule>
|
|
#7
|
|||
|
|||
|
I added that line into my httpd.conf and restarted apache, but the .pl files show up like text... they aren't executed. I must have put it in the wrong place I guess
![]() Mark |
|
#8
|
|||
|
|||
|
for mod_perl test it mkdir perl
LoadModule perl_module libexec/apache/libperl.so AddModule mod_perl.c #Alias /perl/ /var/www/htdocs/perl/ #PerlModule Apache::Registry #<Location /perl> #SetHandler perl-script #PerlHandler Apache::Registry #Options ExecCGI #allow from all #PerlSendHeader On #</Location> for cgi-bin does not require mod_perl ScriptAlias /cgi-bin/ "/var/www/htdocs/cgi-bin/" # # "/usr/local/www/cgi-bin" should be changed to whatever your ScriptAliased # CGI directory exists, if you have that configured. # <Directory "/var/www/htdocs/cgi-bin/"> AllowOverride None Options None Order allow,deny Allow from all </Directory> to test mod_perl stick this in the dir <% 2+2 %> |
|
#9
|
|||
|
|||
|
You can't put mod_perl scripts inside a ScriptAlias'ed cgi-bin.
Like mod_php, mod_perl scripts can be executed everywhere within {our docroot except a ScriptAlias'ed cgi-bin. Of course when it's configured like so: AddHandler perl-script .pl. |
![]() |
| Viewing: Dev Shed Forums > System Administration > Apache Development > Settig up cgi-bin on Dedicated Server w/ Apache |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|