VPS侦探论坛

 找回密码
 注册
查看: 3081|回复: 2

lamp 1.3 按照网上设置shtml方法没反应

[复制链接]
发表于 2016-9-22 11:32:10 | 显示全部楼层 |阅读模式

1.3版本  php5.6 + apache 2.4 lamp
以下是我参照网上的设置apache的方法,但是一点反应都没有,军哥是不是我还有什么地方没做对啊???
还有说要开这个``我都开了```
LoadModule ssl_module modules/mod_ssl.so

Apache环境中启用shtml。

1. 确认加载include.so模块,将注释去掉:

LoadModule include_module modules/mod_include.so


此模块说明

This module provides a filter which will process files before they are sent to the client. The processing is controlled by specially formatted SGML comments, referred to as elements. These elements allow conditional text, the inclusion of other files or programs, as well as the setting and printing of environment variables.

此模块提供将要发送到客户端之前文件的过滤操作,由SGML来解释这一文件,然后这个文件简称元素,

查看httpd有没有正确加载这个模块,以方便记录可以处理的元素名单

如果没有这个模块就得重新编译apache了

这个模块的c源程序是mod_include.c

[root@localhost html]# apachectl -M|grep include
include_module (shared)
Syntax OK

2.在httpd.conf中的 AddType部分去掉这两段注释:
AddType text/html .shtml

AddOutputFilter INCLUDES .shtml

创建了这个类型的文件

3. Directory目录权限里面找到
Options Indexes FollowSymLinks
增加Includes修改为:
Options Indexes FollowSymLinks Includes

4. 重新启动httpd,测试:


SHTML test!
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
 楼主| 发表于 2016-9-22 11:49:15 | 显示全部楼层


我知道什么问题了,因为我是新建vhost add 的时候把网站放到www下所以执行,所以需要修改vhost对应的文件添加上Options Indexes FollowSymLinks Includes IncludesNOEXEC  

不知道军哥如何修改这些模板呢??现在默认是不添加这个进去的```有没办法在add的时候自动加这句进去```还有lnmp vhost add 的时候网站目录默认地址能否改成/home/www/域名   现在是/home/wwwroot/域名   其实哪个是对的呢???一个是root权限目录一个是www权限目录我有必要换成www下面去吗???
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
发表于 2016-9-22 14:40:39 | 显示全部楼层

/usr/local/apache/conf/httpd.conf里
#LoadModule include_module modules/mod_include.so

    #AddType text/html .shtml
    #AddOutputFilter INCLUDES .shtml
把#去掉
Options FollowSymLinks 后加上Includes
所有要启用shtml的虚拟主机配置文件里的Options也要加上Includes
重启apache
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|Archiver|VPS侦探 ( 鲁ICP备16040043号-1 )

GMT+8, 2024-9-28 21:23 , Processed in 0.025960 second(s), 16 queries .

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表