Launch the Web server inside the ERLANG/OTP (supplemental)

Source: Internet
Author: User

To prevent parameters from being too long on the command line, or to play some advanced configuration, you can use the Inets configuration file, which already has an example of various configuration files for the OTP project:

[Email protected] ~]# CD otp_src_17.5/lib/inets/[[email protected] inets]# find.-type F-name *. config./test/Inets.config./src/inets_app/Inets.config[[email protected] inets]# find.-type F-name *. conf./examples/server_root/conf/8888. conf./examples/server_root/conf/ssl.conf./examples/server_root/conf/httpd.conf./examples/server_root/conf/8080. conf./test/ftp_suite_data/vsftpd.conf./test/httpd_test_data/server_root/conf/8888. conf./test/httpd_test_data/server_root/conf/ssl.conf./test/httpd_test_data/server_root/conf/httpd.conf./test/httpd_test_data/server_root/conf/8080. conf./test/httpc_proxy_suite_data/apache2/apache2.conf./test/property_test/ftp_simple_client_server_data/vsftpd.conf./test/old_httpd_suite_data/server_root/conf/8888. conf./test/old_httpd_suite_data/server_root/conf/ssl.conf./test/old_httpd_suite_data/server_root/conf/httpd.conf./test/old_httpd_suite_data/server_root/conf/8080. Conf[[email protected] inets]#

For example, Inets app-level configuration file Inet_test.config, the contents are as follows:

[email protected] inets]# cat/test/inets.config[{inets,[{services,[{httpd,"/ldisk/tests/bmk/inets/priv _dir/8099.conf "}]}]}]. [email protected] inets]# cat. /src/inets_app/inets.config[{inets,[{services,[{httpd,"/var/tmp/server_root/conf/8888.conf"},                    {httpd,"/var/tmp/server_root/conf/8080.conf"}]}]}]. [Email protected] inets]#

I inets here in the app-level configuration file as follows:

[Email protected] ~]# cat inets_httpd18880.config[{inets,[{services,[{httpd,"/root/inetsconf/18880.conf" ~]#

And the module level profile, such as 8888.conf,https.conf, and so on, I here module httpd configuration file as follows:

[email protected] ~]# cat inetsconf/18880. Confport18880ServerName whyang.yang.netSocketType ip_commmodules mod_alias mod_auth mod_esi mod_actions mod_cgi mod_include mod_ Dir mod_get mod_head mod_log mod_disk_logserveradmin [email protected]163. Comserverroot.  server_tokensfulllog_format common  Errorlog/var/log/inets/Error_log_18880transferlog/var/log/inets/Access_log_18880securitylog/var/log/inets/Security_log_18880errordisklog/var/log/inets/error_disk_log_18880errordisklogsize200000 10Transferdisklog/var/log/inets/access_disk_log_18880transferdisklogsize200000 10Securitydisklog/var/log/inets/security_disk_logsecuritydisklogsize200000 10maxclients50#KeepAlive5#KeepAliveTimeout10DocumentRoot/var/www/htmldirectoryindex main.html index.htmldefaulttype text/Plainalias/icons//var/www/html/icons/Alias/pics//var/www/html/icons/Scriptalias/cgi-bin//var/www/html/cgi-bin/Scriptalias/htbin//var/www/html/cgi-bin/Erlscriptalias/cgi-bin/Erl httpd_example Ioevalscriptalias/eval httpd_example io#script HEAD/cgi-bin/printenv.sh#action Image/gif/cgi-bin/printenv.sh<Directory/var/www/html>authdbtype plainauthname Open areaauthuserfile/root/inetsconf/auth/ passwdauthgroupfile/root/inetsconf/auth/ grouprequire user Franklinrequire group GROUPF groupm</Directory>[[Email protected]~]#

Note that there are also auth configurations ...

Configuration file is up, start:

[Email protected] ~]# erl-config inets_httpd18880.configerlang/otp [erts-6.4] [source] [64-bit] [ ASYNC-THREADS:10] [HiPe] [kernel-poll:false]eshell V6. 4  (abort with ^G)1>

The above just loads the configuration file and then launches the app Inets:

1> Application:start (inets). OK2>

Check the app Status:

2> application:loaded_applications (). [ {kernel,"ERTS  CXC 138", "3.2"}, {stdlib,"ERTS  CXC 138", "2.4"}, {inets,"inets  CXC 138 "," 5.10.6 "}] 3>

One problem to note is that theserver_tokens and log_format fields in the httpd module configuration file are not valid (verified) and are not in the configuration file example (such as httpd.conf) Server_tokens and log_format fields.

Browser open to see!? :

Enter user name and password, log in:

Login OK:

Launch the Web server inside the ERLANG/OTP (supplemental)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.