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 -> Coding & Scripting Corner View previous topic :: View next topic
Reply to topic   Topic: ScriptAliasMatch works on Apache 2.2, doesn't on Apache 2.
Author
shug94



Joined: 27 Aug 2009
Posts: 9

PostPosted: Mon 21 Sep '09 7:23    Post subject: ScriptAliasMatch works on Apache 2.2, doesn't on Apache 2. Reply with quote

I was running an Apache Server version 2.2 on Windows. I was using ActiveState Perl as my perl installation. I had some other code which was going to make a request of my IP address, and thus be requesting '/', I needed to redirect this request to a handler script.

Thus I added the following line to my httpd.conf:
ScriptAliasMatch ^/$ "C:/Program Files/Apache Software Foundation/Apache2.2/cgi-bin/SBG_ReceivedMessageListener.pl"

This now worked fine, and all was right with the world.

Then I was told that I would need to port my code to Unix, Centos in particular, and that the version of Apache on that box would be 2.0.

I altered my httpd.conf file, including altering the previous ScriptAliasMatch line so that it now says:
ScriptAliasMatch ^/$ "/var/www/cgi-bin/SBG_ReceivedMessageListener.pl"

All of my other requests now work, but this one is a problem. When I try to issue a request I get the following error in a '404 Not Found' page, 'The requested URL / was not found on this server'. I also get the following in my error_log, '[error] [client 127.0.0.1] Attempt to serve directory: /var/www/html/'.

Any ideas on how to get this to work?

Thanks a lot.
Back to top
James Blond
Moderator


Joined: 19 Jan 2006
Posts: 7371
Location: Germany, Next to Hamburg

PostPosted: Mon 21 Sep '09 11:53    Post subject: Reply with quote

I haven't tested it, but I think you have to define a ScriptAlias to cgi-bin. Which, so I think, is configured on windows.
Back to top
shug94



Joined: 27 Aug 2009
Posts: 9

PostPosted: Mon 21 Sep '09 15:53    Post subject: Reply with quote

I have the ScriptAlias command for the /cgi-bin/ directory. Other scripts I have work fine, just not the ones that are matched by the rule I described above.
Back to top


Reply to topic   Topic: ScriptAliasMatch works on Apache 2.2, doesn't on Apache 2. View previous topic :: View next topic
Post new topic   Forum Index -> Coding & Scripting Corner