[erlang-bugs] httpd configuration file auth_user_file and auth_group_file location

Nicolas Charpentier <>
Mon Aug 18 23:11:08 CEST 2008

In the httpd page of the inets reference manual (R12B3) , I can read 
that authentication properties for each directory can be configured 
using auth_user_file and auth_group_file.
The documentation is saying that the filename can be either absolute, 
either relative to the server_root. (I understand that it's refering to 
the server_root attribute of the httpd service). However, those 2 
attributes always refer to absolute path or relative to CURRENT directory.

I was using this code to start httpd

start() ->
     Web_server_config =
	[{server_name, httpd_socket:resolve()},
	 {port, 8090},
	 {server_root, "/opt/my_server"},
	 {document_root, "/opt/my_server"},
	 {server_admin, ""},
	 {error_log, "error.log"},
	 {security_log, "security.log"},
	 {transfer_log, "transfer.log"},
	 {directory, {"/", [{auth_type, dets},
			    {auth_user_file, "users.lst"},
			    {auth_group_file, "groups.lst"},
			    {require_group, ["admin"]},
			    {auth_name, "Administration"},
			    {auth_access_password, "NoPassword"}
     {ok, Httpd} = inets: start (httpd, Web_server_config)

Authentication access never worked until I put the file users.lst and 
groups.lst in the directory from which I started the VM.

Looking at the code, I can see in
$ERL_DIR/lib/inets/src/http_server/src:mod_auth_plain.erl and
$ERL_DIR/lib/inets/src/http_server/src:mod_auth_dets.erl that
you never refer to the server_root configuration parameter.

At the opposite, in mod_log.erl you have a case on filename:pathtype/1 
to know where to store log files.

Nicolas Charpentier

More information about the erlang-bugs mailing list