logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in RSS X


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
Post new topic   Forum Index -> Apache View previous topic :: View next topic
Reply to topic   Topic: Apache config problem--won't serve up CGI
Author
ajfbiz



Joined: 24 Jan 2013
Posts: 5
Location: USA, Ronan

PostPosted: Fri 25 Jan '13 1:18    Post subject: Apache config problem--won't serve up CGI Reply with quote

Dear Forum,
I have installed Apache 2.0.64(Win32) and after repeated tries at adjusting the httpd.conf file, it still is refusing to serve up CGI. So far I have, following the Apache documentation, set my designated CGI directory with AddHandler directive, Option +ExecCGI enabled. Also have added the ScriptAlias directive as per instructions. These directives
should work in conjuction with modules mod_alias and mod_cgi, both of which I have made sure were set to be loaded.
The log files show no errors. There are no syntax errors being pushed out at start-up. The server stops and starts upon commands, with no problems,
so i can't think of anything else I should be doing.

I will post some excerpts from my httpd.conf in the pastebin as soon as it gets up & running--right now the authentication icon is missing.

I have Active Perl 5.16 running on this machine, but my Apache download is
the binary without SSL and with msi installer.

Anybody got a clue?

Thanks,
Alan
Back to top
glsmith
Moderator


Joined: 16 Oct 2007
Posts: 2268
Location: Sun Diego, USA

PostPosted: Fri 25 Jan '13 5:44    Post subject: Reply with quote

I only know of one Ronan in the US, how are things at the bottom of the Mission Mountains?

As for your problem, you should not need ExecCGI if the script is inside a ScriptAlias'd directory.

As for your AddHandler, the one way down the httpd.conf file is;

# To use CGI scripts outside of ScriptAliased directories:
# (You will also need to add "ExecCGI" to the "Options" directive.)
#
AddHandler cgi-script .cgi

So I wonder, is your script file named .pl or .cgi?

Regardless, any file inside a SriptAlias'd directory should just work, as long as the shebang is correct, which by default for ActivePerl is

for 32 bit ActivePerl
#!c:/perl/bin/perl

for 64 bit ActivePerl
#!c:/perl64/bin/perl

both http://apache.pastebin.ca/ and http://pastebin.com/ are working at this time for me
Back to top
ajfbiz



Joined: 24 Jan 2013
Posts: 5
Location: USA, Ronan

PostPosted: Fri 25 Jan '13 6:16    Post subject: Reply with quote

Ronan is awesome...very mild winter, so far. Of course not so much sun as San Diego. Ah, well....

I have posted some excerpts from my httpd.conf ... http://apache.pastebin.ca/2307058

I do have the AddHandler cgi-script .cgi .pl .... so both should execute.

Adjusted shebangs to: #!/Perl/bin/perl .... BUT they
do not have the "C:" .... trying that ....Nope, that
made no difference.

Any more ideas??

Alan
Back to top
glsmith
Moderator


Joined: 16 Oct 2007
Posts: 2268
Location: Sun Diego, USA

PostPosted: Fri 25 Jan '13 7:36    Post subject: Reply with quote

I miss the Flathead and all the lakes, Whitefish, Tally, McDonald in the Park. The only time I remember sun during the winter up there was when it would go well below 0, or the day after a fresh snow Very Happy

Anyhow, I wonder if your confusing Apache, your config is confusing me. I do see mod_perl is involved here.

Oh look at that, this might be the problem as well since it can cause weird (read unwanted) results.

ScriptAlias /cgi-bin/ "C:/cgi-bin"
Alias /perl/ C:/perl

Alias' have a oddity to them in that both sides of the equation must have the same amount of /s

ScriptAlias /cgi-bin/ "C:/cgi-bin"

So it needs to be either
ScriptAlias /cgi-bin/ "C:/cgi-bin/"
or
ScriptAlias /cgi-bin "C:/cgi-bin"

same deal with the /perl alias

I'd also try going back to
<Directory "C:/cgi-bin">
Options None
AllowOverride None
Order allow,deny
Deny from all
</Directory>

And on line 11 there's a

ddHandler cgi-script .cgi .pl

copy & paste error in pastebin?

That said, why 2.0.64?

If you insist on this version you might want to add mod_rangecount! Without it, I have a script you could run from command-line on a remote computer that would bring down not only Apache, but the entire computer along with it. It's just the worst of the numerous vulnerabilities in 2.0.64.
http://people.apache.org/~gsmith/httpd/binaries/modules/mod_rangecnt-improved/apache_2.0.x-mod_rangecnt.zip

EDIT: mod_antiloris too
https://www.apachehaus.net/modules/Apache%202.0.x%20Modules/mod_antiloris-0.4-2.0-x86.zip
Back to top
ajfbiz



Joined: 24 Jan 2013
Posts: 5
Location: USA, Ronan

PostPosted: Fri 25 Jan '13 9:42    Post subject: Reply with quote

Incorporated the changes you suggested, but still not working.

Yes "ddHandler" was a cut-paste error.

So, I did not know about that vulnerability of 2.0.64, therefore I think I'd opt to un-install it all & go to an earlier version.

Thanks... I'll let you know after the change of version.

Alan
Back to top
glsmith
Moderator


Joined: 16 Oct 2007
Posts: 2268
Location: Sun Diego, USA

PostPosted: Fri 25 Jan '13 13:10    Post subject: Reply with quote

These vulnerabilities like any software are in prior versions as well. They've been fixed in the 2.2 versions if they applied to begin with, and that one did.

I'd suggest the 2.2.23 from here or ApacheHaus. There's a mod_perl for 2.2.x w/ ActivePerl 5.16 here. There's no installer, but it's so simple there is really no need for an installer to install Apache.
Back to top
ajfbiz



Joined: 24 Jan 2013
Posts: 5
Location: USA, Ronan

PostPosted: Sat 26 Jan '13 0:01    Post subject: Reply with quote

Thanks for that advice. I did get 2.2.22. It is now up and running....same behavior: no errors being logged....no syntax errors upon restart.

There is obviously something yet to be done for CGI, and if someone wants to look at my new config file excerpts, I've updated the post: http://apache.pastebin.ca/2307351

I'd sure like to solve this.


Alan
Back to top
CamaroSS



Joined: 24 Jan 2013
Posts: 78
Location: RF, Tver

PostPosted: Mon 28 Jan '13 10:29    Post subject: Reply with quote

Did you read this:
http://httpd.apache.org/docs/current/howto/cgi.html
You can also verify if CGI module was loaded using
httpd.exe -t -D DUMP_MODULES
Also check permissions on files that must be executed, and look through OS and Apache logs.
Back to top


Reply to topic   Topic: Apache config problem--won't serve up CGI View previous topic :: View next topic
Post new topic   Forum Index -> Apache