|
|
|
|
||||||
| comp.info.servers.unix Web servers for UNIX platforms. |
![]() |
|
|
LinkBack | Outils de la discussion |
|
|
#1 |
|
Messages: n/a
Hébergeur: |
Perhaps someone will understand what is happening here. I've been trying to configure perl and apache on a redhat8 server with virtual hosts. Perl works well on the system and is executing cgi-bin scripts as well, but the output HTML is not being rendered by the browser on my scripts. I know you're thinking, you're not sending the headers dummy! But please just take a look: http://www.realtordb.com/cgi-bin/hello2.pl . Most of the scripts I'm working with are tested and tried but I get the same text only output for all of them. Any ideas, suggestions, answers would be so greatly appreciated. Surely I'm not the only one out there who has had this problem. The script is your basic html output. #!/usr/local/bin/perl # hello.cgi - My first CGI program print "Content-Type: text/html\n\n"; print "<html> <head>\n"; print "<title>Hello, world!</title>"; print "</head>\n"; print "<body>\n"; print "<h1>Hello, world!</h1>\n"; print "</body> </html>\n"; |
|
|
|
#2 |
|
Messages: n/a
Hébergeur: |
"ecropolan" <warren@ecropolis.com> said:
>Perhaps someone will understand what is happening here. I've been >trying to configure perl and apache on a redhat8 server with virtual >hosts. Perl works well on the system and is executing cgi-bin scripts >as well, but the output HTML is not being rendered by the browser on my >scripts. I know you're thinking, you're not sending the headers dummy! That'd be the first guess. >But please just take a look: http://www.realtordb.com/cgi-bin/hello2.pl . Ok... testing: ~$ GET -sSeuU http://www.realtordb.com/cgi-bin/hello2.pl GET http://www.realtordb.com/cgi-bin/hello2.pl User-Agent: lwp-request/2.01 GET http://www.realtordb.com/cgi-bin/hello2.pl --> 200 Assumed OK Client-Date: Sun, 27 Mar 2005 06:08:14 GMT Client-Response-Num: 1 Content-Type: text/html <html> <head> <title>Hello, world!</title></head> <body> <h1>Hello, world!</h1> </body> </html> .... now, that is interesting. Something is creating an extra newline after the server-generated headers, before the 'Content-Type'. I don't see anything in your program that would cause this behaviour, so it would look like it is something caused by your server set up. >The script is your basic html output. >#!/usr/local/bin/perl ># hello.cgi - My first CGI program >print "Content-Type: text/html\n\n"; >print "<html> <head>\n"; >print "<title>Hello, world!</title>"; >print "</head>\n"; >print "<body>\n"; >print "<h1>Hello, world!</h1>\n"; >print "</body> </html>\n"; -- Wolf a.k.a. Juha Laiho Espoo, Finland (GC 3.0) GIT d- s+: a C++ ULSH++++$ P++@ L+++ E- W+$@ N++ !K w !O !M V PS(+) PE Y+ PGP(+) t- 5 !X R !tv b+ !DI D G e+ h---- r+++ y++++ "...cancel my subscription to the resurrection!" (Jim Morrison) |
|
|
|
#3 |
|
Messages: n/a
Hébergeur: |
Looks like we're on to something there. I see what's happening. Now the
only question is how to fix it. Do you think it's an Apache problem or Perl? Is there a configuration file for this type of header output? Anyone out there have any knowledge of this? I appreciate your taking the time to look at my problem. |
|
|
|
#4 |
|
Messages: n/a
Hébergeur: |
"ecropolan" <warren@ecropolis.com> said:
>Looks like we're on to something there. I see what's happening. Now the >only question is how to fix it. Do you think it's an Apache problem or >Perl? Is there a configuration file for this type of header output? >Anyone out there have any knowledge of this? It seems to me to be problem with Apache configuration -- or, with how you've configured perl to be used with Apache. However, I can't imagine what in configuration could cause this, as this would simply break every CGI script in existence. To verify, try (once more) running the exact same script from the command line, and check that it doesn't start its output by printing out an empty line. You might also try to create a script of similar functionality with some other language (say, a shell script), and invoke that through Apache to see whether the problem applies to all CGI content regardless of implementation language, or whether this is specific to scripts written in Perl. -- Wolf a.k.a. Juha Laiho Espoo, Finland (GC 3.0) GIT d- s+: a C++ ULSH++++$ P++@ L+++ E- W+$@ N++ !K w !O !M V PS(+) PE Y+ PGP(+) t- 5 !X R !tv b+ !DI D G e+ h---- r+++ y++++ "...cancel my subscription to the resurrection!" (Jim Morrison) |
|
|
|
#5 |
|
Messages: n/a
Hébergeur: |
>From the command line definetley no extra space, so it's go to be an
Apache problem. I upgraded to 1.3.33, that didn't . I'm thinking of going to a very basic build and adding mod and enableing features a couple at a time. I don't know what else to do. Suggestions on a good starting build. I'm thinking one of these modules I'm using has errors. I tried stripping almost everything out of the httpd.conf file. Still no luck. Here's my build mod_php4, mod_gzip, mod_throttle, mod_perl, mod_access_referer, mod_session, mod_auth_, mod_ssl, mod_setenvif, mod_so, mod_auth, mod_access, mod_alias, mod_userdir, mod_actions, mod_imap, mod_asis, mod_cgi, mod_dir, mod_autoindex, mod_include, mod_info, mod_status, mod_negotiation, mod_mime, mod_mime_magic, mod_log_config, mod_env, http_core Juha Laiho wrote: > "ecropolan" <warren@ecropolis.com> said: > >Looks like we're on to something there. I see what's happening. Now the > >only question is how to fix it. Do you think it's an Apache problem or > >Perl? Is there a configuration file for this type of header output? > >Anyone out there have any knowledge of this? > > It seems to me to be problem with Apache configuration -- or, with how > you've configured perl to be used with Apache. However, I can't imagine > what in configuration could cause this, as this would simply break > every CGI script in existence. > > To verify, try (once more) running the exact same script from the > command line, and check that it doesn't start its output by printing out > an empty line. > > You might also try to create a script of similar functionality with some > other language (say, a shell script), and invoke that through Apache > to see whether the problem applies to all CGI content regardless of > implementation language, or whether this is specific to scripts written > in Perl. > -- > Wolf a.k.a. Juha Laiho Espoo, Finland > (GC 3.0) GIT d- s+: a C++ ULSH++++$ P++@ L+++ E- W+$@ N++ !K w !O !M V > PS(+) PE Y+ PGP(+) t- 5 !X R !tv b+ !DI D G e+ h---- r+++ y++++ > "...cancel my subscription to the resurrection!" (Jim Morrison) |
|
|
|
#6 |
|
Messages: n/a
Hébergeur: |
"ecropolan" <warren@ecropolis.com> wrote in ...
> >From the command line definetley no extra space, so it's go to be an > Apache problem. I upgraded to 1.3.33, that didn't . I'm thinking of > going to a very basic build and adding mod and enableing features a > couple at a time. I don't know what else to do. Suggestions on a good > starting build. I'm thinking one of these modules I'm using has errors. > I tried stripping almost everything out of the httpd.conf file. Still > no luck. is the mime.types updated or messed up when you upgraded to 1.3.33? |
|
|
|
#7 |
|
Messages: n/a
Hébergeur: |
I didn't notice that it was messed up. I haven't really tested. What
would I do? I have noticed some strangeness. My admin site, which has a php front end, when I click links that link to it Mozilla wants to download the file. But other PHP applications I've go work just fine. Also, I can type the link directly into the browser and it comes up fine. The admin site is a fast-pitch setup. I'm about sick of it. It takes more time but sometimes there's a lot of value in building things one piece at a time! I'm about ready to start over. T W Hu wrote: > "ecropolan" <warren@ecropolis.com> wrote in ... > > >From the command line definetley no extra space, so it's go to be an > > Apache problem. I upgraded to 1.3.33, that didn't . I'm thinking of > > going to a very basic build and adding mod and enableing features a > > couple at a time. I don't know what else to do. Suggestions on a good > > starting build. I'm thinking one of these modules I'm using has errors. > > I tried stripping almost everything out of the httpd.conf file. Still > > no luck. > > is the mime.types updated or messed up when you upgraded to 1.3.33? |
|
|
|
#8 |
|
Messages: n/a
Hébergeur: |
my firefox just prints the content and it seems just plain text instead of
html. mime.types is just my guess. you are better to install an apache without PHP. test your script and make sure it works before you install PHP. you may compare your mime.types to the default one. "ecropolan" <warren@ecropolis.com> wrote in ... > I didn't notice that it was messed up. I haven't really tested. What > would I do? I have noticed some strangeness. My admin site, which has a > php front end, when I click links that link to it Mozilla wants to > download the file. But other PHP applications I've go work just fine. > Also, I can type the link directly into the browser and it comes up > fine. The admin site is a fast-pitch setup. I'm about sick of it. It > takes more time but sometimes there's a lot of value in building things > one piece at a time! I'm about ready to start over. |
|
![]() |
| Outils de la discussion | |
|
|