|
|
|
|
||||||
| alt.apache.configuration Apache web server configuration issues. |
![]() |
|
|
LinkBack | Outils de la discussion |
|
|
#1 |
|
Messages: n/a
Hébergeur: |
Hi,
I am trying to setup a cgi-bin for a virtual host... the cgi-bin is below the public_html folder and i have followed various instructions re. file permissions, etc but running a simple .pl of .cgi script causes the following error: [Thu Feb 15 17:43:38 2007] [error] [client 81.149.XX.XX] (8)Exec format error: exec of '/var/www/html/www.vegasradio.co.uk/cgi-bin/ first.cgi' failed [Thu Feb 15 17:43:38 2007] [error] [client 81.149.XX.XX] Premature end of script headers: first.cgi The permissions on the cgi-bin folder are 777 and on the first.cgi file are 755 I have uncommented this line from my httpd.conf file AddHandler cgi-script .cgi and this section is contained in the <VirtualHost> container <Directory /var/www/html/www.vegasradio.co.uk/cgi-bin/> Order allow,deny Allow from all Options ExecCGI Indexes AddHandler cgi-script .cgi </Directory> ScriptAlias /cgi-bin/ /var/www/html/www.vegasradio.co.uk/cgi-bin/ I have tried adding all this manually and via webmin...it still doesn't work. When I try to run the cgi program at the command line I get the following error message ../first.cgi: line 3: print: command not found The location of perl (referred to in first.cgi) is correct I am now at the point where I have found 2 different pieces of information and am not sure what to do.... the first relates to OpenBSD (I'm on Centos4) and mentions apache as being chroot(2) ed... the second is in the webmin book and mentions suexec Can anyone advise me as to how I might get my virtual host cgi-bin up & running? Thanks! Brian |
|
|
|
#2 |
|
Messages: n/a
Hébergeur: |
ok, i went down the suexec route (using the webmin guide) and i now
have the situation where I get the Internal Server Error 500...upon examing the suexec_log where the messages are 2007-02-15 18:30:45]: uid: (501/vegasradio) gid: (502/502) cmd: first.cgi this happens once for each click... any ideas? thanks |
|
|
|
#3 |
|
Messages: n/a
Hébergeur: |
i've also tried creating a folder under the default cgi-bin, with
owner and group set accordingly for the folder and file with the same result as the previous post... i still can't execute at the command line |
|
|
|
#4 |
|
Messages: n/a
Hébergeur: |
problem solved (finally)... the suexec route was working fine...
I also had my first.cgi program in ascii mode but unfortunately the website where i copied my perl "hello worl" program from had an error in it (ARGGHHHH!!) no ";" at the end of the 2nd line!!!! I discovered this by using the vi editor and adding -w to #!/usr/bin/ perl which presumably makes it a bit more verbose in error reporting... the log files then showed a syntax error at the end of line 2... I'm sure all this would have been obvious if I knew any perl but i didn't so wasted a lot of time... but then again, i have learned a thing or two.... |
|
|
|
#5 |
|
Messages: n/a
Hébergeur: |
<dj.brainstorm@gmail.com> schreef in bericht
news:1171626987.085270.179140@m58g2000cwm.googlegr oups.com... > problem solved (finally)... the suexec route was working fine... > > I also had my first.cgi program in ascii mode but unfortunately the > website where i copied my perl "hello worl" program from had an error > in it (ARGGHHHH!!) no ";" at the end of the 2nd line!!!! If the second line was the last line too, it should not have bothered ... > I discovered this by using the vi editor and adding -w to #!/usr/bin/ .... your -w reminded me to an issue : Looks to me you've been bitten by a DOSsie line-end: DOS uses a two character sequence is <CR><LF> to end aline. Unix|Linux only recognizes the <LF>, leaving <CR> at the tail of line one. While processing this shebang line the OS tried to locate perl<cr>. Adding the param gave the OS a valid delimiter: space. > perl which presumably makes it a bit more verbose in error > reporting... the log files then showed a syntax error at the end of > line 2... More likely a trailing<cr> removed while adding the ; did teh tric. > > I'm sure all this would have been obvious if I knew any perl but i > didn't so wasted a lot of time... but then again, i have learned a > thing or two.... Keep counting ;-) HansH |
|
![]() |
| Outils de la discussion | |
|
|