Apache Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsSystem AdministrationApache Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old February 9th, 2002, 06:07 PM
LancerForums LancerForums is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2001
Posts: 39 LancerForums User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 8
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

Reply With Quote
  #2  
Old February 9th, 2002, 09:01 PM
MattWil MattWil is offline
YaBN (Yet another BSD Newbie)
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2001
Posts: 74 MattWil User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 8
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

Reply With Quote
  #3  
Old February 10th, 2002, 04:59 AM
freebsd freebsd is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2001
Posts: 5 freebsd User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
>> 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.

Reply With Quote
  #4  
Old February 10th, 2002, 10:56 AM
LancerForums LancerForums is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2001
Posts: 39 LancerForums User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 8
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

Reply With Quote
  #5  
Old February 10th, 2002, 11:16 AM
nuno nuno is offline
I FreeBSD therefore I Am
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2002
Posts: 30 nuno User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 10 m 12 sec
Reputation Power: 7
do you have this line inside your httpd.conf file
AddHandler cgi-script .cgi .pl ?

Reply With Quote
  #6  
Old February 10th, 2002, 05:52 PM
freebsd freebsd is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2001
Posts: 5 freebsd User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
>> 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>
so it's handled by .pl extension and you can run it from anywhere within your docroot.

Reply With Quote
  #7  
Old February 11th, 2002, 04:36 PM
LancerForums LancerForums is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2001
Posts: 39 LancerForums User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 8
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

Reply With Quote
  #8  
Old February 11th, 2002, 06:16 PM
Bob Loblaw Bob Loblaw is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2001
Posts: 174 Bob Loblaw User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 7
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 %>

Reply With Quote
  #9  
Old February 11th, 2002, 10:32 PM
freebsd freebsd is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2001
Posts: 5 freebsd User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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.

Reply With Quote
Reply

Viewing: Dev Shed ForumsSystem AdministrationApache Development > Settig up cgi-bin on Dedicated Server w/ Apache


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway
Stay green...Green IT