apache+php项目部署

先安装apache和php然后进行如下操作

1.编辑httpd.conf文件,使apache支持php

[root@localhost conf]# vim /etc/httpd/conf/httpd.conf

1)找到:    AddType text/html .shtml   
在后面添加:    
AddType application/x-httpd-php .php(使Apcche支持PHP)    
AddType application/x-httpd-php-source .php5
2)找到:    #ServerName www.example.com:8 
修改为: ServerName localhost:80
3)找到: <IfModule dir_module> DirectoryIndex index.html </IfModule>
添加:    <IfModule dir_module>    DirectoryIndex index.html index.php    </IfModule> 
4)修改默认的Web站点目录
找到:DocumentRoot "/usr/local/apache2/htdocs"
修改为:DocumentRoot "/var/www/html" --该目录为自己创建的目录
 
找到:<Directory "/usr/local/apache2/htdocs"> 
修改为:<Directory "/var/www/html">

猜你喜欢

转载自www.cnblogs.com/lxxyd/p/10411538.html