Thread: [Erlangweb-users] getting erlang-web running on ubuntu-server
Brought to you by:
etcerlangweb,
paulgray
|
From: gqwu <gq...@ya...> - 2008-11-16 01:21:01
|
Hi everyone. I'm trying to follow the tutorial.pdf to get erlang-web running in ubuntu-server.
I used a brand new ubuntu-server 8.10 VM, did apt-get erlang & yaws, and opened up port 8080 in iptables. Erlang shell works and ubuntu's yaws localhost:8080 default successful page shows up.
I downloaded and extracted erlangweb-1.1.1.tar.gz. I run 'erl -make' and a bunch of 'Recompile: lib/...' msgs fly by.
Then I create an empty directory and run
erlangweb-1.1.1/bin/start.erl and see a bunch of 'Element created:...'.
Next I try running 'bin/start interactive' but get the following error:
--------------------
Erlang (BEAM) emulator version 5.6.3 [source] [async-threads:0] [kernel-poll:false]
{"init terminating in do_boot",{undef,[{e_mod_yaws,start,[]},{init,start_it,1},{init,start_em,1}]}}
Crash dump was written to: erl_crash.dump
init terminating in do_boot ()
--------------------
I also tried making en Emakefile in the project directory with:
{"lib/<my_app_name>/src/*",[{outdir, "lib/<my_app_name>/ebin"},
{i, "lib/<my_app_name>/include"}, debug_info, strict_record_tests, netload]}.
and then compile it with 'erl -make' or 'erl'&'make:all()' but nothing happens.
Anyone know what I'm doing wrong? I'm guessing it has something to do with yaws.
Thanks!
|
|
From: Michael M. <erl...@au...> - 2008-11-16 04:07:49
|
Here is what I did per INSTALL file (on ubuntu 8.04) and it worked
$ cd /to/where/I/want/to/install/erlangweb-1.1.1
$ tar -xzf erlangweb-1.1.1.tar.gz
$ cd erlangweb-1.1.1
$ erl -make
$ bin/start.erl
$ bin/start interactive
and then http://localhost:8080 returns page
Your error looks unrelated but do make sure other yaws instance is not
running on port 8080 when doing the 'bin/start interactive' above
~Michael
On Sat, Nov 15, 2008 at 05:20:56PM -0800, gqwu wrote:
> Hi everyone. I'm trying to follow the tutorial.pdf to get erlang-web running in ubuntu-server.
>
> I used a brand new ubuntu-server 8.10 VM, did apt-get erlang & yaws, and opened up port 8080 in iptables. Erlang shell works and ubuntu's yaws localhost:8080 default successful page shows up.
>
> I downloaded and extracted erlangweb-1.1.1.tar.gz. I run 'erl -make' and a bunch of 'Recompile: lib/...' msgs fly by.
>
> Then I create an empty directory and run
> erlangweb-1.1.1/bin/start.erl and see a bunch of 'Element created:...'.
>
> Next I try running 'bin/start interactive' but get the following error:
> --------------------
> Erlang (BEAM) emulator version 5.6.3 [source] [async-threads:0] [kernel-poll:false]
>
> {"init terminating in do_boot",{undef,[{e_mod_yaws,start,[]},{init,start_it,1},{init,start_em,1}]}}
>
> Crash dump was written to: erl_crash.dump
> init terminating in do_boot ()
> --------------------
>
> I also tried making en Emakefile in the project directory with:
>
> {"lib/<my_app_name>/src/*",[{outdir, "lib/<my_app_name>/ebin"},
> {i, "lib/<my_app_name>/include"}, debug_info, strict_record_tests, netload]}.
>
> and then compile it with 'erl -make' or 'erl'&'make:all()' but nothing happens.
>
> Anyone know what I'm doing wrong? I'm guessing it has something to do with yaws.
>
> Thanks!
>
>
>
>
> -------------------------------------------------------------------------
> This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
> Build the coolest Linux based applications with Moblin SDK & win great prizes
> Grand prize is a trip for two to an Open Source event anywhere in the world
> http://moblin-contest.org/redirect.php?banner_id=100&url=/
> _______________________________________________
> Erlangweb-users mailing list
> Erl...@li...
> https://lists.sourceforge.net/lists/listinfo/erlangweb-users
--
Michael McDaniel
Portland, Oregon, USA
http://autosys.us
|
|
From: Michal P. <mic...@er...> - 2008-11-16 09:40:57
|
Hi,
It seems to be a known bug (discovered by Paul Bernard) with building the project only from the current working directory.
The workaround (for now) is to run all the bin/start commands from the directory where you have the sources.
In your case you should download the Erlang Web tarball and then:
tar -xzf erlangweb-1.1.1.tar.gz
cd erlangweb-1.1.1
erl -make
bin/start.erl
bin/start interactive
The error you are getting has nothing to do with Yaws ports - "bin/start interactive" command simply calls
erl -pa lib/*/ebin -s e_mod_yaws [other options], so when you are outside the root directory of your application, the beam files are not in your path anymore (the command should look like: erl -pa erlangweb-1.1.1/lib/*/ebin -s e_mod_yaws [other options]).
bin/start script will be corrected shortly.
Best regards,
Michal Ptaszek
----- Oryginalna wiadomość -----
Od: "gqwu" <gq...@ya...>
Do: erl...@li...
Wysłane: niedziela, 16 listopad 2008 2:20:56 GMT +01:00 Amsterdam / Berlin / Berno / Rzym / Sztokholm / Wiedeń
Temat: [Erlangweb-users] getting erlang-web running on ubuntu-server
Hi everyone. I'm trying to follow the tutorial.pdf to get erlang-web running in ubuntu-server.
I used a brand new ubuntu-server 8.10 VM, did apt-get erlang & yaws, and opened up port 8080 in iptables. Erlang shell works and ubuntu's yaws localhost:8080 default successful page shows up.
I downloaded and extracted erlangweb-1.1.1.tar.gz. I run 'erl -make' and a bunch of 'Recompile: lib/...' msgs fly by.
Then I create an empty directory and run
erlangweb-1.1.1/bin/start.erl and see a bunch of 'Element created:...'.
Next I try running 'bin/start interactive' but get the following error:
--------------------
Erlang (BEAM) emulator version 5.6.3 [source] [async-threads:0] [kernel-poll:false]
{"init terminating in do_boot",{undef,[{e_mod_yaws,start,[]},{init,start_it,1},{init,start_em,1}]}}
Crash dump was written to: erl_crash.dump
init terminating in do_boot ()
--------------------
I also tried making en Emakefile in the project directory with:
{"lib/<my_app_name>/src/*",[{outdir, "lib/<my_app_name>/ebin"},
{i, "lib/<my_app_name>/include"}, debug_info, strict_record_tests, netload]}.
and then compile it with 'erl -make' or 'erl'&'make:all()' but nothing happens.
Anyone know what I'm doing wrong? I'm guessing it has something to do with yaws.
Thanks!
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Erlangweb-users mailing list
Erl...@li...
https://lists.sourceforge.net/lists/listinfo/erlangweb-users
|
|
From: <pr...@do...> - 2008-11-16 21:38:19
|
Michal Ptaszek <mic...@er...> writes:
> It seems to be a known bug (discovered by Paul Bernard) with building the project only from the current working directory.
> The workaround (for now) is to run all the bin/start commands from the directory where you have the sources.
>
> In your case you should download the Erlang Web tarball and then:
> tar -xzf erlangweb-1.1.1.tar.gz
> cd erlangweb-1.1.1
> erl -make
> bin/start.erl
> bin/start interactive
There is an easy workaround so you can start with an empty directory.
I'm quoting from memory and not tested the following exactly so watch
for typos and oversights on my part. I've done it a few times now. A
patch is included below:
mkdir <originaldir>
tar -xzf erlangweb-1.1.1.tar.gz
cd erlangweb-1.1.1
patch -p 1 <patchfile
erl -make
mkdir <otherdir>
cd <otherdir>
export ERL_LIBS=<originaldir>/erlangweb-1.1.1/lib
<originaldir>/erlangweb-1.1.1/bin/start.erl
cp -a <originaldir>/erlangweb-1.1.1/lib/yaws-1.73/include <otherdir>/lib/yaws-1.73
Now it *should* start. I've not personally used the "bin/start
interactive" version. I just "bin/start;sleep 2;bin/start connect", I
have no reason other than habit.
Patch:
---------------------------------------------------------------------------
diff --git a/bin/start.erl b/bin/start.erl
index 74e8b45..a493002 100755
--- a/bin/start.erl
+++ b/bin/start.erl
@@ -186,7 +186,7 @@ create_start_scripts({Version, Path}) ->
"export PROGNAME\n"
"export RELDIR\n\n"
- "exec $BINDIR/erlexec -boot $RELDIR/$VSN/start -config $RELDIR/$VSN/sys -heart -env HEART_BEAT_TIMEOUT 30 -pa patches +K true -sname $HOSTNAME -smp enable +P 262140 ${1+\"$@\"}\n",
+ "exec $BINDIR/erlexec -boot $RELDIR/$VSN/start -config $RELDIR/$VSN/sys -heart -env HEART_BEAT_TIMEOUT 30 -pa patches +K true -sname $HOSTNAME -smp auto +P 262140 ${1+\"$@\"}\n",
FileName2 = filename:join("bin", "start_erl"),
create_script(FileName2, FileContent2).
@@ -343,7 +343,7 @@ generate_boot_file() ->
erl_tar:extract("releases/0.1/start.tar.gz", [keep_old_files, compressed]).
create_sys_config_file() ->
- YawsConfig = "config/yaws.config",
+ YawsConfig = "config/yaws.conf",
file:copy(code:priv_dir(yaws) ++ "/yaws.conf", YawsConfig),
confirm_created(YawsConfig),
---------------------------------------------------------------------------
I have to do the first one because my erlang has been compiled with SMP
disabled. The second one fixes a typo. The script should almost
certainly copy yaws' include directory. I did so and then backed off
and lost it. I just do it by hand for now.
- paul
|