1、安装apache
https://www.cnblogs.com/lxlb/p/9159056.html
2、安装php
https://www.cnblogs.com/37yan/p/6879404.html
3、配置apache支持php
https://www.cnblogs.com/qiuxiao/p/6815350.html
4、配置apache
<VirtualHost *:> ServerName ***.com DocumentRoot "/data1/php/***" <Directory "/data1/php/***"> SetOutputFilter DEFLATE Options FollowSymLinks AllowOverride ALL Order allow,deny Allow from all </Directory> </VirtualHost>
5、如果有thinkphp,需要在根目录配置.htaccess
<IfModule mod_rewrite.c> options +FollowSymlinks RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.*)$ index.php/$ [QSA,PT,L] </IfModule>
然后
Apache的配置文件mod_rewrite.so开启
AllowOverride None改为AllowOverride All
重启apache后即可
如果用NGINX的话,需要开启fastcgi,配置如下: