Unbuntu16.04 Nginx + php + mysql Web服务器搭建

下决心不再用lamp的集成包了,自己搞一个出来。 Nginx php mysql Nginx首先安装使用 apt 安装nginx$ sudo apt install nginx然而由于之前安装过nginx,卸载还不干净,导致配置文件读取失败,出现错误: Job for nginx.service failed because the control process exited with error code. See "systemctl status nginx.service" and "journalctl -xe" for details. invoke-rc.d: initscript nginx, action "start" failed. ● nginx.service - A high performance web server and a reverse proxy server Loaded: loaded (/lib/systemd/system/nginx.service; enabled; vendor preset: enabled) Active: failed (Result: exit-code) since 四 2017-03-09 00:06:13 CST; 7ms ago Process: 4540 ExecStartPre=/usr/sbin/nginx -t -q -g daemon on; master_process on; (code=exited, status=1/FAILURE) 3月 09 00:06:13 hardy-Inspiron-5547 systemd[1]: Starting A high performance.... 3月 09 00:06:13 hardy-Inspiron-...     阅读全文
Liebes's avatar
Liebes 3月 10, 2017

Centos 7 Nginx + php + mysql Web服务器搭建

安装Nginx 安装php5 安装php7 安装mysql 搭建nginx服务在所有工作之前,先更新一下yum咯$ yum install yum $ yum -y update然后使用yum安装nginx# 如果没有nginx包尝试使用下面的命令添加 $ yum install epel-release $ yum install nginx # 启动 $ systemctl start nginx # 开机自启 $ systemctl enable nginx然后就可以在浏览器输入http://127.0.0.1,会看到nginx的欢迎界面,如果是远程服务器请输入以下命令查看ip$ ip addr show eth0 | grep inet | awk '{ print $2; }' | sed 's/\/.*$//' # 或者 $ curl http://icanhazip.com—安装php5使用yum安装,十分简单。$ yum install php php-mysql php-fpm安装完成后,修改 /etc/php.ini 文件,找到 cgi.fix_pathinfo=0 这一行,取消注释并修改成0然后修改 /etc/php-fpm.d/www.conf 文件,需要修改一下几个地方listen = /var/run/php-fpm/php-fpm.sock listen.owner = nobody listen.group = nobody user = ...     阅读全文
Liebes's avatar
Liebes 1月 21, 2017