Up Yaws!

Getting yaws own Erlang web server running on Ubuntu Edgy Eft

I wanted to set up Yaws on my home Ubuntu box so that I could play around with ErlyWeb.

I started by installing the available Ubuntu package:

marc@tbird:~$ sudo aptitude install yaws

This installed just fine, but when I tried to run it, I ran into immediate trouble:

marc@tbird:~$ yaws -i
...
Eshell V5.5.1  (abort with ^G)
1> exec: 1: setuid_drv: not found

A quick peek at the Yaws page suggested that this was a known problem that had been fixed recently. I guess Ubuntu hasn’t picked up the fix yet, at least in Edgy.

So I downloaded the source code and set about building it. The only hitch was that my first attempt failed with an error about a missing PAM header file.

gcc -c -g -O2 -I/usr/include/security -I"/usr/lib/erlang/usr/include"
-I/usr/include/pam/  epam.c
epam.c:2:22: error: pam_appl.h: No such file or directory

Strange that the configure script didn’t catch the missing header file, but I digress.

The missing pam_appl.h header file was easily remedied with:

marc@tbird:~/sw/yaws-1.68$ sudo aptitude install libpam0g-dev

Then it built just fine and I could install it to my home directory using:

marc@tbird:~/sw/yaws-1.68$ make local_install

5 thoughts on “Up Yaws!

Getting yaws own Erlang web server running on Ubuntu Edgy Eft

  1. Thank you for your instructions. 🙂
    I was getting desperate because i couldn’t get it run.

    Now it seems like it is ok.

    The problem was libpam0g-dev.

    Regards

    Sionne

  2. Not impressive. First the above problem that should be caught in config. Then a first run interactive run bombs with a load of cryptic nonsense. It doesn’t matter if I run it as myself or as ‘yaw’ or even root althougd the second gives different errors. This was all on amd64 gutsy ubuntu btw.

    samantha@bigU:~/work/yaws$ yaws -i
    Erlang (BEAM) emulator version 5.5.5 [source] [64-bit] [async-threads:0] [kernel-poll:false]

    Eshell V5.5.5 (abort with ^G)
    1>
    =INFO REPORT==== 13-Apr-2008::23:12:54 ===
    Yaws: Using config file /etc/yaws/yaws.conf

    =INFO REPORT==== 13-Apr-2008::23:12:54 ===
    Yaws: Using subconfig file /etc/yaws/conf.d/yaws-wiki.conf

    =INFO REPORT==== 13-Apr-2008::23:12:54 ===
    Yaws: Using subconfig file /etc/yaws/conf.d/localhost-ssl.conf

    =INFO REPORT==== 13-Apr-2008::23:12:54 ===
    Yaws: Using subconfig file /etc/yaws/conf.d/localhost.conf

    =ERROR REPORT==== 13-Apr-2008::23:12:54 ===
    Cannot open “/var/log/yaws/localhost:8443.access”

    =ERROR REPORT==== 13-Apr-2008::23:12:54 ===
    Cannot open “/var/log/yaws/localhost:8080.access”

    =ERROR REPORT==== 13-Apr-2008::23:12:54 ===
    Cannot open /var/log/yaws/auth.log
    yaws:Add path “/usr/lib/yaws/wiki/ebin”
    yaws:Add path “/usr/lib/yaws/ebin”
    yaws:Add path “/usr/lib/erlang/lib/yaws-1.68/examples/ebin”
    yaws:Running with id=default
    Running with debug checks turned on (slower server)
    Logging to directory “/var/log/yaws”

    =ERROR REPORT==== 13-Apr-2008::23:12:54 ===
    Failed to create/manipulate the ctlfile
    called /var/run/yaws/ctl-default
    Either problems with permissions or earlier runs of yaws
    with the same id as this, check dir for perms
    None of Yaws ctl functions will work

    =ERROR REPORT==== 13-Apr-2008::23:12:54 ===
    Yaws: Failed to listen 0.0.0.0:8443 : {error,eaddrinuse}

    =ERROR REPORT==== 13-Apr-2008::23:12:54 ===
    Can’t listen to socket: {error,eaddrinuse}
    =INFO REPORT==== 13-Apr-2008::23:12:54 ===
    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,[]]}}})

  3. OOPS. My fault. Seems an earlier synaptic install or something I had forgotten has yaws already up and running in daemon mode.

  4. yaws -i
    Erlang R13B03 (erts-5.7.4) [source] [smp:2:2] [rq:2] [async-threads:0] [hipe] [kernel-poll:true]

    =INFO REPORT==== 25-Mar-2011::19:19:27 ===
    Yaws: Using config file /etc/yaws/yaws.conf

    =INFO REPORT==== 25-Mar-2011::19:19:27 ===
    Yaws: Using subconfig file /etc/yaws/conf.d/yaws-wiki.conf

    =INFO REPORT==== 25-Mar-2011::19:19:27 ===
    Yaws: Using subconfig file /etc/yaws/conf.d/yaws-mail.conf
    Eshell V5.7.4 (abort with ^G)
    1>
    =INFO REPORT==== 25-Mar-2011::19:19:27 ===
    Yaws: Using subconfig file /etc/yaws/conf.d/yaws-chat.conf

    =INFO REPORT==== 25-Mar-2011::19:19:27 ===
    Yaws: Using subconfig file /etc/yaws/conf.d/localhost.conf

    =INFO REPORT==== 25-Mar-2011::19:19:27 ===
    Yaws: Using subconfig file /etc/yaws/conf.d/yaws-yapp.conf

    =INFO REPORT==== 25-Mar-2011::19:19:27 ===
    Yaws: Using subconfig file /etc/yaws/conf.d/localhost-ssl.conf
    yaws:Add path “/usr/lib/yaws/yapp/ebin”
    yaws:Add path “/usr/lib/yaws/chat/ebin”
    yaws:Add path “/usr/lib/yaws/mail/ebin”
    yaws:Add path “/usr/lib/yaws/wiki/ebin”
    yaws:Add path “/usr/lib/yaws/ebin”
    yaws:Add path “/usr/lib/erlang/lib/yaws-1.84/examples/ebin”
    yaws:Running with id=default (localinstall=false)
    Running with debug checks turned on (slower server)
    Logging to directory “/var/log/yaws”

    =INFO REPORT==== 25-Mar-2011::19:19:27 ===
    Ctlfile : /root/.yaws/yaws/default/CTL

    =INFO REPORT==== 25-Mar-2011::19:19:27 ===
    sync call yapp:start

    =INFO REPORT==== 25-Mar-2011::19:19:27 ===
    Yapp starting but Yaws not ready – waiting 500 ms
    =ERROR REPORT==== 25-Mar-2011::19:19:27 ===
    Yaws: Failed to listen 0.0.0.0:8443 : {error,eaddrinuse}

    =ERROR REPORT==== 25-Mar-2011::19:19:27 ===
    Can’t listen to socket: {error,eaddrinuse}
    =INFO REPORT==== 25-Mar-2011::19:19:27 ===
    application: yaws
    exited: {shutdown,{yaws_app,start,[normal,[]]}}
    type: permanent
    {error_logger,{{2011,3,25},{19,19,28}},crash_report,[[{initial_call,{yaws_server,load_and_run,[‘Argument__1′,’Argument__2’]}},{pid,},{registered_name,[]},{error_info,{exit,{“{application_start_failure,yaws,{shutdown,{yaws_app,start,[normal,[]]}}}”,{gen_server,call,[application_controller,which_applications]}},[{gen_server,call,2},{yapp,wait_for_yaws,1},{yapp,start,0},{proc_lib,init_p_do_apply,3}]}},{ancestors,[yaws_server,yaws_sup,]},{messages,[]},{links,[]},{dictionary,[]},{trap_exit,false},{status,running},{heap_size,987},{stack_size,24},{reductions,175}],[]]}
    {“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,[]]}}})
    why is it like this always?

Leave a Reply

Your email address will not be published. Required fields are marked *