Oh my ****ing god. HORRENDOUS.
Basically, I'm required for a college class to do a survey for a sociology essay. I had this somewhat pipe-dreamish idea of doing this online by way of HTML form that would be filled out and emailed to me, which ought not be difficult until you get into the whole CGI ****.
I'm trying to do this from my mac, i.e. I've enabled 'personal web sharing' and my mac, which has Apache installed for its web serving function, is going to serve the pages and ****. In order to test out this idea, I found some free code from one site (a HTML page with a form on it, and an apparently "all-purpose" CGI file to process it) to try it out. Made a couple of modifications to the HTML to make it specific to my setup, and dumped them into my "server" and all looked good.
Except Apache's default configuration doesn't allow CGI. It has the capabilities, but it's not set that way as default. This means the HTML form loads fine, but when it's submitted and tries to run the CGI, I get this message:
Quote:
Method Not Allowed
The requested method POST is not allowed for the URL /~jayne/cgi-bin/index.cgi.
|
I've been through the Apache manual and made changes to the httpd.conf file to allow this. I've also been to a number of other websites and tried their advice, which recommend various things but mostly the same as the Apache manual.
So I'll try to explain my setup.
**** gets served from this directory
Aenima/Users/jayne/Sites/ and are accessed by
http://{my IP address}/~jayne/
The HTML form is called
quiz.html and is in the directory I mentioned earlier, so
Aenima/Users/jayne/Sites/quiz.html. It accessed at
http://{my IP address}/~jayne/quiz.html
The opening form tag in quiz.html is this:
Quote:
|
<FORM METHOD="POST" ACTION="/~jayne/cgi-bin/index.cgi">
|
The CGI file is called
index.cgi and lives in
Aenima/Users/jayne/sites/cgi-bin/. When the HTML form is submitted, it's shooting for
http://{my IP address}/~jayne/cgi-bin/index.cgi
And that's when I get the 405 error.
I enabled CGI in the httpd.conf file for the main directory (
Users/*/Sites/) and I'm not sure if this just applies to subdirectories or if this would actually need to be done for
Users/*/Sites/cgi-bin/, or some other directory.
So if anyone knows a bit about this and can see anything fundamentally wrong above, pls tell me what it is b/c I'm just not getting it. This is probably a good time to mention I'm an absolute noob at all of this, and I've spent about 3 hours getting to this point. I think the HTML form and CGI should be fine, since they've been lifted from elsewhere, so I'm thinking it's more of a server configuration problem.
I might just give up and do a paper survey at this rate.