tags:

views:

32

answers:

2

I have a CGI script (pwyky) that I called index.cgi, put in directory wiki/, and setup Apache to call localhost/wiki/index.cgi when I access localhost/wiki.

I'm getting errors when I'm trying to use this application -- it creates a page with links like "http://localhost/wiki/@edit/index", but when I click that link, Apace is trying to serve "wiki/@edit/index" as a file. I suspect that I need to get Apache to pass /@edit/index into index.cgi.

In particular, looking through index.cgi, its looking for strings like "@edit" in REQUEST_URI environment variable.

Any idea how to fix this?

A: 

You'd need to show your apache configuration to say for certain, but it seems that Apache isn't actually using mod_cgi to serve the index.cgi script. In your configuration there should be something like 'LoadModule mod_cgi'. It should be uncommented (i.e., it shouldn't have a '#' at the beginning of the line).

If you want to test this, then write a 'Hello World' cgi script and put it (temporarily) in place of index.cgi and see if you can get that to run. Let us know the results.

jonesy
CGI script runs, but I get "page not found" errors, which I think is because the script expects Apache to interpret URL's like "http://localhost/wiki/@edit/index" as calls to "wiki/index.cgi" script
Yaroslav Bulatov
How do you know the cgi runs? If you get a 'page not found' error, that's probably generated by *apache*, and not the cgi, in which case the cgi is never being called (either that, or I need more information to decipher otherwise). The other possibility is you need a more robust expression to tell apache to send '/wiki/*' to your index.cgi (but this should not normally be necessary).
jonesy
Because when I go to localhost/wiki it gives me wiki front-page (generated by script in wiki/index.cgi)
Yaroslav Bulatov
A: 

I found the problem, it turned out this is done through RewriteEngine. Pwyky puts .htaccess file in the directory with all the settings for RewriteEngine, but because AllowOverride is "None" by default on MacOS, they were ignored. The solution was to change all "AllowOverride" directives to "All"

Yaroslav Bulatov