linux系统nginx启动不了,nginx启动不了,求大神帮助!

服务器挂了,折腾半天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

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

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/552615.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

linux 黑屏后死机,如何修复各种各样的黑屏死机

每次我们打开这些设备,我们都希望我们生活中的科技能发挥作用。当他们不能工作时,会让我们非常沮丧,尤其是当我们不知道如何解决问题时。所谓的“死亡黑屏”在操作系统之间很常见,当您打开机器,但屏幕空白。有时监视器…

c语言atof字母,C语言字符转换之atof()

现在看下强大的atof()函数,哇哈哈:/* Convert a string to a double. */doubleatof (const char *nptr){return strtod (nptr, (char **) NULL);}#if HAVE_CONFIG_H# include #endif#include #ifndef errnoextern int errno;#endif#include #if defined …

cmd文件 c语言的段,对于TMS320F2812的CMD文件的理解

1.COFF格式要谈CMD文件,首先不可避免的要谈下COFF格式,COFF格式是通用目标文件格式(Common Object FileFormat)的缩写,它是一种流行的二进制可执行文件格式,在DSP里二进制可执行文件包括库文件(.lib)、目标文件(.obj)和最终可执行…

w ndows7与XP哪个好,windows7和xp哪个好 windows7好用吗

经常可以在电脑百事各个QQ群中看到电脑爱好者朋友问各种各样的电脑问题,有的朋友问的问题特别搞笑,其实很多问题都问的等于没人能够被你满意答案,比如有人问过一些比较搞笑的问题,如谁能给介绍一个500G内存,800元的独立…

android点击事件的优先级,Android事件体系全面总结+实践分析,系列篇

前言在这一个月里,我利用闲余的时间看了下最近Android职业发展这块该怎么选择?这个问题各位大神的回答都非常透彻,相信对大家或多或少都在一定程度上有很大的帮助,今天在这里写这篇文章更多的是想以我开发十年的工作经历&#xff…

android各组件翻译,Android App框架指南(译文)

该系列文章是对Android推出的架构组件相关文章,按作者自己理解来翻译的,同时标记有作者自己一些简单笔记。如果读者发现文中有翻译不准确的地方,或者理解错误的地方,请不吝指教。源自Android官方Guide to app architecturel princ…

signature=27ba8feff228d8babc1d1762f8da4445,Embedding digital signatures into digital payloads

摘要:A file may be transferred from one processor-based system to another. The file may include executable binary data together with an integrated digital signature. Each time a receiving processor-based system boots, the digital signature is au…

鸿蒙手机是个噱头,华为鸿蒙不是谈判噱头 必要时会应用手机当中!

7月30日,华为2019年上半年财报发布会上,华为董事长梁华在接受媒体采访时回应称,“鸿蒙”系统不是用来应对与美国谈判的噱头。今年5月,美国商务部将华为列入“实体清单”后不久,华为一系列“备胎”方案开始浮出水面&…

360浏览器html5无法播放,win7系统360浏览器播放不了视频的解决方法

今天和大家分享一下win7系统360浏览器播放不了视频问题的解决方法,在使用win7系统的过程中经常不知道如何去解决win7系统360浏览器播放不了视频的问题,有什么好的办法去解决win7系统360浏览器播放不了视频呢?小编教你只需要 1、视频无法正常…

计算机网络技术专业发展现状,计算机网络技术的发展现状和前景

摘 要:计算机和网络目前已经在我国社会得到普及化应用,对人们生活的方方面面和社会各项工作的开展都产生了革命性的巨大影响。但是,也不得不看到目前我国计算机网络技术发展中仍然存在一些问题,例如计算机网络技术创新性应用和开发…

计算机专业论文要交源代码吗,计算机毕业论文源代码.doc

计算机毕业论文源代码.doc计算机毕业论文源代码计算机毕业论文源代码:会计信息生产社会化仿真系统1.折旧年限表(company_zjnx)建表源程序:CREATE TABLE [dbo].[company_zjnx] ([cname] [char] (40) COLLATE Chinese_PRC_CI_AS NULL ,[obj_name] [char] (…

广西高职计算机网络技术,计算机网络技术专业考试大纲-广西职业技术学院.DOC...

计算机网络技术专业考试大纲-广西职业技术学院2011年广西职业技术学院面向中等职业学校毕业生对口招生考试《计算机网络技术》专业课考试大纲一.考试性质广西职业技术学院面向中等职业学校毕业生对口招生《计算机网络技术》专业测试是由已参加2011年普通高考报名的我…

html设置数字显示位数,数字万用表的显示位数和精度

数字万用表的显示位数和精度今天,我们来聊一聊数字万用表的位数和精度,到底什么是四位半?分辨率到底是哪个数?万用表的精度要如何计算?万用表的显示位数计数显示:万用表的显示位数范围。位数显示&#xff1…

r导出html怎么保存,做植物谱系图,用Phylomatic软件将网页中的输出结果拷贝到文本文件中, 并另存为phylo...

我是一个本科生,大四做毕设,要用到Phylomatic在线软件,我对计算机不是很熟,我的专业也只是环境科学,跟植物无关,所以对此非常不熟悉,用R做完plantlist后,再用Phylomatic在线软件&…

学计算机广东2B大学,2021年广东省较好的2B大学排名,广东2B大学排名出炉

广东省较好的2B大学排名,广东2B大学排名出炉广东2B大学排名:北京师范大学珠海分校珠海市外生源投档线文科达541分,理科达519分;广东外语外贸大学南国商学院投档线文科534分,理科513分;吉林大学珠海学院珠海市外生源投档线文科达531分&#xf…

w7提示无法关闭计算机,win7关不了机怎么回事?老司机教你怎么解决电脑关不了机...

win10系统的到来,慢慢的曾经称霸多年的xp已经退出了系统的舞台了,逐渐的win7也将重演历史,不过说到这个win7系统可以说是微软革命性的系统之一,其稳定、友好的界面,受到广大用户的拥戴,不过win7也有一些让人…

sendmail发送html邮件,尝试使用sendmail发送/发送html电子邮件,但显示电子邮件的源代码...

我试图在PHP中发送HTML电子邮件,但它始终显示电子邮件程序中电子邮件的源代码。但它应该将html电子邮件呈现为html,而不是将源代码显示为电子邮件内容。尝试使用sendmail发送/发送html电子邮件,但显示电子邮件的源代码我把我的邮件是这样的&a…

计算机语言史话论文,【论文节选】自然语言处理发展历史。

说实话看完文章有点失望,作者带有一贯的学术吹嘘风,就像吹嘘云计算,物联网等等。谈到现状,只字不提问题,一句话“一旦自然语言处理的研究获得成功,那么机器将能够进行思考,人类将得到继工业革命…

vue开发跨平台应用

native script 开发android和ios的框架,js引擎和本地交互没有webview,更加高效 npm install -g nativescript ns create my-app --js ns create my-app --template typescript ns create my-app --template angular ns create my-app --template vue 编译 ns build android …

杭州招聘计算机专业毕业生,毕业季必看!杭州高校毕业生就业情况:这些专业最吃香!这个岗位最缺人!...

原标题:毕业季必看!杭州高校毕业生就业情况:这些专业最吃香!这个岗位最缺人!夏天,就是毕业的季节有一群人要离开校园,走上社会也有一群人要面临填志愿、选专业在杭州,什么专业最热门…