服务器技术

 首页 > 服务器技术 > apache > Ubuntu自带的apache开启ssi支持shtml|配置-Apache教程

Ubuntu自带的apache开启ssi支持shtml|配置-Apache教程

分享到:
【字体:
导读:
          ...

默认情况下:模块是一件存在的,但是apache没有加载模块,所以需要自己创建一个软连接

步骤:

ln -s /etc/apache2/mods-available/include.load /etc/apache2/mods-enabled

现在apache就可以加载模块了

然后在需要开始ssi的sites-available/filename 的配置文件中增加相应的代码。

例如我的配置:

vi /etc/apache2/sites-available/blogguy_cn

增加以下两行:

    AddType text/html .shtml .html .htm
    AddOutputFilter INCLUDES .shtml .html .htm

同时注意:

Options Indexes FollowSymLinks MultiViews +Includes  一行  +Includes一定要有,默认是有的。

配置完的配置文件大致是:


        ServerAdmin wayswang@gmail.com
        DocumentRoot /var/www/blogguy.cn     
        ServerName blogguy.cn
        ServerAlias www.blogguy.cn
       
                        Options Indexes FollowSymLinks MultiViews Includes
                        AllowOverride None
                        Order allow,deny
                        allow from all
                        AddType text/html .shtml .html .htm
                        AddOutputFilter INCLUDES .shtml .html .htm
      

        ErrorLog /var/log/apache2/blogguy_cn_error.log
        # Possible values include: debug, info, notice, warn, error, crit,
        # alert, emerg.
        LogLevel warn
        CustomLog /var/log/apache2/blogguy_cn_access.log combined

然后重启apache

service apache2 restart

可以了!

《Ubuntu自带的apache开启ssi支持shtml》由第二电脑网原创提供,转载请注明:http://www.002pc.com/master/College/Server/Apache/17975.html
分享到:
Apache服务器配置安全规范及其缺陷|Apach...
正如我们前言所说尽管apache服务器应用最为广泛,设计上非常安全的程序。但是同其它应用程序一样,Apache也存在安全缺陷。毕竟它是完全源代码,Apache服务器的安全缺陷主要是使用HTTP协议进行的拒绝服务攻击(denial of service)、缓冲区溢出攻击以及被攻击者获得root权限三缺陷和最新的恶意的攻击者进行“拒绝服务”(DoS)攻...
使用Apache的rewrite功能实现内部重定向|...
场景:实验室有一台机器(称为nat_server吧)拥有外网地址,在另外一台内部服务器上提供web服务(称之为web_server),我们想让外网的用户能够通过nat_server能够访问web_server。 实现方案 使用iptables的snat,dnat功能 使用ipfilter的map功能 使用apache的rewrite功能 优缺点: 方法1和2的是通过端口转发的功能来实现的,...
  •         php迷,一个php技术的分享社区,专属您自己的技术摘抄本、收藏夹。
  • 在这里……