# nginx log file not created



## fefaya (Jun 2, 2011)

Hi all,

I use FreeBSD 8.2 and am installing nginx using ports. I have problems where the access_log file is not created (I didn't check error_log file yet). I have tried to put log file in many directories, /www/logs, /tmp, /home/username/logs, each directory already *chown*ed to root:www, www:www, username:username, and *chmod  a+rwx* directory_name.

The similar configuration file is working fine on Ubuntu 10.04, Debian 5, Debian 6.

Any suggestions?

Thanks


----------



## quintessence (Jun 2, 2011)

Hello,

Paste your config.


----------



## fefaya (Jun 2, 2011)

quintessence said:
			
		

> Hello,
> 
> Paste your config.




```
server {
        server_name  us1.mydomain.tk;
        listen   80;
	autoindex on;
        error_log   /home/username/logs/us1.mydomain.tk-error.log;
        access_log  /home/username/logs/us1.mydomain.tk-access.log;
        location / {
               root   /home/username/www/us1.mydomain.tk/htdocs;
        }
}
```


----------



## quintessence (Jun 2, 2011)

Hello,

Try to replace your access log line with:


```
access_log /var/log/nginx-access.log;
```

and make sure there is no any hanging nginx processes on daemon restart.
For example to be 100% sure you can perform:

`# pkill -9 nginx`

and then start it again:

`# /usr/local/etc/rc.d/nginx start`

(I assume you have already placed 
	
	



```
nginx_enable="YES"
```
 in /etc/rc.conf.)

EDIT: Also make sure that from the machine you try opening your domain name, there is no line in hosts pointing your domain name to different IP address from the actual from DNS zone. This is no log related "issue" btw, because on daemon restart log file is created automatically if directory you placed your log file exists (and directory is) with default UNIX rights.


----------

