Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

html file within cgi-bin 1

Status
Not open for further replies.

meriwether

Programmer
Mar 7, 2003
23
US
I have a html file in the cgi-bin that won't server. cgi files server, but not this html file. how can i get this html page to server? i know it's possible, but no idea where to start. can't find much on this online! thanks for any assitance.

it gives me a permission-like error;
Premature end of script headers: test.html

far as permissions;
chmod 755 test.html

is this a scriptalias issue, how to get HTML into this?

thanks.
 
why do you have an html file in your cgi-bin directory?

anyway, the very firsts line of the exit of the script should be "Content-type: text/html"...
 
i'm migrating a site from one server to another, it was in there and is referenced via links throughout the site, so i don't want to move it and have to change all the links that point to it. it worked on the old server, won't work on the new, and the httpd.conf files do not help me out.

it's just a plain-old html file, i just have no idea what is up! :(
 
old server is linux on a raq3, not sure what version.

new server is linux 2.4.21-9.0.1.ELsmp
 
and apache versiones?

cgi-bin should content only cgi files, not html...
 
In httpd.conf you will notice that you cgi-bin is defined with the directive ScriptAlias. ScriptAlias does two things. It tells apache to "pretend" that the cgi-bin is inside the DocumentRoot. The second thing it does is to tell apache to treat EVERYTHING in that directory as a script. It will try to parse the html file as an executable script and it will contain none. This is why Chacalinc says you shouldn't have html inside your cgi-bin. You can however make a directory that may contain both. Basically what you do is create a directory for this evil mix. Now you need to create a Directory container for it. Rather than ScriptAlias the directory, what you would do is use the directive "Options +ExecCGI". You will also want to make sure that this directive is difined in the global section: AddHandler cgi-script cgi pl. This tells apache that anything with the .cgi or pl extension is a cgi script. Don't forget to restart apache after you edit httpd.conf.
 
thank you, i will look into this and give it a shot. appreciate the help.
 
well, i couldn't get it to work out, though it seems like in some cases it may. not quite sure why it did not in my case.

i figured i'd wrap the html file into a cgi script and change the links that pointed to it... a little more work, but probably better off in the long haul...

thanks for the assitance, it is much appreciated.
 
I don't know why it didn't work either 'cuz I wasn't there. If you need to use cgi-bin because of link issues, then change the ScriptAlias directive for it to Alias. Then inside the cgi-bin container use this directive:

Options +ExecCGI

If you already have an Options directive in there, add the +ExecCGI directive to the end of the line. Look for a line in the main section of httpd.conf that looks like this:

#AddHandler cgi-script cgi pl

If you find it, uncomment it by removing the '#'. If it's not there, just add it anywhere in the globals (not in a container). I know I'm not adding anything new but I just wanted to double check to see if you did everything. I don't want you to take away my star.


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top