Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > Installing CGI

Installing CGI
Thread Tools
tavilach
Mac Elite
Join Date: Jan 2004
Location: Berkeley, CA
Status: Offline
Reply With Quote
Jun 26, 2006, 01:46 PM
 
I know I shouldn't do this, but since the UNIX forum is so empty and I still need help with installing CGI, I'm going to link to my post in the UNIX forum:

http://forums.macnn.com/showthread.php?t=299635

My current problem is that I don't have permission to view http://localhost/cgi-bin/.

If the post could just be moved to this forum and this one deleted, that'd be great. If not, I apologize for the rule violation.
"Give me a lever long enough and a fulcrum on which to place it, and I shall move the world." -Archimedes
     
tavilach  (op)
Mac Elite
Join Date: Jan 2004
Location: Berkeley, CA
Status: Offline
Reply With Quote
Jun 28, 2006, 11:38 AM
 
Anyone?
"Give me a lever long enough and a fulcrum on which to place it, and I shall move the world." -Archimedes
     
Phil Sherry
Dedicated MacNNer
Join Date: Nov 2004
Location: Stockholm, Sweden
Status: Offline
Reply With Quote
Jul 4, 2006, 04:37 PM
 
Open a Terminal window and do the following:

1. type: cd /Library/WebServer/CGI-Executables/
2. type: vim hello.pl
3. press i to enter insert mode
4. type: #!/usr/bin/perl
5. type: print"Content-type:text/html\n\n";
6. type: print "Hello Cleveland! \n";
7. press `esc` to exit insert mode
8. type :wq to write & quit
9. type: chmod 755 hello.pl
10. go to http://localhost/cgi-bin/hello.pl

If you don't get a 500 error, you'll see "Hello Cleveland!" and you'll be on your way to ruling the universe. If you do, then you need to configure your httpd.conf.

Oh, you don't "install CGI". You should probably do some homework as to what CGI stands for and how the basic process I talked you through actually works. Line #4 should give you a clue.
     
besson3c
Clinically Insane
Join Date: Mar 2001
Location: yes
Status: Offline
Reply With Quote
Jul 4, 2006, 05:03 PM
 
Make sure your ScriptAlias is set to your CGI-Executables in your httpd.conf, and make sure you have executable permission on your Perl script.

You can also try executing the script through the command line by moving into your CGI-Executables directory and typing:

perl hello.pl (or whatever your script is called).

This way, you'll get more verbose output and a sense of what is wrong that you won't see rendered in your web browser.

Hope this helps!
     
   
Thread Tools
 
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Top
Privacy Policy
All times are GMT -4. The time now is 04:24 AM.
All contents of these forums © 1995-2017 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.8 © 2000-2017, Jelsoft Enterprises Ltd.,