View previous topic :: View next topic |
Author |
Message |
kroenecker n00b
![n00b n00b](/images/ranks/rank_rect_0.gif)
Joined: 10 Aug 2005 Posts: 64
|
Posted: Wed Nov 16, 2005 8:49 am Post subject: Apache 2 |
|
|
My server starts without problems from what I can tell, but when I go to localhost/index.html the text in the html file is displayed without being interpreted by the browser. That is, all html tags are shown etc.
I'm using the default httpd.conf file. Do I need to change a setting? |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
koara Tux's lil' helper
![Tux's lil' helper Tux's lil' helper](/images/ranks/rank_rect_1.gif)
![](images/avatars/202725955140e2f5a699aa9.jpg)
Joined: 30 Jun 2004 Posts: 76 Location: Portland, Maine
|
Posted: Wed Nov 16, 2005 7:29 pm Post subject: Re: Apache 2 |
|
|
kroenecker wrote: | My server starts without problems from what I can tell, but when I go to localhost/index.html the text in the html file is displayed without being interpreted by the browser. That is, all html tags are shown etc.
I'm using the default httpd.conf file. Do I need to change a setting? |
Have you edited the default config file at all? You might want to make sure the DirectoryIndex line is uncommented. |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
kroenecker n00b
![n00b n00b](/images/ranks/rank_rect_0.gif)
Joined: 10 Aug 2005 Posts: 64
|
Posted: Wed Nov 16, 2005 7:40 pm Post subject: |
|
|
I haven't changed the httpd.conf file at all. I am running on an amd64 box, but I wouldn't think that that would be a problem.
Basically the text below is displayed in Firefox when I enter localhost in the url:
Quote: |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Test Page for Apache Installation</title>
</head>
<body>
<p>If you can see this, it means that the installation of the <a
href="http://www.apache.org/foundation/preFAQ.html">Apache web server</a>
software on this system was successful. You may now add content to this
directory and replace this page.</p>
<hr style="width: 100%; height: 3px;" />
<h2 style="text-align: center">Seeing this instead of the website you expected?</h2>
<p>This page is here because the site administrator has changed the
configuration of this web server. Please <strong>contact the person
responsible for maintaining this server with questions.</strong>
The Apache Software Foundation, which wrote the web server software
this site administrator is using, has nothing to do with
maintaining this site and cannot help resolve configuration
issues.</p>
<hr style="width: 100%; height: 3px;" />
<p>The Apache documentation is available
<a href="http://httpd.apache.org/docs-2.0/">online</a> or has been installed
<a href="/manual/">locally</a>.</p>
<p>You are free to use the image below on an Apache-powered web
server. Thanks for using Apache!</p>
<div style="text-align: center"><img src="apache_pb.gif" alt="" /></div>
</body>
</html>
|
When I try to start apache2 I do get the following error:
* Starting apache2 ...
apache2: Could not determine the server's fully qualified domain name, using 127.0.0.1 for ServerName
Does that help?
Also its being run with -D DEFAULT_VHOST.
Anyway any suggestions are appreciated.
Last edited by kroenecker on Wed Nov 16, 2005 7:48 pm; edited 1 time in total |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
koara Tux's lil' helper
![Tux's lil' helper Tux's lil' helper](/images/ranks/rank_rect_1.gif)
![](images/avatars/202725955140e2f5a699aa9.jpg)
Joined: 30 Jun 2004 Posts: 76 Location: Portland, Maine
|
Posted: Wed Nov 16, 2005 7:48 pm Post subject: |
|
|
What browser are you using?
kroenecker wrote: | I haven't changed the httpd.conf file at all. I am running on an amd64 box, but I wouldn't think that that would be a problem.
Basically the text below is displayed in Firefox when I enter localhost in the url:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Test Page for Apache Installation</title>
</head>
<body>
<p>If you can see this, it means that the installation of the <a
href="http://www.apache.org/foundation/preFAQ.html">Apache web server</a>
software on this system was successful. You may now add content to this
directory and replace this page.</p>
<hr style="width: 100%; height: 3px;" />
<h2 style="text-align: center">Seeing this instead of the website you expected?</h2>
<p>This page is here because the site administrator has changed the
configuration of this web server. Please <strong>contact the person
responsible for maintaining this server with questions.</strong>
The Apache Software Foundation, which wrote the web server software
this site administrator is using, has nothing to do with
maintaining this site and cannot help resolve configuration
issues.</p>
<hr style="width: 100%; height: 3px;" />
<p>The Apache documentation is available
<a href="http://httpd.apache.org/docs-2.0/">online</a> or has been installed
<a href="/manual/">locally</a>.</p>
<p>You are free to use the image below on an Apache-powered web
server. Thanks for using Apache!</p>
<div style="text-align: center"><img src="apache_pb.gif" alt="" /></div>
</body>
</html> |
|
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
kroenecker n00b
![n00b n00b](/images/ranks/rank_rect_0.gif)
Joined: 10 Aug 2005 Posts: 64
|
Posted: Wed Nov 16, 2005 7:48 pm Post subject: |
|
|
Firefox |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
kroenecker n00b
![n00b n00b](/images/ranks/rank_rect_0.gif)
Joined: 10 Aug 2005 Posts: 64
|
Posted: Wed Nov 16, 2005 8:56 pm Post subject: |
|
|
This is slightly frustrating.
I tried reemerging apache2 with no luck.
When I browse to the index.html file using Firefox, everything displays properly.
When I enter localhost as the url, the html--tags and all--is spit out onto the screen. |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
koara Tux's lil' helper
![Tux's lil' helper Tux's lil' helper](/images/ranks/rank_rect_1.gif)
![](images/avatars/202725955140e2f5a699aa9.jpg)
Joined: 30 Jun 2004 Posts: 76 Location: Portland, Maine
|
Posted: Wed Nov 16, 2005 9:15 pm Post subject: |
|
|
kroenecker wrote: | This is slightly frustrating.
I tried reemerging apache2 with no luck.
When I browse to the index.html file using Firefox, everything displays properly.
When I enter localhost as the url, the html--tags and all--is spit out onto the screen. |
I've been thinking about this more and was wondering if you have tried using 127.0.0.1/index.html in the browser. |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
kroenecker n00b
![n00b n00b](/images/ranks/rank_rect_0.gif)
Joined: 10 Aug 2005 Posts: 64
|
Posted: Thu Nov 17, 2005 4:58 am Post subject: |
|
|
I appreciate the suggestions, but that's not it either.
I'm starting to wonder if I don't have a flag enabled that is necessary in the compile or if maybe amd 64 just isn't very "stable." I've even tried starting apache with apache2ctl -k start. Still everything is displayed as text.
Very annoying. |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
yinrunning Tux's lil' helper
![Tux's lil' helper Tux's lil' helper](/images/ranks/rank_rect_1.gif)
![](images/avatars/164000901243791b54ed395.gif)
Joined: 13 Nov 2005 Posts: 114 Location: KC,MO,USA
|
Posted: Thu Nov 17, 2005 7:46 am Post subject: |
|
|
I can't shed much light on a solution, but I can tell you this: The output you're seeing is what the browser is _supposed_ to get from apache. The browser itself is responsible for rendering it, as long as it knows what it is. That probably means that something in the http headers for the page aren't right. Firefox is interpretting this as a plain text file - or possibly something else altogether - not html. And yes, apache _is_ responsible for sending the correct headers, just not for rendering the page.
To be more specific, consider that firefox will open the page and render it correctly if you simply open it from the filesystem. In that situation, there's no headers being sent at all, so firefox just deals with what it sees: text/html. That increases the possibility that apache is sending out headers that specify some other mime type besides text/html. Or maybe just complete jibberish.
You might try Ctrl-i in firefox and check what it thinks the page is. |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
kroenecker n00b
![n00b n00b](/images/ranks/rank_rect_0.gif)
Joined: 10 Aug 2005 Posts: 64
|
Posted: Sat Nov 19, 2005 3:16 am Post subject: |
|
|
Well you are right in that Firefox thinks that the encoding is text/plain...
I have the following in my httpd.conf
Quote: |
#
# TypesConfig describes where the mime.types file (or equivalent) is
# to be found.
#
TypesConfig /etc/mime.types
#
# DefaultType is the default MIME type the server will use for a document
# if it cannot otherwise determine one, such as from filename extensions.
# If your server contains mostly text or HTML documents, "text/plain" is
# a good value. If most of your content is binary, such as applications
# or images, you may want to use "application/octet-stream" instead to
# keep browsers from trying to display binary files as though they are
# text.
#
DefaultType text/plain
|
So I am wondering if there is a better setting that will ensure that html is the proper interpretation. Do I need to change permissions on my index.html file? Or is there a setting that I've forgotten? |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
kroenecker n00b
![n00b n00b](/images/ranks/rank_rect_0.gif)
Joined: 10 Aug 2005 Posts: 64
|
Posted: Sat Nov 19, 2005 3:29 am Post subject: |
|
|
Well I changed the default setting from text/plain to text/html and now everything works (so far).
I'm wondering, if anyone knows why this wasn't working before especially since the original config file says that text/plain should work for html? |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
yinrunning Tux's lil' helper
![Tux's lil' helper Tux's lil' helper](/images/ranks/rank_rect_1.gif)
![](images/avatars/164000901243791b54ed395.gif)
Joined: 13 Nov 2005 Posts: 114 Location: KC,MO,USA
|
Posted: Sat Nov 19, 2005 3:38 am Post subject: |
|
|
Because the orig. is stoopid.
I've been working on setting up Apache as well, and I had to do the same. I'm about to scrap the example .conf. I've got a copy of the O'Reilley Apache book (so dated!) and I'm just gonna build a conf file from scratch.
Out of curiosity, what's the name/location of your conf file? |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
yinrunning Tux's lil' helper
![Tux's lil' helper Tux's lil' helper](/images/ranks/rank_rect_1.gif)
![](images/avatars/164000901243791b54ed395.gif)
Joined: 13 Nov 2005 Posts: 114 Location: KC,MO,USA
|
Posted: Sat Nov 19, 2005 3:50 am Post subject: |
|
|
Yeah, alot of it probably has to do with this. Where it talks about the default current directory structure? That's a completely strange and very non-standard way of doing things. I'm guessing that the same people who thought that that was a good idea thought that text/plain was a good idea.. ![Confused :?](images/smiles/icon_confused.gif) |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
kroenecker n00b
![n00b n00b](/images/ranks/rank_rect_0.gif)
Joined: 10 Aug 2005 Posts: 64
|
Posted: Sat Nov 19, 2005 4:17 am Post subject: |
|
|
My httpd.conf file is under /etc/apache2. Was that what you were asking for?
Thanks for your responses. And I'll keep you posted as I become better at using apache.
By the way are you going to be making a pure html website? Trying any javascript, perl, java, etc? |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
yinrunning Tux's lil' helper
![Tux's lil' helper Tux's lil' helper](/images/ranks/rank_rect_1.gif)
![](images/avatars/164000901243791b54ed395.gif)
Joined: 13 Nov 2005 Posts: 114 Location: KC,MO,USA
|
Posted: Sat Nov 19, 2005 7:44 am Post subject: |
|
|
javascript no matter what, but that's not server-side.
I'll be using php_mod, also no matter what, and I'll eventually be sighing heavily and returning to perl, because I have to. lol.
And yes, let's trade notes. i think my IM's on here. Feel free to drop me a line. I'll be messing with it all weekend. |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
|