当前位置: 首页 > 工具软件 > Yaws > 使用案例 >

YAWS 实作(1): Win下安装

郭星文
2023-12-01

 

第一步:安装Erlang

Erlang的安装路径,必须没有空格。否则,安装YAWS时会有大麻烦。

象"c:/program files/erl5.6.5"是不行的。

安装完成后,在Windows系统环境变量Path值中,加上一项,如:

PATH = c:/erl5.6.5/bin;

无此变量值,无法安装YAWS。

第二步:安装Cygwin

至今,YAWS没有Windows版本,要想用非得使Cgwin重新编译源码。

让Windows侍候惯了,用Linux还真有些手生。好在从DOS里混出来的,shell操作略知一二,试试吧。

从网上找了个cygwin-setup.exe,觉得版本不老,开练。

它启动后,在第二个“下一步”,明智地选择了 “Download without installing",好处是系统变更维护时,不再受上网堵车之苦。

几个小时过后,下载完成。再次启动它,在第二个“下一步”,选择”Install from local directory“。

按过几个”下一步“按钮,指定几个目录,其中,最重要的是指定安装 perl, autoconf 和 make。

安装窗口出现软件包的名称树后,点击 devel 节点,找到并选中 perl, autoconf 和 make。

继续操作,安装开始,若干分钟过后,安装完成。

桌面上找到图标Cygwin双击启动,ok,进入了shell。

第三步:补充安装 perl, autoconf 和 make

由于没有在“第一步”中选择安装 perl, autoconf 和 make,现在遇到了麻烦:

/.configure 命令不被执行,make 命令不被系统承认。

只好进行补充安装。

第四步:补救Erlang路径中有空格的问题

我的Erlang安装在"d:/program files/erl5.6.5",执行make命令时,它无法正确判读路径名,失败。

只好复制完整的Erlang到"d:/erl5.6.5",然后,修改相应的系统变量PATH的值。

第五步:安装实况

在 bash shell 中,

> cd d:/downloads/yaws/yaws-1.77

进入YAWS的源文件目录;

> ./configure --prefix=/cygdrive/d/erl5.6.5/yaws

会屏显以下内容:

checking build system type... i686-pc-cygwin

checking host system type... i686-pc-cygwin

checking target system type... i686-pc-cygwin

checking for erl... /cygdrive/d/erl5.6.5/bin/erl

checking for erlc... /cygdrive/d/erl5.6.5/bin/erlc

checking erts version... 5.6.5

checking kernel version... 2.12.5

checking stdlib version... 1.15.5

checking sasl version... 2.1.5.4

checking mnesia version... 4.4.7

checking for gcc... gcc

checking for C compiler default output file name... a.exe

checking whether the C compiler works... yes

checking whether we are cross compiling... no

checking for suffix of executables... .exe

checking for suffix of object files... o

checking whether we are using the GNU C compiler... yes

checking whether gcc accepts -g... yes

checking for gcc option to accept ISO C89... none needed

checking how to run the C preprocessor... gcc -E

checking for grep that handles long lines and -e... /usr/bin/grep

checking for egrep... /usr/bin/grep -E

checking whether gcc needs -traditional... no

checking whether make sets $(MAKE)... yes

checking for a BSD-compatible install... /usr/bin/install -c

checking for werl... /cygdrive/d/erl5.6.5/bin/werl

configure: creating ./config.status

config.status: creating include.mk

接着,执行命令 > make ,会屏显以下内容:

make[1]: Entering directory `/cygdrive/d/erlang/yaws/yaws-1.77/c_src'

make[1]: Nothing to be done for `all'.

make[1]: Leaving directory `/cygdrive/d/erlang/yaws/yaws-1.77/c_src'

make[1]: Entering directory `/cygdrive/d/erlang/yaws/yaws-1.77/src'

. ../vsn.mk; /

        cat yaws_generated.template | /

        ../scripts/Subst %VSN% 1.77 | /

        ../scripts/Subst %VARDIR% /cygdrive/d/erl5.6.5/yaws/var | /

        ../scripts/Subst %localinstall% true | /

        ../scripts/Subst %ETCDIR% /cygdrive/d/erl5.6.5/yaws/etc > yaws_generated

.erl

""/cygdrive/d/erl5.6.5/bin/erlc"" -W  -pa ../../yaws -I ../include -o ../ebin ya

ws_generated.erl

make[1]: Leaving directory `/cygdrive/d/erlang/yaws/yaws-1.77/src'

make[1]: Entering directory `/cygdrive/d/erlang/yaws/yaws-1.77/man'

make[1]: Nothing to be done for `all'.

make[1]: Leaving directory `/cygdrive/d/erlang/yaws/yaws-1.77/man'

make[1]: Entering directory `/cygdrive/d/erlang/yaws/yaws-1.77/www/shopingcart'

cp shopcart.beam ../../examples/ebin

make[1]: Leaving directory `/cygdrive/d/erlang/yaws/yaws-1.77/www/shopingcart'

make[1]: Entering directory `/cygdrive/d/erlang/yaws/yaws-1.77/www/code'

cp myappmod.beam ../../examples/ebin

make[1]: Leaving directory `/cygdrive/d/erlang/yaws/yaws-1.77/www/code'

make[1]: Entering directory `/cygdrive/d/erlang/yaws/yaws-1.77/doc'

echo "To build the docs, please use make docs before doing make install"

To build the docs, please use make docs before doing make install

make[1]: Leaving directory `/cygdrive/d/erlang/yaws/yaws-1.77/doc'

make[1]: Entering directory `/cygdrive/d/erlang/yaws/yaws-1.77/scripts'

make[1]: Nothing to be done for `all'.

make[1]: Leaving directory `/cygdrive/d/erlang/yaws/yaws-1.77/scripts'

rm -rf yaws-1.77.script yaws-1.77.boot

rm -rf yaws-1.77.rel yaws-1.77.tar.gz

最后,执行命令 > make install ,屏显内容是:

make[1]: Entering directory `/cygdrive/d/erlang/yaws/yaws-1.77/c_src'

make[1]: Nothing to be done for `all'.

make[1]: Leaving directory `/cygdrive/d/erlang/yaws/yaws-1.77/c_src'

make[1]: Entering directory `/cygdrive/d/erlang/yaws/yaws-1.77/src'

make[1]: Nothing to be done for `all'.

make[1]: Leaving directory `/cygdrive/d/erlang/yaws/yaws-1.77/src'

make[1]: Entering directory `/cygdrive/d/erlang/yaws/yaws-1.77/man'

make[1]: Nothing to be done for `all'.

make[1]: Leaving directory `/cygdrive/d/erlang/yaws/yaws-1.77/man'

make[1]: Entering directory `/cygdrive/d/erlang/yaws/yaws-1.77/www/shopingcart'

cp shopcart.beam ../../examples/ebin

make[1]: Leaving directory `/cygdrive/d/erlang/yaws/yaws-1.77/www/shopingcart'

make[1]: Entering directory `/cygdrive/d/erlang/yaws/yaws-1.77/www/code'

cp myappmod.beam ../../examples/ebin

make[1]: Leaving directory `/cygdrive/d/erlang/yaws/yaws-1.77/www/code'

make[1]: Entering directory `/cygdrive/d/erlang/yaws/yaws-1.77/doc'

echo "To build the docs, please use make docs before doing make install"

To build the docs, please use make docs before doing make install

make[1]: Leaving directory `/cygdrive/d/erlang/yaws/yaws-1.77/doc'

make[1]: Entering directory `/cygdrive/d/erlang/yaws/yaws-1.77/scripts'

make[1]: Nothing to be done for `all'.

make[1]: Leaving directory `/cygdrive/d/erlang/yaws/yaws-1.77/scripts'

rm -rf yaws-1.77.script yaws-1.77.boot

rm -rf yaws-1.77.rel yaws-1.77.tar.gz

set -e ; /

        for d in c_src src man www/shopingcart www/code doc scripts ; do /

            if [ -f $d/Makefile ]; then ( cd $d && make install ) || exit 1 ; fi

 ; /

          done

make[1]: Entering directory `/cygdrive/d/erlang/yaws/yaws-1.77/c_src'

/usr/bin/install -c -d /cygdrive/d/erl5.6.5/yaws/lib/yaws/priv/lib

/usr/bin/install -c ../priv/.foo /cygdrive/d/erl5.6.5/yaws/lib/yaws/priv/lib

make[1]: Leaving directory `/cygdrive/d/erlang/yaws/yaws-1.77/c_src'

make[1]: Entering directory `/cygdrive/d/erlang/yaws/yaws-1.77/src'

. ../vsn.mk; /

        cat yaws_generated.template | /

        ../scripts/Subst %VSN% 1.77 | /

        ../scripts/Subst %VARDIR% /cygdrive/d/erl5.6.5/yaws/var | /

        ../scripts/Subst %localinstall% false | /

        ../scripts/Subst %ETCDIR% /cygdrive/d/erl5.6.5/yaws/etc > yaws_generated

.erl

make[1]: Warning: File `yaws_generated.erl' has modification time 0.53 s in the

future

""/cygdrive/d/erl5.6.5/bin/erlc"" -W  -pa ../../yaws -I ../include -o ../ebin ya

ws_generated.erl

/usr/bin/install -c -d /cygdrive/d/erl5.6.5/yaws/var/yaws/www

(cd ..; tar cf - www ) | (cd /cygdrive/d/erl5.6.5/yaws/var/yaws; tar xf - )

/usr/bin/install -c -d /cygdrive/d/erl5.6.5/yaws/lib/yaws/examples/ebin

/usr/bin/install -c -d /cygdrive/d/erl5.6.5/yaws/lib/yaws/examples/include

/usr/bin/install -c -d /cygdrive/d/erl5.6.5/yaws/lib/yaws/ebin

/usr/bin/install -c -d /cygdrive/d/erl5.6.5/yaws/lib/yaws/priv

/usr/bin/install -c -d /cygdrive/d/erl5.6.5/yaws/var/log/yaws

/usr/bin/install -c -d /cygdrive/d/erl5.6.5/yaws/var/yaws/ebin

(cd ..; tar cf - ebin ) | (cd /cygdrive/d/erl5.6.5/yaws/lib/yaws; tar xf - )

(cd ..; tar cf - include ) | (cd /cygdrive/d/erl5.6.5/yaws/lib/yaws; tar xf - )

(cd ..; tar cf - priv/*.xsd ) | (cd /cygdrive/d/erl5.6.5/yaws/lib/yaws; tar xf -

 )

rm -f yaws_generated.erl ../ebin/yaws_generated.beam 2>/dev/null || true

make[1]: warning:  Clock skew detected.  Your build may be incomplete.

make[1]: Leaving directory `/cygdrive/d/erlang/yaws/yaws-1.77/src'

make[1]: Entering directory `/cygdrive/d/erlang/yaws/yaws-1.77/man'

install -d /cygdrive/d/erl5.6.5/yaws/share/man/man1

install -d /cygdrive/d/erl5.6.5/yaws/share/man/man5

cp yaws.1 /cygdrive/d/erl5.6.5/yaws/share/man/man1

cp yaws.conf.5 /cygdrive/d/erl5.6.5/yaws/share/man/man5

cp yaws_api.5 /cygdrive/d/erl5.6.5/yaws/share/man/man5

make[1]: Leaving directory `/cygdrive/d/erlang/yaws/yaws-1.77/man'

make[1]: Entering directory `/cygdrive/d/erlang/yaws/yaws-1.77/www/shopingcart'

cp shopcart.beam ../../examples/ebin

cp shopcart.beam /cygdrive/d/erl5.6.5/yaws/var/yaws/ebin

make[1]: Leaving directory `/cygdrive/d/erlang/yaws/yaws-1.77/www/shopingcart'

make[1]: Entering directory `/cygdrive/d/erlang/yaws/yaws-1.77/www/code'

cp myappmod.beam ../../examples/ebin

cp myappmod.beam /cygdrive/d/erl5.6.5/yaws/var/yaws/ebin

make[1]: Leaving directory `/cygdrive/d/erlang/yaws/yaws-1.77/www/code'

make[1]: Entering directory `/cygdrive/d/erlang/yaws/yaws-1.77/doc'

install -d /cygdrive/d/erl5.6.5/yaws/share/doc/yaws-1.77

cp yaws.pdf /cygdrive/d/erl5.6.5/yaws/share/doc/yaws-1.77

make[1]: Leaving directory `/cygdrive/d/erlang/yaws/yaws-1.77/doc'

make[1]: Entering directory `/cygdrive/d/erlang/yaws/yaws-1.77/scripts'

rm -rf /tmp/yaws 2> /dev/null

sh  ./Install /cygdrive/d/erl5.6.5/yaws "/cygdrive/d/erl5.6.5/bin/erl" /

                "/cygdrive/d/erl5.6.5/bin/werl" /cygdrive/d/erl5.6.5/yaws/etc/ /

cygdrive/d/erl5.6.5/yaws/var/ /cygdrive/d/erl5.6.5/lib/erlang/bin/

Don't know how to make /etc/init scrips for this system

possibly add /cygdrive/d/erl5.6.5/yaws/bin/yaws --daemon --heart to your /etc/rc

.local manually

Installing /cygdrive/d/erl5.6.5/yaws/etc/yaws.conf

make[1]: Leaving directory `/cygdrive/d/erlang/yaws/yaws-1.77/scripts'

-------------------------------

** etc files went into        /cygdrive/d/erl5.6.5/yaws/etc

** executables went into      /cygdrive/d/erl5.6.5/yaws/bin

** library files went into    /cygdrive/d/erl5.6.5/yaws/lib/yaws

** var files went into        /cygdrive/d/erl5.6.5/yaws/var

** default docroot went into  /cygdrive/d/erl5.6.5/yaws/var/yaws/www

--------------------------------

终于,在d:/erl5.6.5/yaws中,看到了安装好的YAWS。

不过,这个YAWS中的一些配置文件,需要做些修改,才能正常运行。

运行的事,以后接着说。

 

 类似资料: