nginx.conf rewritten

Maxim Dounin mdounin at mdounin.ru
Fri Jun 26 20:58:39 MSD 2009


Hello!

On Fri, Jun 26, 2009 at 05:27:10PM +0100, Pedro Mata-Mouros Fonseca wrote:

> Yes, I'm compiling from sources. I found out what the problem is:
>
> $ ./configure --prefix=/servers/nginx-0.7.60 --conf-path=/etc/ngix.conf
> $ make
> # make install
> [SNIP]
> test -f '/etc/ngix.conf'                || cp conf/nginx.conf '/etc'
> cp conf/nginx.conf '/etc/nginx.conf.default'
> test -d '/servers/nginx-0.7.60/logs'            || mkdir -p '/servers/ 
> nginx-0.7.60/logs'
> test -d '/servers/nginx-0.7.60/logs' ||                 mkdir -p '/ 
> servers/nginx-0.7.60/logs'
> test -d '/servers/nginx-0.7.60/html'            || cp -r html '/ 
> servers/nginx-0.7.60'
> test -d '/servers/nginx-0.7.60/logs' ||                 mkdir -p '/ 
> servers/nginx-0.7.60/logs'
> make[1]: Leaving directory `/servers/sources/nginx-0.7.60'
>
> In the configure line I made a mistake and stated /etc/ngix.conf as the 
> config file (notice the lack of the n). When installing, the script stats 
> /etc/ngix.conf, and as it doesn't exist, it copies the default 
> nginx.conf, not changing its name. Since I use a init.d script for 
> starting up nginx, configured to use /etc/nginx.conf, this file always is 
> replaced in this situation on every new install.
>
> It's not really important, maybe it can be fixed when somebody has 1  
> minute spare.
> Thanks.

Thank you, nice catch.  It's regression introduced in 0.6.6.  
Patch attached.

Maxim Dounin

>
>
> On Jun 26, 2009, at 4:11 PM, Jim Ohlstein wrote:
>
>> That has never happened on my servers. I use a different path but that 
>> should not matter.
>>
>> Are you compiling yourself?
>>
>> Jim
>>
>> ------Original Message------
>> From: Pedro Mata-Mouros Fonseca
>> Sender: owner-nginx at sysoev.ru
>> To: nginx at sysoev.ru
>> ReplyTo: nginx at sysoev.ru
>> Subject: nginx.conf rewritten
>> Sent: Jun 26, 2009 11:02 AM
>>
>> Greetings,
>>
>> It seems that /etc/nginx.conf gets replaced by the default in each new
>> nginx install. Do you confirm this? Any chance it doesn't replace that
>> file, if it exists already, by default?
>>
>> Thank you.
>>
>> Pedro.
>>
>>
>>
>> Sent from my Verizon Wireless BlackBerry
>>
>>
>
>
-------------- next part --------------
diff --git a/auto/install b/auto/install
--- a/auto/install
+++ b/auto/install
@@ -102,7 +102,7 @@ install:	$NGX_OBJS${ngx_dirsep}nginx${ng
 		'\$(DESTDIR)$NGX_CONF_PREFIX/fastcgi_params.default'
 
 	test -f '\$(DESTDIR)$NGX_CONF_PATH' \
-		|| cp conf/nginx.conf '\$(DESTDIR)$NGX_CONF_PREFIX'
+		|| cp conf/nginx.conf '\$(DESTDIR)$NGX_CONF_PATH'
 	cp conf/nginx.conf '\$(DESTDIR)$NGX_CONF_PREFIX/nginx.conf.default'
 
 	test -d '\$(DESTDIR)`dirname "$NGX_PID_PATH"`' \


More information about the nginx mailing list