Nginx:
1. 安装 nginx yum 源
- rpm -Uvh http://nginx.org/packages/centos/7/noarch/RPMS/nginx-release-centos-7-0.el7.ngx.noarch.rpm
- 2.yum install nginx -y
- 3.mv /etc/nginx/conf.d/default /etc/nginx/conf.d/vhost.conf
- VIM vhost.conf
- server {
- listen 80;
- server_name www.lh.com;
- location / {
- root /usr/share/nginx/html;
- index index.HTML index.htm;
- }
- error_page 500 502 503 504 /50x.HTML;
- location = /50x.HTML {
- root /usr/share/nginx/HTML;
- }
- location ~ \.PHP$ {
- fastcgi_pass 127.0.0.1:9000;
- fastcgi_index index.PHP;
- fastcgi_param SCRIPT_FILENAME /PHP/nginx/web/$fastcgi_script_name;
- include fastcgi_params;
- }
- }
- 4.mkdir /PHP/nginx/Web -pv
VIM index.PHP
- <?PHP
- phpinfo();
- ?>
用于测试 PHP 是否部署成功
- 5.yum install PHP-fpm -y
- VIM /etc/PHP-fpm-d/www.conf
- user=nginx
- group=ngnx
- 6.yum install mariadb-server mariadb -y
略
7.systemctl start nginx mariadb PHP-fpm
来源: http://www.bubuko.com/infodetail-3416884.html