yum install nginx -y
修改
vi /etc/nginx/conf.d/default.conf,去除对 IPv6 地址的监听
server {
listen 80 default_server;
# listen [::]:80 default_server;
server_name _;
root /usr/share/nginx/html;
# Load configuration files for the default server block.
include /etc/nginx/default.d/*.conf;
location / {
}
error_page 404 /404.html;
location = /40x.html {
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
}
}
nginx
chkconfig nginx on
http://139.199.174.103
yum install mysql-server -y
service mysqld restart
/usr/bin/mysqladmin -u root password \'zaqUqkYc\'
chkconfig mysqld on
yum install php php-fpm php-mysql -y
service php-fpm start
netstat -nlpt | grep php-fpm
chkconfig php-fpm on
在 vi /etc/nginx/conf.d/php.conf 目录中新建一个名为 php.conf 的文件
server {
listen 8000;
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
location ~ .php$ {
root /usr/share/php;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}
service nginx restart
vi /usr/share/php/info.php
<?php phpinfo(); ?>
此时,访问 http://139.199.174.103:8000/info.php 可浏览到我们刚刚创建的 info.php 页面了