Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Apache 2
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
kroenecker
n00b
n00b


Joined: 10 Aug 2005
Posts: 64

PostPosted: Wed Nov 16, 2005 8:49 am    Post subject: Apache 2 Reply with quote

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
View user's profile Send private message
koara
Tux's lil' helper
Tux's lil' helper


Joined: 30 Jun 2004
Posts: 76
Location: Portland, Maine

PostPosted: Wed Nov 16, 2005 7:29 pm    Post subject: Re: Apache 2 Reply with quote

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
View user's profile Send private message
kroenecker
n00b
n00b


Joined: 10 Aug 2005
Posts: 64

PostPosted: Wed Nov 16, 2005 7:40 pm    Post subject: Reply with quote

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
View user's profile Send private message
koara
Tux's lil' helper
Tux's lil' helper


Joined: 30 Jun 2004
Posts: 76
Location: Portland, Maine

PostPosted: Wed Nov 16, 2005 7:48 pm    Post subject: Reply with quote

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
View user's profile Send private message
kroenecker
n00b
n00b


Joined: 10 Aug 2005
Posts: 64

PostPosted: Wed Nov 16, 2005 7:48 pm    Post subject: Reply with quote

Firefox
Back to top
View user's profile Send private message
kroenecker
n00b
n00b


Joined: 10 Aug 2005
Posts: 64

PostPosted: Wed Nov 16, 2005 8:56 pm    Post subject: Reply with quote

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
View user's profile Send private message
koara
Tux's lil' helper
Tux's lil' helper


Joined: 30 Jun 2004
Posts: 76
Location: Portland, Maine

PostPosted: Wed Nov 16, 2005 9:15 pm    Post subject: Reply with quote

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
View user's profile Send private message
kroenecker
n00b
n00b


Joined: 10 Aug 2005
Posts: 64

PostPosted: Thu Nov 17, 2005 4:58 am    Post subject: Reply with quote

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
View user's profile Send private message
yinrunning
Tux's lil' helper
Tux's lil' helper


Joined: 13 Nov 2005
Posts: 114
Location: KC,MO,USA

PostPosted: Thu Nov 17, 2005 7:46 am    Post subject: Reply with quote

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
View user's profile Send private message
kroenecker
n00b
n00b


Joined: 10 Aug 2005
Posts: 64

PostPosted: Sat Nov 19, 2005 3:16 am    Post subject: Reply with quote

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
View user's profile Send private message
kroenecker
n00b
n00b


Joined: 10 Aug 2005
Posts: 64

PostPosted: Sat Nov 19, 2005 3:29 am    Post subject: Reply with quote

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
View user's profile Send private message
yinrunning
Tux's lil' helper
Tux's lil' helper


Joined: 13 Nov 2005
Posts: 114
Location: KC,MO,USA

PostPosted: Sat Nov 19, 2005 3:38 am    Post subject: Reply with quote

Because the orig. is stoopid. :D

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
View user's profile Send private message
yinrunning
Tux's lil' helper
Tux's lil' helper


Joined: 13 Nov 2005
Posts: 114
Location: KC,MO,USA

PostPosted: Sat Nov 19, 2005 3:50 am    Post subject: Reply with quote

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.. :?
Back to top
View user's profile Send private message
kroenecker
n00b
n00b


Joined: 10 Aug 2005
Posts: 64

PostPosted: Sat Nov 19, 2005 4:17 am    Post subject: Reply with quote

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
View user's profile Send private message
yinrunning
Tux's lil' helper
Tux's lil' helper


Joined: 13 Nov 2005
Posts: 114
Location: KC,MO,USA

PostPosted: Sat Nov 19, 2005 7:44 am    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum