installare ErlyWeb... mi date una mano?

Installazione, configurazione e uso di programmi e strumenti.
andrea.paiola
Prode Principiante
Messaggi: 107
Iscrizione: venerdì 22 settembre 2006, 11:49

installare ErlyWeb... mi date una mano?

Messaggio da andrea.paiola »

http://blog.ciarang.com/posts/setting-up-erlyweb/
All I’m documentating at this stage is the initial setup of a skeleton app, which starts with getting and building ErlyWeb:

svn co http://erlyweb.googlecode.com/svn/trunk/ erlyweb
cd erlyweb
mv Emakefile Emakefile.old
sed -e "s*/usr/local/src*/usr/local/lib*" Emakefile.old >Emakefile
make
cd ..

Note that I amended the Erlang makefile to point at the location of my installed YAWS includes from an earlier step. Now, back in the home directory, start Erlang with the following command line:

erl -pa erlyweb/ebin

In the Erlang shell, do this to create the skeleton application:

1> erlyweb:create_app("dj","/home/ciaran").
2> halt().

A ‘dj’ directory was created above with the skeleton ErlyWeb application structure in place. Add two extra files in that directory as follows. Firstly a small Erlang program which runs the app with YAWS in embedded mode - dj.erl. It’s just a slight extension of the embeded YAWS test code from last time:

-module(dj).
-export([start/0]).

-include("/usr/local/lib/yaws/include/yaws.hrl").

start() ->
    erlyweb:compile("/home/ciaran/dj",[{erlydb_driver, mnesia}]),
    application:start(yaws),
    GC = yaws_config:make_default_gconf(false,"dj"),
    SC = #sconf{port = 8001,
                servername = "ubuntu01",
                listen = {0,0,0,0},
                docroot = "www",
                appmods = [{"/", erlyweb}],
                opaque = [{"appname","dj"}] },
    yaws_api:setconf(GC, [[SC]]).

And secondly a script to compile and start it, called simply dj:

#! /bin/sh
erlc dj.erl
if [ $? -ne 0 ]; then exit; fi;
erl -pa /usr/local/lib/yaws/ebin /home/ciaran/erlyweb/ebin -yaws embedded true -s dj

Now to start things up:

chmod 770 dj
./dj

All being well, hitting port 8001 with a web browser should show the skeleton application, which doesn’t do very much at this stage. The choice of the name ‘dj’ for this first application indicates that I’m planning to replace the back-end of my inexplicable DJ software with this. It’s unlikely to be anything to get excited over, unless you’re me.
sono su Ubuntu 7.10, con YAWS installato tramite apt-get

vorrei capire se

Codice: Seleziona tutto

sed -e "s*/usr/local/src*/usr/local/lib*" Emakefile.old >Emakefile
è giusto e cosa fa  ;)

il file in questione contiene

Codice: Seleziona tutto

{"src/erlyweb/*", [debug_info, {outdir, "ebin"}, {i,"/opt/local/lib/yaws/include"}]}.
%{"src/erlyweb/*", [debug_info, {outdir, "ebin"}, {i,"/Users/yariv/yaws/include"}]}.
{"src/erlydb/*", [debug_info, {outdir, "ebin"}]}.
{"src/erlsql/*", [debug_info, {outdir, "ebin"}]}.
{"src/erltl/*", [debug_info, {outdir, "ebin"}]}.
{"src/smerl/*", [debug_info, {outdir, "ebin"}]}.
{"src/erlang-mysql-driver/*", [debug_info, {outdir, "ebin"}]}.
{"src/erlang-psql-driver/*", [debug_info, strict_record_tests, {outdir, "ebin"}]}.
e YAWS ce l'ho in /usr/share/yaws/ ( la doc root )

prima di far casino volevo solo essere sicuro di questo passaggio

grazie  :)
andrea.paiola
Prode Principiante
Messaggi: 107
Iscrizione: venerdì 22 settembre 2006, 11:49

Re: installare ErlyWeb... mi date una mano?

Messaggio da andrea.paiola »

come devo modificare sto file? grazie  >:(
andrea.paiola
Prode Principiante
Messaggi: 107
Iscrizione: venerdì 22 settembre 2006, 11:49

Re: installare ErlyWeb... mi date una mano?

Messaggio da andrea.paiola »

aiuto  :-[
Scrivi risposta

Ritorna a “Applicazioni”

Chi c’è in linea

Visualizzano questa sezione: Bing [Bot], Google [Bot] e 9 ospiti