We are happy to announce that Vesta is back under active development as of 25 February 2024. We are working on v1 candidate and expect to engage more with the community over the coming months. We are committed to open source, and we encourage contributors to help us build the future of Vesta.
nginx restart failed
nginx restart failed
I received this email alert from vestacp
server.xxx.com: nginx restart failed
Any idea of this problem and how to solve it?
regards
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
regards
Re: nginx restart failed
Code: Select all
cat /etc/nginx/conf.d/01_caching_pool.conf
?
Re: nginx restart failed
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;
Re: nginx restart failed
Check, there is in your config "/var/cache/nginx/xxx.es" and where path repeats twice.
Re: nginx restart failed
Thanks a lot.skurudo wrote:Check, there is in your config "/var/cache/nginx/xxx.es" and where path repeats twice.
-
- Posts: 4
- Joined: Mon Jun 29, 2015 11:01 pm
Re: nginx restart failed
I hope this helps
Open
and remove all the duplicate lines. And then restart nginx.
Open
Code: Select all
/etc/nginx/conf.d/01_caching_pool.conf
Re: nginx restart failed
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.
Would be good to avoid writing twice a line in that file and avoid crashes.
Re: nginx restart failed
^ 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
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
Re: nginx restart failed
Added a bug - https://bugs.vestacp.com/issues/149
Thanks
Thanks
-
- Posts: 4
- Joined: Wed Feb 17, 2016 11:22 am
Re: nginx restart failed
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;
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.
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
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.