当前位置: 首页 > 图文教程 > 网络编程 > PHP > Apache服务器下配置SSI

PHP
PHP技巧教程:setcookie语句的问题
多个字段,大量记录的插入操作技巧(PHP)
动态网页PHP脚本中include文件报错解决方法
PHP中类的使用,面向对象的思路
php+javascript 静态化简单实例
Zend Framework留言本模型文件 (PHP源码)
PHP中使用ASP.NET AJAX
PHP正则表达式的快速学习方法
php中防盗链使用.htaccess
PHP在windows和LINUX下的路径分隔符
php页面zend加密乱码的解决办法
PHP中如何使用header发送头部信息
如何将PHP中的多维数组显示出来
用PHP操作MySql数据库(分页)
保护代码安全,PHP如何进行注入
在PHP中使用全局变量【一】
在PHP中使用全局变量【二】
获取远程图片并把它保存到本地
源代码的加亮(highlight_file)
用PHP上传文件和发送邮件

PHP 中的 Apache服务器下配置SSI


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-10-12   浏览: 55 ::
收藏到网摘: n/a

我们需要在  Apache/conf/extra/ 目录下建立一个 httpd-vhosts.conf 这样的文件。

    文件内容如下:

# ../vhosts 是你的网站目录
<Directory "../vhosts">
Options -Indexes FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
Directory>
 
NameVirtualHost *
 
<VirtualHost *>
DocumentRoot ../vhosts
ServerName defalut:80
ErrorLog logs/defalut-error_log
VirtualHost>
 
 
#因为有可能你有多个站点,针对每个站点在vhosts下建立不同的目录 比如 c:/vhosts/javapeixun
<Directory "c:/vhosts/javapeixun">
Allow from all
Directory>
 
#这段是用来配置域名的哦。
<VirtualHost *>
ServerAdmin [email protected]
DocumentRoot c:/vhosts/javapeixun
ServerName javapeixun.com.cn:80
ServerAlias www.javapeixun.com.cn
ErrorLog logs/javapeixun.com.cn-error_log
VirtualHost>
 
 
#这里就是用来配置 SSI 的。
<Directory "c:/vhosts/">
AddOutputFilterByType INCLUDES;DEFLATE text/html
AddType text/html .html .htm .shtml .ssi
AddHandler server-parsed .shtml .html .htm .shtm
# AddHandler cgi-script cgi
Options Indexes MultiViews Includes
AllowOverride None
Order allow,deny
Allow from all
Directory>

编辑 Apache\conf 目录下 的 httpd.conf。

在文件末尾 添加

Include conf/extra/httpd-vhosts.conf

然后重启 Apache 就OK 啦。

Apache 就是这样配置 SSI 和 域名的。