服务器挂了,折腾半天Nginx都起不来,不知道咋回事,本人小白用户,求大神帮帮忙!

# nginx -t

nginx: the configuration file /usr/local/nginx/conf/nginx.conf syntax is ok

nginx: configuration file /usr/local/nginx/conf/nginx.conf test is successful

# service nginx start

Starting nginx (via systemctl): Job for nginx.service failed because the control process exited with error code. See "systemctl status nginx.service" and "journalctl -xe" for details.

[FAILED]

# systemctl status nginx

● nginx.service

Loaded: loaded (/usr/lib/systemd/system/nginx.service; bad; vendor preset: disabled)

Active: failed (Result: exit-code) since Wed 2017-06-07 09:22:37 CST; 22s ago

Process: 20047 ExecStartPre=/usr/local/nginx/sbin/nginx -t -c /etc/nginx/nginx.conf (code=exited, status=1/FAILURE)

Jun 07 09:22:37 iZ28qwahedc systemd[1]: Starting nginx.service...

Jun 07 09:22:37 iZ28qwahedc nginx[20047]: nginx: [emerg] open() "/etc/nginx...)

Jun 07 09:22:37 iZ28qwahedc nginx[20047]: nginx: configuration file /etc/ng...d

Jun 07 09:22:37 iZ28qwahedc systemd[1]: nginx.service: control process exit...1

Jun 07 09:22:37 iZ28qwahedc systemd[1]: Failed to start nginx.service.

Jun 07 09:22:37 iZ28qwahedc systemd[1]: Unit nginx.service entered failed s....

Jun 07 09:22:37 iZ28qwahedc systemd[1]: nginx.service failed.

Hint: Some lines were ellipsized, use -l to show in full.

# /usr/local/nginx/sbin/nginx -t -c /etc/nginx/nginx.conf

nginx: [emerg] open() "/etc/nginx/nginx.conf" failed (2: No such file or directory)

nginx: configuration file /etc/nginx/nginx.conf test failed

# journalctl -xe

-- The start-up result is done.

Jun 07 09:38:01 iZ28qwahedc systemd[1]: Starting Session 1059 of user root.

-- Subject: Unit session-1059.scope has begun start-up

-- Defined-By: systemd

-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel

--

-- Unit session-1059.scope has begun starting up.

Jun 07 09:38:01 iZ28qwahedc CROND[20610]: (root) CMD (/root/php.sh)

Jun 07 09:39:01 iZ28qwahedc systemd[1]: Started Session 1060 of user root.

-- Subject: Unit session-1060.scope has finished start-up

-- Defined-By: systemd

-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel

--

-- Unit session-1060.scope has finished starting up.

--

-- The start-up result is done.

Jun 07 09:39:01 iZ28qwahedc systemd[1]: Starting Session 1060 of user root.

-- Subject: Unit session-1060.scope has begun start-up

-- Defined-By: systemd

-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel

--

-- Unit session-1060.scope has begun starting up.

Jun 07 09:39:01 iZ28qwahedc CROND[20619]: (root) CMD (/root/php.sh)

/usr/local/nginx/conf/nginx.conf里的配置

user www www;

worker_processes auto;

error_log /data/wwwlogs/error_nginx.log crit;

pid /var/run/nginx.pid;

worker_rlimit_nofile 65535;

events {

use epoll;

worker_connections 8896;

multi_accept on;

}

http {

include mime.types;

default_type application/octet-stream;

server_names_hash_bucket_size 128;

client_header_buffer_size 32k;

large_client_header_buffers 4 32k;

client_max_body_size 20m;

sendfile on;

tcp_nopush on;

keepalive_timeout 600;

server_tokens on;

tcp_nodelay on;

fastcgi_connect_timeout 300;

fastcgi_send_timeout 1000;

fastcgi_read_timeout 1000;

fastcgi_buffer_size 1024k;

fastcgi_buffers 8 1024k;

fastcgi_busy_buffers_size 1024k;

fastcgi_temp_file_write_size 1024k;

#Gzip Compression

gzip on;

gzip_buffers 16 8k;

gzip_comp_level 6;

gzip_http_version 1.1;

gzip_min_length 256;

gzip_proxied any;

gzip_vary on;

gzip_types

text/xml application/xml application/atom+xml application/rss+xml application/xhtml+xml image/svg+xml

text/javascript application/javascript application/x-javascript

text/x-json application/json application/x-web-app-manifest+json

text/css text/plain text/x-component

font/opentype application/x-font-ttf application/vnd.ms-fontobject

image/x-icon;

gzip_disable "MSIE [1-6]\.(?!.*SV1)";

#If you have a lot of static files to serve through Nginx then caching of the files' metadata (not the actual files' contents) can save some latency.

open_file_cache max=1000 inactive=20s;

open_file_cache_valid 30s;

open_file_cache_min_uses 2;

open_file_cache_errors on;

upstream php_fpm_sock{

server unix:/dev/shm/php-fpm.socket;

server unix:/dev/shm/php-fpm-b.socket;

server unix:/dev/shm/php-fpm-c.socket;

}

fastcgi_next_upstream error timeout invalid_header http_503 http_500;

######################## default ############################

server {

listen 8080;

server_name www.yuming.com yuming.com 115.22.106.133;

#rewrite ^/(.*)$ http://www.yuming.com/$1 permanent;

access_log /data/wwwlogs/access_nginx.log combined;

root /data/wwwroot/www.yuming.com;

index index.html index.htm index.php;

location /nginx_status {

stub_status on;

access_log off;

allow 127.0.0.1;

deny all;

}

location ~ [^/]\.php(/|$) {

try_files $uri =404;

#fastcgi_pass remote_php_ip:9000;

fastcgi_pass unix:/dev/shm/php-cgi.sock;

#fastcgi_pass 127.0.0.1:9000;

fastcgi_index index.php;

include fastcgi.conf;

#server里面fastcgi_pass配置 https://segmentfault.com/q/1010000003707164

#include fastcgi_params;

#fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;

}

location ~ .*\.(gif|jpg|jpeg|png|bmp|swf|flv|ico)$ {

expires 30d;

access_log off;

}

location ~ .*\.(js|css)?$ {

expires 7d;

access_log off;

}

}

########################## vhost #############################

include vhost/*.conf;

}

/usr/local/nginx/conf/vhost/www.yuming.com.conf的配置

server {

listen 80;

server_name www.yuming.com yuming.com 115.22.106.133;

if ($host != 'www.yuming.com') {

rewrite ^/(.*)$ http://www.yuming.com/$1 permanent;

}

access_log /data/wwwlogs/www.yuming.com_nginx.log combined;

index index.html index.htm index.php;

include /usr/local/nginx/conf/rewrite/wordpress.conf;

include /usr/local/nginx/conf/rocket-nginx.conf;

root /data/wwwroot/www.yuming.com;

location ~ [^/]\.php(/|$) {

#fastcgi_pass remote_php_ip:9000;

fastcgi_pass unix:/dev/shm/php-cgi.sock;

fastcgi_index index.php;

include fastcgi.conf;

}

location ~ .*\.(gif|jpg|jpeg|png|bmp|swf|flv|ico)$ {

expires 30d;

access_log off;

}

location ~ .*\.(js|css)?$ {

expires 7d;

access_log off;

}

}

/usr/local/nginx/logs/error.log错误

2017/06/06 21:08:00 [emerg] 6174#0: open() "/etc/nginx/nginx.conf" failed (2: No such file or directory)

2017/06/07 08:30:32 [emerg] 18497#0: open() "/etc/nginx/nginx.conf" failed (2: No such file or directory)

2017/06/07 08:56:29 [emerg] 19210#0: open() "/etc/nginx/nginx.conf" failed (2: No such file or directory)

2017/06/07 09:01:33 [emerg] 19358#0: "fastcgi_pass" directive is duplicate in /usr/local/nginx/conf/nginx.conf:90

2017/06/07 09:14:52 [emerg] 19758#0: open() "/etc/nginx/nginx.conf" failed (2: No such file or directory)

2017/06/07 09:22:37 [emerg] 20047#0: open() "/etc/nginx/nginx.conf" failed (2: No such file or directory)

2017/06/07 09:23:32 [emerg] 20089#0: open() "/etc/nginx/nginx.conf" failed (2: No such file or directory)

2017/06/07 09:26:56 [emerg] 20257#0: open() "/etc/nginx/nginx.conf" failed (2: No such file or directory)

/usr/local/php/etc/php-fpm.conf配置

[global]

pid = run/php-fpm.pid

error_log = log/php-fpm.log

log_level = warning

emergency_restart_threshold = 60

emergency_restart_interval = 60s

process_control_timeout = 5s

daemonize = yes

;;;;;;;;;;;;;;;;;;;;

; Pool Definitions ;

;;;;;;;;;;;;;;;;;;;;

[www]

;listen string设置接受 FastCGI 请求的地址。可用格式为:'ip:port','port','/path/to/unix/socket'。每个进程池都需要设置。

listen = /dev/shm/php-cgi.sock

;listen.backlog int设置 listen(2) 的半连接队列长度。“-1”表示无限制。默认值:-1。

listen.backlog = -1

;listen.allowed_clients string设置允许连接到 FastCGI 的服务器 IPV4 地址。等同于 PHP FastCGI (5.2.2+) 中的 FCGI_WEB_SERVER_ADDRS 环境变量。仅对 TCP 监听起作用。每个地址是用逗号分隔,如果没有设置或者为空,则允许任何服务器请求连接。默认值:any。

listen.allowed_clients = 127.0.0.1

;listen.owner string如果使用,表示设置 Unix 套接字的权限。在Linux中,读写权限必须设置,以便用于 WEB 服务器连接。在很多 BSD 派生的系统中可以忽略权限允许自由连接。默认值:运行所使用的用户和组,权限为 0666。

;listen.owner = www

;listen.group = www

;listen.mode = 0666

;user = www

;group = www

listen.owner = www

listen.group = www

listen.mode = 0660

user = www

group = www

;pm string

;设置进程管理器如何管理子进程。可用值:static,ondemand,dynamic。必须设置。

;static - 子进程的数量是固定的(pm.max_children)。

;ondemand - 进程在有需求时才产生(当请求时,与 dynamic 相反,pm.start_servers 在服务启动时即启动。

;dynamic - 子进程的数量在下面配置的基础上动态设置:pm.max_children,pm.start_servers,pm.min_spare_servers,pm.max_spare_servers。

pm = dynamic

;pm.max_children int pm 设置为 static 时表示创建的子进程的数量,pm 设置为 dynamic 时表示最大可创建的子进程的数量。必须设置。

;该选项设置可以同时提供服务的请求数限制。类似 Apache 的 mpm_prefork 中 MaxClients 的设置和 普通PHP FastCGI中的 PHP_FCGI_CHILDREN 环境变量。

pm.max_children = 50

;pm.start_servers int 设置启动时创建的子进程数目。仅在 pm 设置为 dynamic 时使用。默认值:min_spare_servers + (max_spare_servers - min_spare_servers) / 2。

pm.start_servers = 20

pm.min_spare_servers = 10

pm.max_spare_servers = 30

pm.max_requests = 500

pm.process_idle_timeout = 10s

request_terminate_timeout = 30

request_slowlog_timeout = 0

pm.status_path = /php-fpm_status

slowlog = log/slow.log

rlimit_files = 2048

rlimit_core = 0

catch_workers_output = yes

;env[HOSTNAME] = iZ28qwahedc

env[PATH] = /usr/local/bin:/usr/bin:/bin

env[TMP] = /tmp

env[TMPDIR] = /tmp

env[TEMP] = /tmp

有其他需要看的请留言 我会马上贴上来,谢谢了!

linux系统nginx启动不了,nginx启动不了,求大神帮助!相关推荐

  1. pcie转sata3硬盘不启动_minipcie固态硬盘8g系统加装sata硬盘系统启动不了。求大神解惑。...

    该楼层疑似违规已被系统折叠 隐藏此楼查看此楼 bios设置固态第一启动,bios也识别加装的sata盘,也进入固态系统的启动项选择界面了,说明已经准备从固态启动了,但是过了启动项选择界面后就滴一声重启 ...

  2. linux下安装两个nginx教程,在linux系统下安装两个nginx的简单方法

    在linux系统下安装两个nginx的简单方法 发布时间:2017-03-09 12:08 来源:互联网 当前栏目:web技术类 在linux下安装nginx的时候,一般在./configure的阶段 ...

  3. android chrome无法运行,Android 测试 Chrome 浏览器能正常启动 Chrome 浏览器,但是不能进行操作,求大神!!...

    chrome 能在 android 手机上启动 但是就是不能打开网站.或者操作 chrome 里面的按钮.求大神帮忙看下 ,万分感谢. 代码 : private AppiumDriver ab =nu ...

  4. 谈谈Linux系统CP命令如何做到0.2秒复制100G大文件?

    谈谈Linux系统CP命令如何做到0.2秒复制100G大文件? 文章目录 谈谈Linux系统CP命令如何做到0.2秒复制100G大文件? cp 引发的思考 文件系统 为什么 cp 那么快? 结语 cp ...

  5. 卡达8梯控系统怎么破解求大神指点迷津谢谢!!!

    这里写自定义目录标题 欢迎使用Markdown编辑器 新的改变 功能快捷键 合理的创建标题,有助于目录的生成 如何改变文本的样式 插入链接与图片 如何插入一段漂亮的代码片 生成一个适合你的列表 创建一 ...

  6. 软件开发Linux环境下,java通过JNA调用so报错,求大神解答,感激不尽。

    软件开发Linux环境下,java通过JNA调用so报错,求大神解答,感激不尽. 图片说明 最佳答案: 专家已采纳 先用c等调用一下so,看函数能否正确调用 文章来源:https://ask.csdn ...

  7. 在linux系统下安装两个nginx以及启动、停止、重起

    如果没有安装过nginx请看:linux下nginx部署以及配置详解 1.第一个nginx已经安装完成后,现在安装第二个nginx 启动:sudo /usr/sbin/nginx3 重起:sudo / ...

  8. Linux系统:centos7下搭建Nginx和FastDFS文件管理中间件

    一.FastDFS简介 1.基础概念 FastDFS是一个开源的轻量级分布式文件系统,它对文件进行管理,功能包括:文件存储.文件同步.文件上传.文件下载等,解决了大容量存储和负载均衡的问题. 2.环境 ...

  9. Linux系统下Kafka的搭建与启动

    这是我在CSDN上写的第一篇文章,从今天开始准备记录一些自己日常开发中遇到的问题以及技术总结. 由于之前项目中用到了kafka中间件,自己也比较感兴趣,所以准备利用个人时间研究一下这个kafka,废话 ...

最新文章

  1. 最全中文leetcode解题攻略:思路知识点代码...搞定AI大厂笔试
  2. linux:进程占用的端口,在linux中查看进程占用的端口号
  3. WINCE6.0+2443系统大概过10分钟进入sleep状态
  4. html禁止文本选择,[译]用CSS来禁止文本选择
  5. pythontkinter控件单选框怎么判断是否被选中_Python GUI编程(Tkinter)Radiobutton单选框控件...
  6. 基于stm32简易计算机电路图,基于STM32的简易电子计算器设计与实现(DOC).doc
  7. 应用程序池优化配置方案(IIS7、IIS7.5)
  8. Hadoop之HDFS简介
  9. python读取数据库后生成网页_python查询数据库并将结果按照格式生成HTML页面展示...
  10. facebook开源的prophet时间序列预测工具---识别多种周期性、趋势性(线性,logistic)、节假日效应,以及部分异常值
  11. 你能熟练使用Dictionary字典和List列表吗?
  12. HTML写一个简单网页
  13. 高等数学(第七版)同济大学 习题5-2 个人解答
  14. pm2启动express项目
  15. Linux系统自动校准时间
  16. JDBC SSL连接MySQL
  17. 【微信小程序模板】可以用微信小程序模板制作小程序吗?
  18. 达内学java要多久_自学Java需要学多久才能达到工作的程度
  19. vue 所见即所得_用于Vue.js的轻量级所见即所得编辑器
  20. 华为交换机基本配置之Telnet和SSH方式远程登录

热门文章

  1. [ASP.NET 控件实作 Day12] 继承 TBActiveX 重新改写 TBMediaPlayer 控件
  2. julia有没有希望超越python_未来5-10年,Julia会替代Python成为量化投资热门语言吗?...
  3. 技术开发(委托)合同怎么写?
  4. Windows配置tomcat环境
  5. JQuery $.each遍历JSON字符串报Uncaught TypeError:Cannot use 'in' operator to search for
  6. 微型计算机控制技术试卷B,微型计算机控制技术试卷b..doc
  7. oracle可以注入吗,ORACLE 注入
  8. substr php,PHP substr() 函数
  9. [转载] java 计算协方差_Java的深度:通过协方差暴露的API泄漏
  10. NM的完整形式是什么?