ITeye博客

centos 安装 apache httpd 支持php 和 rewrite

gutou9 · 2018-06-19 10:33 · 开源软件 · Markdown

安装

yum install httpd httpd-devel mod_ssl

 

查看版本

httpd -v

 

启动

service httpd start

 

更改 /etc/httd/conf 中的 httpd.config

 

1 更改默认路径 

DocumentRoot "/var/www/html" 为 DocumentRoot "/usr/local/zblog"

2 添加模块

 

#支持php

LoadModule php5_module modules/libphp5.so 

 

 #支持重定向 伪静态

LoadModule rewrite_module modules/mod_rewrite.so 

AllowOverride All 

 

支持 php扩展名

 

    DirectoryIndex index.html index.php 

 

    AddType application/x-httpd-php-source .phps

    AddType application/x-httpd-php .php

 

 

service httpd restart

评论(0)

暂无评论。

评论功能维护中,当前仅展示历史评论。