vi /etc/httpd/conf/httpd.conf
文件末尾加上
<VirtualHost *:80>
DocumentRoot “/var/www/html”
ServerName www.yyenglish.cn
ServerAlias yyenglish.cn
ProxyRequests Off
ProxyPassMatch ^/(.*.php)$ fcgi://127.0.0.1:9000/var/www/html/$1
# If the php file doesn’t exist, disable the proxy handler.
# This will allow .htaccess rewrite rules to work and
# the client will see the default 404 page of Apache
RewriteCond %{REQUEST_FILENAME} .php$
RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_URI} !-f
RewriteRule (.*) – [H=text/html]
<Directory “/var/www/html”>
Options none
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
systemctl restart httpd // 重启 httpd 服务