`
sillycat
  • 浏览: 2539786 次
  • 性别: Icon_minigender_1
  • 来自: 成都
社区版块
存档分类
最新评论

Erlang(1)Install and Introduction

 
阅读更多

Erlang(1)Install and Introduction

1. Install the latest Erlang based on Sources
>wget http://www.erlang.org/download/otp_src_R16B03-1.tar.gz
Unzip the file
>tar zxvf otp_src_R16B03-1.tar.gz

>cd otp_src_R16B03-1
>export LANG=C
>./configure --prefix=/Users/carl/tool/erlang-r16b03-1
>make
>sudo make install

Check the shell version
>bin/erl
Erlang R16B03-1 (erts-5.10.4) [source] [64-bit] [smp:2:2] [async-threads:10] [hipe] [kernel-poll:false] Eshell V5.10.4  (abort with ^G)

Soft link the tool directory
>sudo ln -s /Users/carl/tool/erlang-r16b03-1 /opt/erlang-5.10.4
>sudo ln -s /opt/erlang-5.10.4 /opt/erlang

>vi ~/.profile
export PATH=/opt/erlang/bin:$PATH

>. ~/.profile

Verify the Installation
>erl -version
Erlang (SMP,ASYNC_THREADS,HIPE) (BEAM) emulator version 5.10.4

Or we can enter the erlang console
>erl

Use Control + G, q + Enter to exit the console mode.

2. Erlang Introduction
Concurrency Oriented, Message Oriented, Functional 
OTP   Open Telecom Platform

3. Build and Install Yaws
The Erlang Yaws web server performs the same basic tasks as Nginx and Apache.

Apache with mod_php, each request is handled by a process or thread. The classic Common Gateway Interface(CGI) would start a new process for every request.

These threads and processes are constructions of the OS and are relatively heavyweight objects.

In Erlang the processes are owned not by the OS, but by the language runtime.

Fetch the source codes
>git clone https://github.com/klacke/yaws.git
>cd yaws
>autoconf
-bash: autoconf: command not found

Solution:
Install autoconf
>wget ftp://ftp.gnu.org/gnu/autoconf/autoconf-2.69.tar.gz
>tar xzvf autoconf-2.69.tar.gz
>cd autoconf-2.69
>./configure --prefix=/Users/carl/tool/autoconf-2.69
>make
>make install
>sudo ln -s /Users/carl/tool/autoconf-2.69 /opt/autoconf-2.69
>sudo ln -s /opt/autoconf-2.69 /opt/autoconf
Add to the PATH in .profile

Go on Install Yaws
>autoconf

But I do not know the version of the github source codes. I plan to do it from downloading the sources.

>wget http://yaws.hyber.org/download/yaws-1.98.tar.gz
>tar zxvf yaws-1.98.tar.gz
>cd yaws-1.98
>./configure --prefix=/Users/carl/tool/yaws-1.98
>make

Error Message:
gcc -c -fPIC -g -O2 -I/usr/include/security -m64 -DHAVE_SENDFILE -I"/Users/carl/tool/erlang-r16b03-1/lib/erlang/usr/include" setuid_drv.c gcc -m64 -bundle -fPIC -flat_namespace -undefined suppress -o  ../priv/lib/setuid_drv.so setuid_drv.o gcc -c -g -O2 -I/usr/include/security -m64 -DHAVE_SENDFILE -I"/Users/carl/tool/erlang-r16b03-1/lib/erlang/usr/include" epam.c epam.c:2:10: fatal error: 'pam_appl.h' file not found #include <pam_appl.h>

Solution:
http://stackoverflow.com/questions/21149481/fails-to-build-yaws-on-mac-os-x-10-9

I begin to try with this command
>sudo xcode-select —install
This command will try to install Command Lne Tools. And it will place some files we need into this directory /usr/include/security

Go on with install Yaws.
>make
>make install

After the Installation, all the info will show as follow:
** etc files went into        /Users/carl/tool/yaws-1.98/etc ** executables went into      /Users/carl/tool/yaws-1.98/bin ** library files went into    /Users/carl/tool/yaws-1.98/lib/yaws ** var files went into        /Users/carl/tool/yaws-1.98/var ** default docroot went into  /Users/carl/tool/yaws-1.98/var/yaws/www

>sudo ln -s /Users/carl/tool/yaws-1.98 /opt/yaws-1.98
>sudo ln -s /opt/yaws-1.98 /opt/yaws

Start the server
>yaws -i

or 

>yaws —daemon

How to configure it
http://yaws.hyber.org/yman.yaws?page=yaws.conf

Comments out the yaws.conf
        #<auth>        #        realm = foobar        #        dir = /        #        user = foo:bar        #        user = baz:bar        #</auth>

Visit the Server again
>sudo bin/yaws -i

And you can visit the URL http://localhost/ to access your /tmp directory.



References:
http://blog.csdn.net/xushiweizh/article/details/3466739

http://www.erlang.org/
http://www.erlang.org/doc/installation_guide/INSTALL.html

Sillycat 
http://sillycat.iteye.com/blog/1575002
http://sillycat.iteye.com/blog/1565771
http://sillycat.iteye.com/blog/2037218

https://github.com/ChicagoBoss/ChicagoBoss/wiki/Comparison-of-Erlang-Web-Frameworks
http://inaka.net/blog/2013/11/06/your-first-erlang-app-canillita/
http://www.infoq.com/cn/news/2008/06/vinoski-erlang-rest
http://wbj0110.iteye.com/blog/1984410
http://ninenines.eu/docs/en/cowboy/HEAD/guide/
http://yaws.hyber.org/

http://www.cnblogs.com/yourihua/category/329317.html

Install autoconf
http://jsdelfino.blogspot.com/2012/08/autoconf-and-automake-on-mac-os-x.html
http://www.gnu.org/software/autoconf/

http://stackoverflow.com/questions/21149481/fails-to-build-yaws-on-mac-os-x-10-9

分享到:
评论

相关推荐

    Erlang and OTP in Action MEAP May 2010

    Erlang and OTP in Action Martin Logan, Eric Merritt, and Richard Carlsson MEAP Began: August 2008 Softbound print: May 2010 (est.) | 500 pages ISBN: 1933988789 Part One: Getting Past Pure Erlang; ...

    Erlang and Elixir for Imperative Programmers(Apress,2016)

    Learn and understand Erlang and Elixir and develop a working knowledge of the concepts of functional programming that underpin them. This book takes the author’s experience of taking on a project ...

    erlang-23.2.3-1.el7.x86_64.rpm和erlang-23.2.1-1.el7.x86_64.rpm.rar

    sudo yum install rabbitmq-server-3.8.17-1.el8.noarch.rpm ``` 完成安装后,还需要启动并启用RabbitMQ服务: ```bash sudo systemctl start rabbitmq-server sudo systemctl enable rabbitmq-server ``` 最后,...

    可在ubuntu上安装erlang的deb包

    This package contains the Erlang/OTP runtime implementation, which is configured and built with HiPE support (allows compiling to native code), and minimal set of Erlang applications: compiler - ...

    erlang_版本24.3.4.4

    - **BEAM虚拟机**:Erlang的运行时系统,全称是BIFs (Built-In Functions)、Erlang、Assembler and Memory管理器。 - **OTP行为**:如Supervisor(监督者)、GenServer(通用服务器)、GenEvent(事件处理器)等,...

    ErlangB-and-ErlangC.zip_erlangB_erlangb图_erlangb表_爱尔兰C公式_爱尔兰公式

    实现爱尔兰B公式和爱尔兰C公式,功能齐全,适用于通信网课程中的实验。

    erlang-18.3-1.el7.centos.x86_64.zip

    sudo yum install erlang-18.3-1.el7.centos.x86_64.rpm ``` 3. 安装完成后,继续安装RabbitMQ的RPM包: ``` sudo yum install rabbitmq-server ``` 4. 最后,启动RabbitMQ服务并设置开机启动: ``` sudo ...

    适用于windows版本的 Erlang25.2.3 and RabbitMQ server 3.11.9下载

    1. 先安装Erlang:因为RabbitMQ依赖于Erlang环境,所以必须先确保Erlang正确安装并配置到系统路径。 2. 获取Erlang OTP的安装包:可以从官方或可靠的第三方源下载适用于Windows的Erlang OTP 25.2.3版本。 3. 安装...

    erlang-23.0.2-1.el7.x86_64.rpm+rabbitmq-server-3.8.3-1.el7.noarch.rpm

    安装rabbitmq需要适配相应的erlang,由于下载速度慢,这里提供了centos7 64系统下可用的erlang23和rabbitmq3.8.3,安装方式:yum install xxxx.rpm即可。注意要优先安装erlang。

    Erlang 20.3linux安装包

    1. **下载**:你可以从Erlang Solutions官网或者通过提供的压缩包文件"Erlang 20.3linux░▓╫░░ⁿ"和"Erlang 20.3linux安装包"下载Erlang的Linux二进制包。 2. **解压**:解压缩下载的文件到一个合适的目录,...

    erlang-22.3-1.el7.x86_64.rpm

    1. **版本号**:22.3-1表示这是Erlang的一个特定版本,22.3是主版本号和次版本号,而-1可能代表修订或更新次数。 2. **操作系统兼容性**:el7表明这个版本的Erlang是针对Red Hat Enterprise Linux 7 (RHEL 7)或其...

    适用于windows版本的 Erlang24 and RabbitMQ server 3.8.16下载

    标题提到的“适用于Windows版本的Erlang24 and RabbitMQ server 3.8.16下载”,意味着这两个组件的最新稳定版本已适配Windows操作系统。Erlang otp_win64_24.0是针对64位Windows系统的Erlang OTP(开放电信平台)...

    erlang编程 Introducing Erlang

    ### 1. 函数式编程基础 Erlang基于函数式编程范式,这意味着程序由纯函数构成,没有副作用。函数式编程强调数据不可变性和函数的数学属性,使代码更易于理解、测试和并行处理。 ### 2. 并发与轻量级进程 Erlang的...

    最新版erlang-23.3.4.3-1.el7.x86_64.rpm(CentOS7)

    - 使用yum安装Erlang:`sudo yum install erlang-23.3.4.3-1.el7.x86_64.rpm` 2. **安装RabbitMQ**: - 下载RabbitMQ RPM包:`wget https://your_download_link/rabbitmq-server-3.8.17-1.el7.noarch.rpm` - ...

    erlang-19.0.4-1.el7.centos.x86_64.rpm

    安装过程通常通过命令行工具如`yum`或`dnf`进行,命令可能是`sudo yum install erlang-19.0.4-1.el7.centos.x86_64.rpm`或`sudo dnf install erlang-19.0.4-1.el7.centos.x86_64.rpm`,具体取决于你的系统配置。...

    erlang22最新下载包

    4. **安装**:完成编译后,使用`sudo make install`将Erlang安装到系统路径中。 对于开发者来说,了解这些更新和变化至关重要,因为它们可能影响到现有项目的行为,或者提供新的工具和技术来解决特定问题。学习和...

Global site tag (gtag.js) - Google Analytics