在镜像市场中选择这个,服务器要有独立公网IP

装好了之后,在服务器安全组里添加允许访问80以及8080端口

现在访问IP应该是没有任何响应的,因为nginx还未开启

根据镜像的说明书(官方链接)一些基本的操作命令

 

Apache 配置文件路径:/etc/httpd/

Apache网站主目录:/var/www/html

Apache主配置文件:/etc/httpd/conf/httpd.conf

 

Nginx配置文件路径:/etc/nginx/

Nginx网站主目录:/usr/share/nginx/html

Nginx主配置文件:/etc/nginx/nginx.conf

 

MySQL主配置文件:/etc/my.cnf

 

Nginx启动:systemctl start nginx

Nginx停止:systemctl stop nginx

Nginx重启:systemctl restart nginx

 

输入systemctl start nginx回车之后Nginx开启,再次访问公网IP就是Nginx欢迎页面

 

访问http://ip:8080/phpmyamdin应该是phpmyadmin 登录页面

现在在根目录(/usr/share/nginx/html)下新建一个php文件,并访问它

 但是却不能解析php文件,而是直接把这个文件下载下来了

 

 这个镜像里,应该是包含php-fpm的,先试着启动php-fpm

systemctl start php-fpm

用netstat -ntlp命令查看端口占用情况,看到php-fpm是启动了

 

现在需要更改一下/etc/nginx/nginx.conf文件,加入红框内代码,保存

再次访问http://ip/phpinfo.com,可以访问了

 

posted on 2017-10-03 15:12  longzhankunlun  阅读(471)  评论(0编辑  收藏  举报