The yaws server fails to start after installing because:
- It expects the directory ${prefix}/tmp to exist, and the installation script does not create it.
Chaz:/opt/local/etc brent$ /opt/local/bin/yaws -i
Erlang (BEAM) emulator version 5.5.3 [source] [async-threads:0] [hipe] [kernel-poll:false]
Eshell V5.5.3 (abort with ^G)
1>
=INFO REPORT==== 12-Mar-2007::23:33:43 ===
Yaws: Using config file ./yaws.conf
=ERROR REPORT==== 12-Mar-2007::23:33:43 ===
FATAL {'EXIT',{{case_clause,["/opt/local/tmp"]},
[{yaws_config,fload,7},
{yaws_config,load,1},
{yaws_server,init,1},
{gen_server,init_it,6},
{proc_lib,init_p,5}]}}
=INFO REPORT==== 12-Mar-2007::23:33:43 ===
application: yaws
exited: {shutdown,{yaws_app,start,[normal,[]]}}
type: permanent
{"Kernel pid terminated",application_controller,"{application_start_failure,yaws,{shutdown,{yaws_app,start,[normal,[]]}}}"}
Crash dump was written to: erl_crash.dump
Kernel pid terminated (application_controller) ({application_start_failure,yaws,{shutdown,{yaws_app,start,[normal,[]]}}})
Chaz:/opt/local/etc brent$ ls -l /opt/local/
- It expects the user to have admin priviledges, and it does not create a user with sufficient rights to run the service:
Chaz:/opt/local/etc brent$ /opt/local/bin/yaws -i
Erlang (BEAM) emulator version 5.5.3 [source] [async-threads:0] [hipe] [kernel-poll:false]
Eshell V5.5.3 (abort with ^G)
1>
=INFO REPORT==== 12-Mar-2007::23:34:30 ===
Yaws: Using config file ./yaws.conf
=ERROR REPORT==== 12-Mar-2007::23:34:31 ===
Cannot open "/opt/local/var/log/yaws/Chaz.local:8000.access"
=ERROR REPORT==== 12-Mar-2007::23:34:31 ===
Cannot open "/opt/local/var/log/yaws/localhost:8000.access"
=ERROR REPORT==== 12-Mar-2007::23:34:31 ===
Cannot open "/opt/local/var/log/yaws/Chaz.local.access"
=ERROR REPORT==== 12-Mar-2007::23:34:31 ===
Cannot open /opt/local/var/log/yaws/auth.log
yaws:Add path "/opt/local/lib/yaws/ebin"
yaws:Add path "/opt/local/lib/yaws/examples/ebin"
yaws:Running with id=default
Running with debug checks turned on (slower server)
Logging to directory "/opt/local/var/log/yaws"
=ERROR REPORT==== 12-Mar-2007::23:34:31 ===
Failed to create/manipulate the ctlfile
called /opt/local/var/run/yaws/ctl-default
Either problems with permissions or earlier runs of yaws
with the same id <default> as this, check dir for perms
None of Yaws ctl functions will work
=INFO REPORT==== 12-Mar-2007::23:34:31 ===
Yaws: Listening to 0.0.0.0:8000 for servers
- http://Chaz.local:8000 under /opt/local/var/yaws/www
- http://localhost:8000 under /opt/local/tmp
=ERROR REPORT==== 12-Mar-2007::23:34:31 ===
Yaws: Failed to listen 0.0.0.0:443 : {error,eacces}
=ERROR REPORT==== 12-Mar-2007::23:34:31 ===
Can't listen to socket: {error,eacces}
=ERROR REPORT==== 12-Mar-2007::23:34:31 ===
Top proc died, terminate gserv
=INFO REPORT==== 12-Mar-2007::23:34:31 ===
application: yaws
exited: {shutdown,{yaws_app,start,[normal,[]]}}
type: permanent
{"Kernel pid terminated",application_controller,"{application_start_failure,yaws,{shutdown,{yaws_app,start,[normal,[]]}}}"}
Crash dump was written to: erl_crash.dump
Kernel pid terminated (application_controller) ({application_start_failure,yaws,{shutdown,{yaws_app,start,[normal,[]]}}})
Everything works properly once you attempt to run Yaws with sufficient priviledges.
You're supposed to copy and customize the configuration file, as mentioned during installation:
Copy and customize /opt/local/etc/yaws.conf.template to /opt/local/etc/yaws.conf
I believe it does not make sense to provide a working default configuration for a web server. The default configuration listens on default ports (80 and 443) and therefore require root privileges to run, which you will get if you start yaws with launchctl.
In a nutshell, I can't see how to alter the configuration or the port to provide a better user experience. This is a webserver, users installing it should know how to configure it to get it running.