Hi,
On 2014-12-30 on 05:30 CET Tuyosi Takesima wrote :
> thanks for good advise .
> surely no need to compile to obtain basic auth .
>
> my test nginx.conf is next .
>
> cat /etc/nginx
> /nginx.conf
>
>
> worker_processes 1;
> worker_rlimit_nofile 1024;
> events {
> worker_connections 800;
> }
>
> http {
> include mime.types;
> default_type application/octet-stream;
> index index.html index.htm;
> keepalive_timeout 65;
> server_tokens off;
>
> server {
> listen 80;
> listen [::]:80
You are missing a ; here------^
> server_name s.sun.ddns.vc;
> root /var/www/htdocs;
> error_page 500 502 503 504 /50x.html;
>
> auth_basic "Restricted";
> auth_basic_user_file /var/www/1/.htpasswd;
> location = /50x.html {
> root /var/www/htdocs;
> }
> }
> }
>
>
> when intenal server error occur .i overcom by
> ' chown -R www /var/www ' .
> is this right ?
No. You just need to check the entries in /var/www/logs/error.log
where you will probably find something like
*1 open() "/1/.htpasswd" failed (13: Permission denied),
and so you should check the ownership of /var/www/1/.htpasswd .
This file must be readable by user www. It should be something like
$ ls -l /var/www/1/.htpasswd
-r-------- 1 www daemon 67 Dec 30 05:50 .htpasswd
If you created .htpasswd as root or another user the ownership will
probably be wrong.
No need to change the ownership of the whole tree under /var/www .
>
> ------
> tuyosi
Cheers,
rru