LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Debian (https://www.linuxquestions.org/questions/debian-26/)
-   -   Apache2 displays html source only with 2.6 kernel (https://www.linuxquestions.org/questions/debian-26/apache2-displays-html-source-only-with-2-6-kernel-403288/)

centosian 01-14-2006 10:15 AM

Apache2 displays html source only with 2.6 kernel
 
Alright, this is driving me nuts.

I did a fresh install of Apache2 (2.0.55), copied a test .html file to /var/www which is the document root directory, started the server and ran a quick test. When I access a page like http://localhost/index.html it just shows me the html source, i.e it just displays this in my Firefox browser(1.0.7).

Code:

<html>
<head>
  <title>Test page</title>
  </head>
  <body>
  <h1>This is a test page</h1>
  </body>
</html>

Same goes for any of the html files in /var/www/apache2-default.

I am running 2.6.12 with the testing(Etch) sources.list. This isn't a problem on my other machine running the 2.4 kernel with the same sources.list. How in the heck does 2.6 have anything to do with this?

I've tried apache2-mm-prefork and apache2-mm-worker and both have the same problem.

**Confused and frustrated.**

Thanks,

saman007uk 01-14-2006 10:30 AM

It doesn't have anything to do with the kernel version. The HTML headers might help, post them here.

Adding the following to the configuration file might help:
Code:

AddType text/html .html
And then:
Code:

/etc/init.d/apache2 reload

centosian 01-14-2006 10:43 AM

Doh! Thank you, saman! That did it.

I just assumed(no wonder that's a dirty word) that a default installation would have the .html type handler already configured.

In fact on my 2.4 machine that's not in my apache2.conf file either but strangely enough it renders the html just fine.


All times are GMT -5. The time now is 02:51 AM.