Vesta Control Panel - Forum

Community Forum

Skip to content

Advanced search
  • Quick links
    • Main site
    • Github repo
    • Google Search
  • FAQ
  • Login
  • Register
  • Board index Main Section General Discussion RHEL/CentOS
  • Search

nginx restart failed

RHEL/CentOS related topics
Locked
  • Print view
Advanced search
13 posts
  • 1
  • 2
  • Next
juanfree
Posts: 3
Joined: Sun Jan 11, 2015 7:40 pm

nginx restart failed

Post by juanfree » Sat Nov 14, 2015 10:11 pm

I received this email alert from vestacp

server.xxx.com: nginx restart failed

Code: Select all

nginx: [emerg] the same path name "/var/cache/nginx/xxx.es" used in /etc/nginx/conf.d/01_caching_pool.conf:2 and in /etc/nginx/conf.d/01_caching_pool.conf:3
nginx: configuration file /etc/nginx/nginx.conf test failed
nginx: [emerg] the same path name "/var/cache/nginx/xxx.es" used in /etc/nginx/conf.d/01_caching_pool.conf:2 and in /etc/nginx/conf.d/01_caching_pool.conf:3
nginx: configuration file /etc/nginx/nginx.conf test failed
Any idea of this problem and how to solve it?

regards
Top

Stesh
Posts: 348
Joined: Mon Nov 09, 2015 5:52 pm

Os: CentOS 6x
Web: nginx + php-fpm
Re: nginx restart failed

Post by Stesh » Sat Nov 14, 2015 11:18 pm

Code: Select all

cat /etc/nginx/conf.d/01_caching_pool.conf

?
Top

juanfree
Posts: 3
Joined: Sun Jan 11, 2015 7:40 pm

Re: nginx restart failed

Post by juanfree » Sun Nov 15, 2015 1:47 am

Stesh wrote:

Code: Select all

cat /etc/nginx/conf.d/01_caching_pool.conf

?

Code: Select all

[root@server ~]# cat /etc/nginx/conf.d/01_caching_pool.conf
proxy_cache_path /var/cache/nginx/xxx.com levels=2 keys_zone=xxx.com:10m inactive=60m max_size=512m;
proxy_cache_path /var/cache/nginx/xxx.es levels=2 keys_zone=xxx.es:10m inactive=60m max_size=512m;
Top

skurudo
VestaCP Team
Posts: 8099
Joined: Fri Dec 26, 2014 2:23 pm
Contact:
Contact skurudo
Website Facebook Google+ Skype
Twitter

Re: nginx restart failed

Post by skurudo » Sun Nov 15, 2015 5:05 am

Check, there is in your config "/var/cache/nginx/xxx.es" and where path repeats twice.
Top

juanfree
Posts: 3
Joined: Sun Jan 11, 2015 7:40 pm

Re: nginx restart failed

Post by juanfree » Sun Nov 15, 2015 9:36 am

skurudo wrote:Check, there is in your config "/var/cache/nginx/xxx.es" and where path repeats twice.
Thanks a lot.
Top

abrarahmed
Posts: 4
Joined: Mon Jun 29, 2015 11:01 pm

Re: nginx restart failed

Post by abrarahmed » Sun Jan 24, 2016 4:57 pm

I hope this helps
Open

Code: Select all

/etc/nginx/conf.d/01_caching_pool.conf
and remove all the duplicate lines. And then restart nginx.
Top

erm3nda
Posts: 9
Joined: Sun May 24, 2015 8:42 am

Re: nginx restart failed

Post by erm3nda » Thu Jan 28, 2016 10:49 pm

Anyone know wich part of the code does that disk write?
Would be good to avoid writing twice a line in that file and avoid crashes.
Top

pandabb
Posts: 192
Joined: Sat Aug 08, 2015 3:03 am

Re: nginx restart failed

Post by pandabb » Mon Feb 08, 2016 6:37 pm

^ YEs everytime i change template and rebuild user nginx stop loading due to the duplicate code below

proxy_cache_path /var/cache/nginx/acentura.com levels=2 keys_zone=...................

How to fix this way no downtime when i change template.

--update i found this on the template i think this is it ? which line of code here

Code: Select all

#!/bin/bash

user=$1
domain=$2
ip=$3
home=$4
docroot=$5

str="proxy_cache_path /var/cache/nginx/$domain levels=2"
str="$str keys_zone=$domain:10m inactive=60m max_size=512m;"
echo "$str" >> /etc/nginx/conf.d/01_caching_pool.conf

Top

skurudo
VestaCP Team
Posts: 8099
Joined: Fri Dec 26, 2014 2:23 pm
Contact:
Contact skurudo
Website Facebook Google+ Skype
Twitter

Re: nginx restart failed

Post by skurudo » Tue Feb 16, 2016 7:20 pm

Added a bug - https://bugs.vestacp.com/issues/149
Thanks
Top

djattitude
Posts: 4
Joined: Wed Feb 17, 2016 11:22 am

Re: nginx restart failed

Post by djattitude » Wed Feb 17, 2016 11:29 am

The bash script is missing the grep check that the master RHEL version has. you will still need to remove the duplicates so nginx can start again, but once done, rebuilds will no longer create duplicates.

Replace /usr/local/vesta/data/templates/web/nginx/caching.sh with the following;

Code: Select all

#!/bin/bash

user=$1
domain=$2
ip=$3
home=$4
docroot=$5

str="proxy_cache_path /var/cache/nginx/$domain levels=2"
str="$str keys_zone=$domain:10m inactive=60m max_size=512m;"
conf='/etc/nginx/conf.d/01_caching_pool.conf'
if [ -e "$conf" ]; then
    if [ -z "$(grep "=${domain}:" $conf)" ]; then
        echo "$str" >> $conf
    fi
else
    echo "$str" >> $conf
fi
From: http://c.vestacp.com/0.9.8/rhel/nginx-c ... caching.sh

Devs: http://c.vestacp.com/0.9.8/rhel/7/templ ... caching.sh, http://c.vestacp.com/0.9.8/rhel/6/templ ... caching.sh and http://c.vestacp.com/0.9.8/rhel/5/templ ... caching.sh need updating.

Edit: updated bug report. The files used by the installer (eg, c.vestacp.com/0.9.8/rhel/7/templates.tar.gz) contains the out-of-date caching.sh bash script.
Top


Locked
  • Print view

13 posts
  • 1
  • 2
  • Next

Return to “RHEL/CentOS”



  • Board index
  • All times are UTC
  • Delete all board cookies
  • The team
Powered by phpBB® Forum Software © phpBB Limited
*Original Author: Brad Veryard
*Updated to 3.2 by MannixMD
 

 

Login  •  Register

I forgot my password