Go Back   CodingForums.com > :: Server side development > Apache configuration

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 08-20-2012, 08:27 PM   PM User | #1
wylie233
New Coder

 
Join Date: Jul 2012
Location: UK
Posts: 38
Thanks: 1
Thanked 0 Times in 0 Posts
wylie233 is an unknown quantity at this point
having trouble setting up Apache with CGI on Mac

Hello!

Latley i have been trying to set up CGI on my Mac, so i followed these instructions: http://www.cgi101.com/book/connect/mac.html
everything was perfect. I could see no worries about "ooh, maybe i have done that bit wrong", i was quite sure i got it right!
so when i went to "localhost/~casparwylie/first.cgi
it did NOT display how i wanted it to, it looked like a txt file of the code, the perl code was just displayed on the browser without it responding as an actual program, i am stumped. How do i fix this? if you have any questions, or requests to see code, etc, please ask!

Thanks!
wylie233 is offline   Reply With Quote
Old 08-20-2012, 09:27 PM   PM User | #2
Fou-Lu
God Emperor


 
Fou-Lu's Avatar
 
Join Date: Sep 2002
Location: Saskatoon, Saskatchewan
Posts: 15,741
Thanks: 4
Thanked 2,465 Times in 2,434 Posts
Fou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to all
Did you restart apache after setting the configs for the cgi-script addhandlers? Also, you'll want to verify that it's not within a directory block in the httpd.conf; used to require a cgi-bin in order to run cgi scripts.
Fou-Lu is offline   Reply With Quote
Old 08-20-2012, 09:49 PM   PM User | #3
wylie233
New Coder

 
Join Date: Jul 2012
Location: UK
Posts: 38
Thanks: 1
Thanked 0 Times in 0 Posts
wylie233 is an unknown quantity at this point
i am told on the site, i need to turn web sharing on, yes i did that. ANd
Quote:
you'll want to verify that it's not within a directory block in the httpd.conf; used to require a cgi-bin in order to run cgi scripts.
what do you mean??
Thanks!
wylie233 is offline   Reply With Quote
Old 08-21-2012, 05:16 PM   PM User | #4
Fou-Lu
God Emperor


 
Fou-Lu's Avatar
 
Join Date: Sep 2002
Location: Saskatoon, Saskatchewan
Posts: 15,741
Thanks: 4
Thanked 2,465 Times in 2,434 Posts
Fou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to all
If its within a <Directory> block, it should only apply for children of that directory.

Which reminds me though, did you make sure you added the ExecCGI option to a valid directory block?

Yeah, the sharing will need to be on since you are retrieving from the ~ of the user's specified, so you need to have the proper permissions set for the apache user to read and possibly write to those directories. I assume that the mac sharing simply adds the group to the permissions in order to do so (I haven't a clue how the mac works).
Fou-Lu is offline   Reply With Quote
Old 08-21-2012, 05:40 PM   PM User | #5
wylie233
New Coder

 
Join Date: Jul 2012
Location: UK
Posts: 38
Thanks: 1
Thanked 0 Times in 0 Posts
wylie233 is an unknown quantity at this point
interesting, yes my <Directory> has the ExecCGI stuff, i did that!
I am not sure if you know what i mean by "xampp" but i have that for privious stuff (PHP, SQL), and when i had that running and the web sharing on, the file said "Access forbidden!", so yes, when i have apache running through Xampp, that happens, when i only have WEb sharing on, it just displays the perl files code as if it was a txt file showing on a browser, oh another thing, this might be pointless and irrelevant, but the icon on the cgi file displays as a Ruby file??! anyway, thats just a thing that might help..
wylie233 is offline   Reply With Quote
Old 08-21-2012, 07:02 PM   PM User | #6
Fou-Lu
God Emperor


 
Fou-Lu's Avatar
 
Join Date: Sep 2002
Location: Saskatoon, Saskatchewan
Posts: 15,741
Thanks: 4
Thanked 2,465 Times in 2,434 Posts
Fou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to all
Wait. So you have both apache and xampp running? You can't do that; both of these by default will require port 80, and whichever one gets it first is the one that wins.
Fou-Lu is offline   Reply With Quote
Old 08-21-2012, 07:48 PM   PM User | #7
wylie233
New Coder

 
Join Date: Jul 2012
Location: UK
Posts: 38
Thanks: 1
Thanked 0 Times in 0 Posts
wylie233 is an unknown quantity at this point
Yes, but i use xampp to run Apache, any way, neither work, so when i try web sharing it shows the perl code as raw text, and when i use xampp to run apache, it says "Access forbidden!"
wylie233 is offline   Reply With Quote
Old 08-22-2012, 05:24 PM   PM User | #8
Fou-Lu
God Emperor


 
Fou-Lu's Avatar
 
Join Date: Sep 2002
Location: Saskatoon, Saskatchewan
Posts: 15,741
Thanks: 4
Thanked 2,465 Times in 2,434 Posts
Fou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to all
You cannot run 2 pieces of software that listen on the same port at the same time. If you do, the first one that gets the port will win, which means that the configurations associated with that software are what is used. So you are likely seeing an in-configured version of the apache running the perl scripts which is not set to parse them.
There is no reason to install multiple versions though. xampp is simply a bundle of software, and it does include apache. If you are trying to manually configure a second install of apache, this needs to be run on a different port if you intend to use them both at the same time. I don't know why you would do that though, you can just configure apache or xampp's apache to deal with the perl code as well.
Fou-Lu is offline   Reply With Quote
Old 08-22-2012, 08:43 PM   PM User | #9
wylie233
New Coder

 
Join Date: Jul 2012
Location: UK
Posts: 38
Thanks: 1
Thanked 0 Times in 0 Posts
wylie233 is an unknown quantity at this point
Ok, so what do i need to do?
wylie233 is offline   Reply With Quote
Old 08-23-2012, 12:32 AM   PM User | #10
Fou-Lu
God Emperor


 
Fou-Lu's Avatar
 
Join Date: Sep 2002
Location: Saskatoon, Saskatchewan
Posts: 15,741
Thanks: 4
Thanked 2,465 Times in 2,434 Posts
Fou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to all
If it was me, I'd remove xampp. But that said I've never used lamp/wamp/xampp before either, I've always configured each component separately.
Or you can configure it to listen on a different port in httpd.conf than port 80. Only difference is you'll need to either establish port forwarding or simply add the port to your address (http://127.0.0.1:8088/yourpaths) for example.
Both are feasible, but I would say multiple versions of apache will just result in multiple pieces of software to keep track of and update. That's why I'd just use the one.
Fou-Lu is offline   Reply With Quote
Old 08-23-2012, 09:48 AM   PM User | #11
wylie233
New Coder

 
Join Date: Jul 2012
Location: UK
Posts: 38
Thanks: 1
Thanked 0 Times in 0 Posts
wylie233 is an unknown quantity at this point
Quote:
Originally Posted by Fou-Lu View Post
If it was me, I'd remove xampp. But that said I've never used lamp/wamp/xampp before either, I've always configured each component separately.
Or you can configure it to listen on a different port in httpd.conf than port 80. Only difference is you'll need to either establish port forwarding or simply add the port to your address (http://127.0.0.1:8088/yourpaths) for example.
Both are feasible, but I would say multiple versions of apache will just result in multiple pieces of software to keep track of and update. That's why I'd just use the one.
When you say multiple versions, thats web sharing and Xampp, right?
would this really matter even if i turn one off and the over on, like i have been doing?
wylie233 is offline   Reply With Quote
Old 08-23-2012, 07:17 PM   PM User | #12
Fou-Lu
God Emperor


 
Fou-Lu's Avatar
 
Join Date: Sep 2002
Location: Saskatoon, Saskatchewan
Posts: 15,741
Thanks: 4
Thanked 2,465 Times in 2,434 Posts
Fou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to all
I mean multiple versions of the same software. If web sharing uses apache, then yeah its conflicting with xampp.
But its not just the same apps that can conflict. You cannot run multiple pieces of software listening on the same port.
Fou-Lu is offline   Reply With Quote
Old 08-23-2012, 09:52 PM   PM User | #13
wylie233
New Coder

 
Join Date: Jul 2012
Location: UK
Posts: 38
Thanks: 1
Thanked 0 Times in 0 Posts
wylie233 is an unknown quantity at this point
ok, so what should i do?
wylie233 is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 09:43 PM.


Advertisement
Log in to turn off these ads.