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:
1200+ fellow developers rate and compare features of the top IDEs, like Visual Studio, Eclipse, RAD, Delphi and others, across 13 categories. Enjoy this FREE Download of the IDE User Satisfaction Study by Evans Data Corporation. Download Now!
  #1  
Old September 10th, 2001, 05:17 PM
darksoul darksoul is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2001
Posts: 3 darksoul User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Post How To Configure Apache To Let ~user Accounts To Execute Cgi Script

HI,

I am using apache on Linux Redhat 7.1 and i cant figure out how to configure apache to let URL and files like that to run as cgi scripts. I am new to apache and i couldnt figure out how to do it. I hope someone can help thank you.

Reply With Quote
  #2  
Old September 10th, 2001, 08:50 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
Please start here -> http://httpd.apache.org/docs/mod/mod_userdir.html

Assuming you can execute CGI scripts in default server without a problem. Make sure you have at least ExecCGI within the <Directory> block.

<Directory "/home/*/public_html">
AllowOverride All
Options ExecCGI
...
</Directory>

When you are comfortable with this, you can tighten it by adding:

<Directory "/home/*/public_html/cgi-bin">
AllowOverride None
Options +ExecCGI
...
</Directory>

and remove ExecCGI from <Directory "/home/*/public_html"> so that CGI scripts is allowed only in cgi-bin.

Reply With Quote
  #3  
Old September 12th, 2001, 03:45 PM
darksoul darksoul is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2001
Posts: 3 darksoul User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Firstly thanks for you time to reply.

I tried what u said. But this time it keeps giving me 500 internal server error. The cgi script was a simple one with no mistakes. And i tried it on the main apache directory. It worked fine but when i try it in ~user/cgi-bin it gives me a 500 internal server error. Would you know why?

Reply With Quote
  #4  
Old September 12th, 2001, 04:14 PM
optimised optimised is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2001
Posts: 10 optimised User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
hi darksoul,

I am also having problems with executing cgi-scripts. Are you able to execute cgi-scripts at all. I have a post here as well
subject another 505 error problem.
I am only able to run scripts from the command line for example >perl myscript.cgi
When I try to run script through browser I get internal server error. If you are able to run scripts through browser was there anything special you had to do with your httpd.conf file.

thanks optimised

Reply With Quote
  #5  
Old September 12th, 2001, 04:33 PM
darksoul darksoul is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2001
Posts: 3 darksoul User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Hi,

My document root for the server is /var/www/html and for cgi-bin it is /var/www/cgi-bin. When i put my cgi file in /var/www/cgi-bin it works fine. But when i try to run a cgi script from my user directory it doesnt work. I tried what freebsd said this time i started getting 500 internal server errors.

When i comment the AddHandle cgi-script .cgi line it shows the code when i uncomment it i get an error. So far i couldnt figure it out. If i ever get help and succeed in doing that i will let u know

P.S.: I mean URL as an example of cgi script run from the user directory.

Reply With Quote
  #6  
Old September 12th, 2001, 05:38 PM
optimised optimised is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2001
Posts: 10 optimised User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Thanks darksoul,

If I undersand you correctly you are able to run the script in your browser if the script is in your /var/www/cgi-bin directory??

Have your tried this for user..

//httpd.conf file
UserDir public_html

<Directory "/home/[a-z]+/public_html/cgi-bin">
Options ExecCGI
AddHandler cgi-script .cgi .pl
</DirectoryMatch>

Found this on the net somewhere trying to solve my problem of even getting the script to run in browser. The only info attached with this tip was remember to enter username in lowercase.

If you would like to share your httpd file my email address hometoolz@hometoolz.com

Good Luck

Reply With Quote
  #7  
Old September 13th, 2001, 01:19 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
>> It worked fine but when i try it in ~user/cgi-bin it gives me a 500

1) What's the full system path to this cgi-bin directory?
2) Is it scriptalias'ed?
3) Can you execute CGI scripts in docroot of your ~user dir like so?

/home/user/public_html/script.cgi -> http://localhost/~user/script.cgi

Reply With Quote
Reply

Viewing: Dev Shed ForumsSystem AdministrationApache Development > How To Configure Apache To Let ~user Accounts To Execute Cgi Script


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 5 hosted by Hostway