Centos安装nginx

先安装nginx 软件源

touch  /etc/yum.repos.d/nginx.repo
vi /etc/yum.repos.d/nginx.repo
[nginx]
name=nginx repo
baseurl=http://nginx.org/packages/centos/$releasever/$basearch/
gpgcheck=0
enabled=1

安装nginx、php、php-fpm、php-mysql

yum install nginx php php-fpm php-mysql

启动nginx php-fpm

systemctl start nginx
systemctl start php-rpm

浏览器打开ip

Centos安装nginx_第1张图片
Paste_Image.png

安装完成

你可能感兴趣的:(Centos安装nginx)