apache 2.4 配置 php-fpm

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 服务

 

 

 

 

 

相关推荐

暂无评论

发表评论

微信扫一扫,分享到朋友圈

apache 2.4 配置  php-fpm