新安装的apache将html内容作为文本提供

时间:2022-10-05 18:44:38

I am running an Apache instance on Ubuntu and am having this problem: .HTML files with bonafide HTML inside is being served as a text file:

我正在Ubuntu上运行一个Apache实例并且遇到了这个问题:.HTML文件中包含真正的HTML文件正在作为文本文件提供:

> **For eg. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN"> <html>
> <body> <h1>Index to Butterthlies
> Catalogs</h1>

etc. etc.**

I checked the header in firebug and sure enough the page is plain\text. I figured I'm probably missing the mod_mime module, so I tried to include it as a module like this:

我检查了firebug中的标题,确定页面是纯文本。我想我可能错过了mod_mime模块,所以我试着将它包含为这样的模块:

LoadModule mod_mime /usr/lib/apache2/modules/mod_mime.so
TypesConfig conf/mime.types

where the /usr/lib... path contains the mod_mime.so. But this doesn't work and gives the following error:

其中/ usr / lib ...路径包含mod_mime.so。但这不起作用,并给出以下错误:

Syntax error on line 1 of /usr/www/APACHE3/site.first/conf/httpd.conf: Can't locate API module structure `mod_mime' in file /usr/lib/apache2/modules/mod_mime.so: /usr/lib/apache2/modules/mod_mime.so: undefined symbol: mod_mime

/usr/www/APACHE3/site.first/conf/httpd.conf第1行的语法错误:找不到文件/usr/lib/apache2/modules/mod_mime.so中的API模块结构`mod_mime':/ usr /lib/apache2/modules/mod_mime.so:undefined symbol:mod_mime

2 个解决方案

#1


So long description is useless, last paragraph is enough.

如此长的描述是没用的,最后一段就足够了。

Reinstall your apache from scratch, something is broken in your installation.

从头开始重新安装apache,安装过程中出现问题。

BTW, apache installed from package of any distributive should be already configured properly to serve HTML files.

顺便说一句,从任何分发包中安装的apache应该已经正确配置以提供HTML文件。

#2


Change the LoadModule line to look like this:

将LoadModule行更改为如下所示:

LoadModule mime_module /usr/lib/apache2/modules/mod_mime.so

#1


So long description is useless, last paragraph is enough.

如此长的描述是没用的,最后一段就足够了。

Reinstall your apache from scratch, something is broken in your installation.

从头开始重新安装apache,安装过程中出现问题。

BTW, apache installed from package of any distributive should be already configured properly to serve HTML files.

顺便说一句,从任何分发包中安装的apache应该已经正确配置以提供HTML文件。

#2


Change the LoadModule line to look like this:

将LoadModule行更改为如下所示:

LoadModule mime_module /usr/lib/apache2/modules/mod_mime.so