Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:Ledest:erlang:25
erlang
3591-Change-apache-like-config-files-to-erlang-...
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 3591-Change-apache-like-config-files-to-erlang-proplist-f.patch of Package erlang
From 29bce292cb90ec3f99c1d204c8c2004ac2ebc562 Mon Sep 17 00:00:00 2001 From: anupamasingh10 <anupamasingh31@gmail.com> Date: Thu, 30 Mar 2023 09:55:06 +0200 Subject: [PATCH] Change apache-like config files to erlang proplist file --- lib/inets/examples/server_root/conf/8080.conf | 146 +++--- lib/inets/examples/server_root/conf/8888.conf | 114 ++--- .../examples/server_root/conf/httpd.conf | 476 +++++++++--------- lib/inets/examples/server_root/conf/ssl.conf | 120 ++--- 4 files changed, 398 insertions(+), 458 deletions(-) diff --git a/lib/inets/examples/server_root/conf/8080.conf b/lib/inets/examples/server_root/conf/8080.conf index 7b1b4a15b2..bf8fbba390 100644 --- a/lib/inets/examples/server_root/conf/8080.conf +++ b/lib/inets/examples/server_root/conf/8080.conf @@ -1,79 +1,67 @@ -Port 8080 -#ServerName your.server.net -SocketType ip_comm -Modules mod_alias mod_auth mod_esi mod_actions mod_cgi mod_dir mod_get mod_head mod_log mod_disk_log -ServerAdmin jocke@erix.ericsson.se -ServerRoot /var/tmp/server_root -ErrorLog logs/error_log_8080 -TransferLog logs/access_log_8080 -SecurityLog logs/security_log_8080 -ErrorDiskLog logs/error_disk_log_8080 -ErrorDiskLogSize 200000 10 -TransferDiskLog logs/access_disk_log_8080 -TransferDiskLogSize 200000 10 -SecurityDiskLog logs/security_disk_log -SecurityDiskLogSize 200000 10 -MaxClients 50 -#KeepAlive 5 -#KeepAliveTimeout 10 -DocumentRoot /var/tmp/server_root/htdocs -DirectoryIndex index.html welcome.html -DefaultType text/plain -Alias /icons/ /var/tmp/server_root/icons/ -Alias /pics/ /var/tmp/server_root/icons/ -ScriptAlias /cgi-bin/ /var/tmp/server_root/cgi-bin/ -ScriptAlias /htbin/ /var/tmp/server_root/cgi-bin/ -ErlScriptAlias /cgi-bin/erl httpd_example io -EvalScriptAlias /eval httpd_example io -#Script HEAD /cgi-bin/printenv.sh -#Action image/gif /cgi-bin/printenv.sh - -<Directory /var/tmp/server_root/htdocs/open> -AuthDBType plain -AuthName Open Area -AuthUserFile /var/tmp/server_root/auth/passwd -AuthGroupFile /var/tmp/server_root/auth/group -require user one Aladdin -</Directory> - -<Directory /var/tmp/server_root/htdocs/secret> -AuthDBType plain -AuthName Secret Area -AuthUserFile /var/tmp/server_root/auth/passwd -AuthGroupFile /var/tmp/server_root/auth/group -require group group1 group2 -</Directory> - -<Directory /var/tmp/server_root/htdocs/secret/top_secret> -AuthDBType plain -AuthName Top Secret Area -AuthUserFile /var/tmp/server_root/auth/passwd -AuthGroupFile /var/tmp/server_root/auth/group -require group group3 -</Directory> - -<Directory /var/tmp/server_root/htdocs/mnesia_open> -AuthDBType mnesia -AuthName Open Area -require user one Aladdin -</Directory> - -<Directory /var/tmp/server_root/htdocs/mnesia_secret> -AuthDBType mnesia -AuthName Secret Area -require group group1 group2 -</Directory> - -<Directory /var/tmp/server_root/htdocs/mnesia_secret/top_secret> -AuthDBType mnesia -AuthName Top Secret Area -require group group3 -allow from 130.100.34 130.100.35 -deny from 100.234.22.12 194.100.34.1 130.100.34.25 -SecurityDataFile logs/security_data -SecurityMaxRetries 3 -SecurityBlockTime 10 -SecurityFailExpireTime 1 -SecurityAuthTimeout 1 -SecurityCallbackModule security_callback -</Directory> +[{port, 8080}, + {server_name, "your.server.net"}, + {socket_type, ip_comm}, + {modules, [mod_alias,mod_auth,mod_esi,mod_actions,mod_cgi,mod_dir,mod_get, + mod_head,mod_log,mod_disk_log]}, + {server_admin, "jocke@erix.ericsson.se"}, + {server_root, "/var/tmp/server_root"}, + {error_log, "logs/error_log_8080"}, + {transfer_log, "logs/access_log_8080"}, + {security_log, "logs/security_log_8080"}, + {error_disk_log, "logs/error_disk_log_8080"}, + {error_disk_log_size, {200000,10}}, + {transfer_disk_log, "logs/access_disk_log_8080"}, + {transfer_disk_log_size, {200000,10}}, + {security_disk_log, "logs/security_disk_log"}, + {security_disk_log_size, {200000,10}}, + {max_clients, 50}, + %%{keep_alive, 5}, + %%{keep_alive_timeout, 10}, + {document_root, "/var/tmp/server_root/htdocs"}, + {directory_index, ["index.html","welcome.html"]}, + {default_type, "text/plain"}, + {alias, {"/icons/","/var/tmp/server_root/icons/"}}, + {alias, {"/pics/","/var/tmp/server_root/icons/"}}, + {script_alias, {"/cgi-bin/","/var/tmp/server_root/cgi-bin/"}}, + {script_alias, {"/htbin/","/var/tmp/server_root/cgi-bin/"}}, + {erl_script_alias, {"/cgi-bin/erl",[httpd_example]}}, + %%{script, {"HEAD", "/cgi-bin/printenv.sh"}}, + %%{action, {"image/gif", "/cgi-bin/printenv.sh"}}, + {directory, {"/var/tmp/server_root/htdocs/open", + [{require,["user","one","Aladdin"]}, + {auth_group_file,"/var/tmp/server_root/auth/group"}, + {auth_user_file,"/var/tmp/server_root/auth/passwd"}, + {auth_name,"Open Area"}, + {auth_type,"plain"}]}}, + {directory, {"/var/tmp/server_root/htdocs/secret", + [{require,["group","group1","group2"]}, + {auth_group_file,"/var/tmp/server_root/auth/group"}, + {auth_user_file,"/var/tmp/server_root/auth/passwd"}, + {auth_name,"Secret Area"}, + {auth_type,"plain"}]}}, + {directory, {"/var/tmp/server_root/htdocs/secret/top_secret", + [{require,["group","group3"]}, + {auth_group_file,"/var/tmp/server_root/auth/group"}, + {auth_user_file,"/var/tmp/server_root/auth/passwd"}, + {auth_name,"Top Secret Area"}, + {auth_type,"plain"}]}}, + {directory, {"/var/tmp/server_root/htdocs/mnesia_open", + [{require,["user","one","Aladdin"]}, + {auth_name,"Open Area"}, + {auth_type,"mnesia"}]}}, + {directory, {"/var/tmp/server_root/htdocs/mnesia_secret", + [{require,["group","group1","group2"]}, + {auth_name,"Secret Area"}, + {auth_type,"mnesia"}]}}, + {directory, {"/var/tmp/server_root/htdocs/mnesia_secret/top_secret", + [{security_callback_module,"security_callback"}, + {security_auth_timeout,1}, + {security_fail_expire_time,1}, + {security_block_time,10}, + {security_max_retries,3}, + {security_data_file,"logs/security_data"}, + {deny_from,["100.234.22.12","194.100.34.1","130.100.34.25"]}, + {allow_from,["130.100.34","130.100.35"]}, + {require,["group","group3"]}, + {auth_name,"Top Secret Area"}, + {auth_type,"mnesia"}]}}]. diff --git a/lib/inets/examples/server_root/conf/8888.conf b/lib/inets/examples/server_root/conf/8888.conf index 042779fcd0..be2555a8b7 100644 --- a/lib/inets/examples/server_root/conf/8888.conf +++ b/lib/inets/examples/server_root/conf/8888.conf @@ -1,63 +1,51 @@ -Port 8888 -#ServerName your.server.net -SocketType ip_comm -Modules mod_alias mod_auth mod_esi mod_actions mod_cgi mod_dir mod_get mod_head mod_log mod_disk_log -ServerAdmin jocke@erix.ericsson.se -ServerRoot /var/tmp/server_root -ErrorLog logs/error_log_8888 -TransferLog logs/access_log_8888 -ErrorDiskLog logs/error_disk_log_8888 -ErrorDiskLogSize 200000 10 -TransferDiskLog logs/access_disk_log_8888 -TransferDiskLogSize 200000 10 -MaxClients 150 -DocumentRoot /var/tmp/server_root/htdocs -DirectoryIndex index.html welcome.html -DefaultType text/plain -Alias /icons/ /var/tmp/server_root/icons/ -Alias /pics/ /var/tmp/server_root/icons/ -ScriptAlias /cgi-bin/ /var/tmp/server_root/cgi-bin/ -ScriptAlias /htbin/ /var/tmp/server_root/cgi-bin/ -ErlScriptAlias /cgi-bin/erl httpd_example io -EvalScriptAlias /eval httpd_example io -#Script HEAD /cgi-bin/printenv.sh -#Action image/gif /cgi-bin/printenv.sh - -<Directory /var/tmp/server_root/htdocs/open> -AuthName Open Area -AuthUserFile /var/tmp/server_root/auth/passwd -AuthGroupFile /var/tmp/server_root/auth/group -require user one Aladdin -</Directory> - -<Directory /var/tmp/server_root/htdocs/secret> -AuthName Secret Area -AuthUserFile /var/tmp/server_root/auth/passwd -AuthGroupFile /var/tmp/server_root/auth/group -require group group1 group2 -</Directory> - -<Directory /var/tmp/server_root/htdocs/secret/top_secret> -AuthName Top Secret Area -AuthUserFile /var/tmp/server_root/auth/passwd -AuthGroupFile /var/tmp/server_root/auth/group -require group group3 -</Directory> - -<Directory /var/tmp/server_root/htdocs/mnesia_open> -AuthName Open Area -AuthMnesiaDB On -require user one Aladdin -</Directory> - -<Directory /var/tmp/server_root/htdocs/mnesia_secret> -AuthName Secret Area -AuthMnesiaDB On -require group group1 group2 -</Directory> - -<Directory /var/tmp/server_root/htdocs/mnesia_secret/top_secret> -AuthName Top Secret Area -AuthMnesiaDB On -require group group3 -</Directory> +[{port, 8888}, + {server_name, "your.server.net"}, + {socket_type, ip_comm} + {modules, [mod_alias,mod_auth,mod_esi,mod_actions,mod_cgi,mod_dir,mod_get, + mod_head,mod_log,mod_disk_log]}, + {server_admin, "jocke@erix.ericsson.se"}, + {server_root, "/var/tmp/server_root"}, + {error_log, "logs/error_log_8888"}, + {transfer_log, "logs/access_log_8888"}, + {error_disk_log, "logs/error_disk_log_8888"}, + {error_disk_log_size, {200000,10}}, + {transfer_disk_log, "logs/access_disk_log_8888"}, + {transfer_disk_log_size, {200000,10}}, + {max_clients, 150}, + {document_root, "/var/tmp/server_root/htdocs"}, + {directory_index, ["index.html", "welcome.html"]}, + {default_type, "text/plain"}, + {alias, {"/icons/", "/var/tmp/server_root/icons/"}}, + {alias, {"/pics/", "/var/tmp/server_root/icons/"}}, + {script_alias, {"/cgi-bin/", "/var/tmp/server_root/cgi-bin/"}}, + {script_alias, {"/htbin/", "/var/tmp/server_root/cgi-bin/"}}, + {erl_script_alias, {"/cgi-bin/erl", [httpd_example]}}, + % {script, {"HEAD", "/cgi-bin/printenv.sh"}}, + % {action, {"image/gif", "/cgi-bin/printenv.sh"}}, + {directory, {"/var/tmp/server_root/htdocs/open", + [{require,["user","one","Aladdin"]}, + {auth_group_file,"/var/tmp/server_root/auth/group"}, + {auth_user_file,"/var/tmp/server_root/auth/passwd"}, + {auth_name,"Open Area"}]}}, + {directory, {"/var/tmp/server_root/htdocs/secret", + [{require,["group","group1","group2"]}, + {auth_group_file,"/var/tmp/server_root/auth/group"}, + {auth_user_file,"/var/tmp/server_root/auth/passwd"}, + {auth_name,"Secret Area"}]}}, + {directory, {"/var/tmp/server_root/htdocs/secret/top_secret", + [{require,["group","group3"]}, + {auth_group_file,"/var/tmp/server_root/auth/group"}, + {auth_user_file,"/var/tmp/server_root/auth/passwd"}, + {auth_name,"Top Secret Area"}]}}, + {directory, {"/var/tmp/server_root/htdocs/mnesia_open", + [{require,["user","one","Aladdin"]}, + {auth_mnesia_d_b,"On"}, + {auth_name,"Open Area"}]}}, + {directory, {"/var/tmp/server_root/htdocs/mnesia_secret", + [{require,["group","group1","group2"]}, + {auth_mnesia_d_b,"On"}, + {auth_name,"Secret Area"}]}}, + {directory, {"/var/tmp/server_root/htdocs/mnesia_secret/top_secret", + [{require,["group","group3"]}, + {auth_mnesia_d_b,"On"}, + {auth_name,"Top Secret Area"}]}}]. diff --git a/lib/inets/examples/server_root/conf/httpd.conf b/lib/inets/examples/server_root/conf/httpd.conf index e44a45c02c..a56bf5133f 100644 --- a/lib/inets/examples/server_root/conf/httpd.conf +++ b/lib/inets/examples/server_root/conf/httpd.conf @@ -1,269 +1,245 @@ -# -# %CopyrightBegin% -# -# Copyright Ericsson AB 1997-2022. All Rights Reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -# %CopyrightEnd% -# -# - -# Port: The port the standalone listens to. For ports < 1023, you will -# need httpd to be run as root initially. - -Port 8888 - -# BindAddress: This directive is used to tell the server which IP address -# to listen to. It can either contain "*", an IP address, or a fully -# qualified Internet domain name. -# -# It is also possible to specify the ip-family with the directive. -# There ar three possible value: inet, inet6 and inet6fb4 -# inet: Use IpFamily inet when retrieving the address and -# fail if that does not work. -# inet6: Use IpFamily inet6 when retrieving the address and -# fail if that does not work. -# inet6fb4: First IpFamily inet6 is tried and if that does not work, -# inet is used as fallback. -# Default value for ip-family is inet6fb4 -# -# The syntax is: <address>[|<ip-family>] -# -#BindAddress * -#BindAddress *|inet - - -# ServerName allows you to set a host name which is sent back to clients for -# your server if it's different than the one the program would get (i.e. use -# "www" instead of the host's real name). -# -# Note: You cannot just invent host names and hope they work. The name you -# define here must be a valid DNS name for your host. If you don't understand -# this, ask your network administrator. - -#ServerName your.server.net - -# SocketType is either ip_comm, sockets or ssl. - -SocketType ip_comm - -# Modules: Server run-time plug-in modules written using the Erlang -# Web Server API (EWSAPI). The server API make it easy to add functionality -# to the server. Read more about EWSAPI in the Reference Manual. -# WARNING! Do not tamper with this directive unless you are familiar with -# EWSAPI. - -Modules mod_alias mod_auth mod_esi mod_actions mod_cgi mod_responsecontrol mod_trace mod_range mod_head mod_dir mod_get mod_log mod_disk_log - -# ServerAdmin: Your address, where problems with the server should be -# e-mailed. +%% +%% %CopyrightBegin% +%% +%% Copyright Ericsson AB 1997-2022. All Rights Reserved. +%% +%% Licensed under the Apache License, Version 2.0 (the "License"); +%% you may not use this file except in compliance with the License. +%% You may obtain a copy of the License at +%% +%% http://www.apache.org/licenses/LICENSE-2.0 +%% +%% Unless required by applicable law or agreed to in writing, software +%% distributed under the License is distributed on an "AS IS" BASIS, +%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +%% See the License for the specific language governing permissions and +%% limitations under the License. +%% +%% %CopyrightEnd% +%% +%% +%% +%% Port: The port the standalone listens to. For ports < 1023, you will +%% need httpd to be run as root initially. + +[{port, 8888}, + +%% BindAddress: This directive is used to tell the server which IP address +%% to listen to. It can either contain "*", an IP address, or a fully +%% qualified Internet domain name. +%% +%% It is also possible to specify the ip-family with the directive. +%% There ar three possible value: inet, inet6 and inet6fb4 +%% inet: Use IpFamily inet when retrieving the address and +%% fail if that does not work. +%% inet6: Use IpFamily inet6 when retrieving the address and +%% fail if that does not work. +%% inet6fb4: First IpFamily inet6 is tried and if that does not work, +%% inet is used as fallback. +%% Default value for ip-family is inet6fb4 +%% +%% The syntax is: <address>[|<ip-family>] +%% +%%BindAddress * +%%BindAddress *|inet + + +%% ServerName allows you to set a host name which is sent back to clients for +%% your server if it's different than the one the program would get (i.e. use +%% "www" instead of the host's real name). +%% +%% Note: You cannot just invent host names and hope they work. The name you +%% define here must be a valid DNS name for your host. If you don't understand +%% this, ask your network administrator. + +{server_name, "your.server.net"}, + +%% SocketType is either ip_comm, sockets or ssl. + +{socket_type, ip_comm}, + +%% Modules: Server run-time plug-in modules written using the Erlang +%% Web Server API (EWSAPI). The server API make it easy to add functionality +%% to the server. Read more about EWSAPI in the Reference Manual. +%% WARNING! Do not tamper with this directive unless you are familiar with +%% EWSAPI. + +{modules, [mod_alias,mod_auth,mod_esi,mod_actions,mod_cgi,mod_responsecontrol, + mod_trace,mod_range,mod_head,mod_dir,mod_get,mod_log,mod_disk_log]}, + +%% ServerAdmin: Your address, where problems with the server should be +%% e-mailed. + +{server_admin, "jocke@erix.ericsson.se"}, + +%% ServerRoot: The directory the server's config, error, and log files +%% are kept in + +{server_root, "/var/tmp/server_root"}, + +%% ErrorLog: The location of the error log file. If this does not start +%% with /, ServerRoot is prepended to it. + +{error_log, "logs/error_log"}, + +%% TransferLog: The location of the transfer log file. If this does not +%% start with /, ServerRoot is prepended to it. + +{transfer_log, "logs/access_log"} + +%% SecurityLog: The location of the security log file (mod_security required) + +{security_log, "logs/security_log"}, + +%% ErrorDiskLog: The location of the error log file. If this does not +%% start with /, ServerRoot is prepended to it. This log file is managed +%% with the disk_log module [See disk_log(3)]. The ErrorDiskLogSize directive +%% takes two argument, i.e. MaxBytes and MaxFiles. The wrap log writes at most +%% MaxBytes bytes on each file, and it uses MaxFiles files before it wraps, and +%% truncates the first file. + +{error_disk_log, "logs/error_disk_log"}, +{error_disk_log_size, {200000,10}}, + +%% TransferDiskLog: The location of the transfer log file. If this does not +%% start with /, ServerRoot is prepended to it. This log file is managed +%% with the disk_log module [See disk_log(3)]. The TransferDiskLogSize directive +%% takes two argument, i.e. MaxBytes and MaxFiles. The wrap log writes at most +%% MaxBytes bytes on each file, and it uses MaxFiles files before it wraps, and +%% truncates the first file. -ServerAdmin jocke@erix.ericsson.se +{transfer_disk_log, "logs/access_disk_log"}, +{transfer_disk_log_size, {200000,10}}, -# ServerRoot: The directory the server's config, error, and log files -# are kept in - -ServerRoot /var/tmp/server_root - -# ErrorLog: The location of the error log file. If this does not start -# with /, ServerRoot is prepended to it. +%% SecurityDiskLog: The location of the security log file. If this does not +%% start with /, ServerRoot is prepended to it. This log file is managed +%% with the disk_log module [See disk_log(3)]. The SecurityDiskLogSize directive +%% takes two argument, i.e. MaxBytes and MaxFiles. The wrap log writes at most +%% MaxBytes bytes on each file, and it uses MaxFiles files before it wraps, and +%% truncates the first file. -ErrorLog logs/error_log +{security_disk_log, "logs/security_disk_log"}, +{security_disk_log_size, {200000,10}}, -# TransferLog: The location of the transfer log file. If this does not -# start with /, ServerRoot is prepended to it. +%% Limit on total number of servers running, i.e., limit on the number +%% of clients who can simultaneously connect --- if this limit is ever +%% reached, clients will be LOCKED OUT, so it should NOT BE SET TOO LOW. +%% It is intended mainly as a brake to keep a runaway server from taking +%% the server with it as it spirals down... -TransferLog logs/access_log +{max_clients, 50}, -# SecurityLog: The location of the security log file (mod_security required) -# -SecurityLog logs/security_log +%% KeepAlive set the flag for persistent connections. For persistent connections +%% set KeepAlive to on. To use One request per connection set the flag to off +%% Note: The value has changed since previous version of INETS. +{keep_alive, false}, -# ErrorDiskLog: The location of the error log file. If this does not -# start with /, ServerRoot is prepended to it. This log file is managed -# with the disk_log module [See disk_log(3)]. The ErrorDiskLogSize directive -# takes two argument, i.e. MaxBytes and MaxFiles. The wrap log writes at most -# MaxBytes bytes on each file, and it uses MaxFiles files before it wraps, and -# truncates the first file. +%% KeepAliveTimeout sets the number of seconds before a persistent connection +%% times out and closes. +{keep_alive_timeout, 10}, -ErrorDiskLog logs/error_disk_log -ErrorDiskLogSize 200000 10 +%% MaxKeepAliveRequests sets the number of seconds before a persistent connection +%% times out and closes. +{max_keep_alive_requests, "10"}, -# TransferDiskLog: The location of the transfer log file. If this does not -# start with /, ServerRoot is prepended to it. This log file is managed -# with the disk_log module [See disk_log(3)]. The TransferDiskLogSize directive -# takes two argument, i.e. MaxBytes and MaxFiles. The wrap log writes at most -# MaxBytes bytes on each file, and it uses MaxFiles files before it wraps, and -# truncates the first file. +%% DocumentRoot: The directory out of which you will serve your +%% documents. By default, all requests are taken from this directory, but +%% symbolic links and aliases may be used to point to other locations. -TransferDiskLog logs/access_disk_log -TransferDiskLogSize 200000 10 +{document_root, "/var/tmp/server_root/htdocs"}, -# SecurityDiskLog: The location of the security log file. If this does not -# start with /, ServerRoot is prepended to it. This log file is managed -# with the disk_log module [See disk_log(3)]. The SecurityDiskLogSize directive -# takes two argument, i.e. MaxBytes and MaxFiles. The wrap log writes at most -# MaxBytes bytes on each file, and it uses MaxFiles files before it wraps, and -# truncates the first file. +%% DirectoryIndex: Name of the file or files to use as a pre-written HTML +%% directory index. Separate multiple entries with spaces. -SecurityDiskLog logs/security_disk_log -SecurityDiskLogSize 200000 10 +{directory_index, ["index.html","welcome.html"]}, -# Limit on total number of servers running, i.e., limit on the number -# of clients who can simultaneously connect --- if this limit is ever -# reached, clients will be LOCKED OUT, so it should NOT BE SET TOO LOW. -# It is intended mainly as a brake to keep a runaway server from taking -# the server with it as it spirals down... +%% DefaultType is the default MIME type for documents which the server +%% cannot find the type of from filename extensions. -MaxClients 50 +{default_type, "text/plain"}, -# KeepAlive set the flag for persistent connections. For persistent connections -# set KeepAlive to on. To use One request per connection set the flag to off -# Note: The value has changed since previous version of INETS. -KeepAlive on +%% Aliases: Add here as many aliases as you need (with no limit). The format is +%% Alias fakename realname -# KeepAliveTimeout sets the number of seconds before a persistent connection -# times out and closes. -KeepAliveTimeout 10 +{alias, {"/icons/", "/var/tmp/server_root/icons/"}}, +{alias, {"/pics/", "/var/tmp/server_root/icons/"}}, -# MaxKeepAliveRequests sets the number of seconds before a persistent connection -# times out and closes. -MaxKeepAliveRequests 10 +%% ScriptAlias: This controls which directories contain server scripts. +%% Format: ScriptAlias fakename realname +{script_alias, {"/cgi-bin/", "/var/tmp/server_root/cgi-bin/"}}, +{script_alias, {"/htbin/", "/var/tmp/server_root/cgi-bin/"}}, - -# DocumentRoot: The directory out of which you will serve your -# documents. By default, all requests are taken from this directory, but -# symbolic links and aliases may be used to point to other locations. - -DocumentRoot /var/tmp/server_root/htdocs - -# DirectoryIndex: Name of the file or files to use as a pre-written HTML -# directory index. Separate multiple entries with spaces. - -DirectoryIndex index.html welcome.html - -# DefaultType is the default MIME type for documents which the server -# cannot find the type of from filename extensions. - -DefaultType text/plain - -# Aliases: Add here as many aliases as you need (with no limit). The format is -# Alias fakename realname - -Alias /icons/ /var/tmp/server_root/icons/ -Alias /pics/ /var/tmp/server_root/icons/ - -# ScriptAlias: This controls which directories contain server scripts. -# Format: ScriptAlias fakename realname - -ScriptAlias /cgi-bin/ /var/tmp/server_root/cgi-bin/ -ScriptAlias /htbin/ /var/tmp/server_root/cgi-bin/ - -# This directive adds an action, which will activate cgi-script when a -# file is requested using the method of method, which can be one of -# GET, POST and HEAD. It sends the URL and file path of the requested -# document using the standard CGI PATH_INFO and PATH_TRANSLATED -# environment variables. - -#Script HEAD /cgi-bin/printenv.sh - -# This directive adds an action, which will activate cgi-script when a -# file of content type mime-type is requested. It sends the URL and -# file path of the requested document using the standard CGI PATH_INFO -# and PATH_TRANSLATED environment variables. - -#Action image/gif /cgi-bin/printenv.sh - -# ErlScriptAlias: This specifies how "Erl" server scripts are called. -# Format: ErlScriptAlias fakename realname allowed_modules - -ErlScriptAlias /down/erl httpd_example io - -# EvalScriptAlias: This specifies how "Eval" server scripts are called. -# Format: EvalScriptAlias fakename realname allowed_modules - -EvalScriptAlias /eval httpd_example io - -# Point SSLCertificateFile at a PEM encoded certificate. - -SSLCertificateFile /var/tmp/server_root/ssl/ssl_server.pem - -# If the key is not combined with the certificate, use this directive to -# point at the key file. - -SSLCertificateKeyFile /var/tmp/server_root/ssl/ssl_server.pem - -# Set SSLVerifyClient to: -# 0 if no certificate is required -# 1 if the client may present a valid certificate -# 2 if the client must present a valid certificate -# 3 if the client may present a valid certificate but it is not required to -# have a valid CA - -SSLVerifyClient 0 - -# Each directory to which INETS has access, can be configured with respect -# to which services and features are allowed and/or disabled in that -# directory (and its subdirectories). - -<Directory /var/tmp/server_root/htdocs/open> -AuthDBType plain -AuthName Open Area -AuthUserFile /var/tmp/server_root/auth/passwd -AuthGroupFile /var/tmp/server_root/auth/group -require user one Aladdin -</Directory> - -<Directory /var/tmp/server_root/htdocs/secret> -AuthDBType plain -AuthName Secret Area -AuthUserFile /var/tmp/server_root/auth/passwd -AuthGroupFile /var/tmp/server_root/auth/group -require group group1 group2 -</Directory> - -<Directory /var/tmp/server_root/htdocs/secret/top_secret> -AuthDBType plain -AuthName Top Secret Area -AuthUserFile /var/tmp/server_root/auth/passwd -AuthGroupFile /var/tmp/server_root/auth/group -require group group3 -</Directory> - -<Directory /var/tmp/server_root/htdocs/mnesia_open> -AuthDBType mnesia -AuthName Open Area -require user one Aladdin -</Directory> - -<Directory /var/tmp/server_root/htdocs/mnesia_secret> -AuthDBType mnesia -AuthName Secret Area -require group group1 group2 -</Directory> - -<Directory /var/tmp/server_root/htdocs/mnesia_secret/top_secret> -AuthDBType mnesia -AuthName Top Secret Area -require group group3 -allow from 130.100.34 130.100.35 -deny from 100.234.22.12 194.100.34.1 130.100.34.25 -SecurityDataFile logs/security_data -SecurityMaxRetries 3 -SecurityBlockTime 10 -SecurityFailExpireTime 1 -SecurityAuthTimeout 1 -SecurityCallbackModule security_callback -</Directory> +%% This directive adds an action, which will activate cgi-script when a +%% file is requested using the method of method, which can be one of +%% GET, POST and HEAD. It sends the URL and file path of the requested +%% document using the standard CGI PATH_INFO and PATH_TRANSLATED +%% environment variables. + +%%{script, {"HEAD", "/cgi-bin/printenv.sh"}} + +%% This directive adds an action, which will activate cgi-script when a +%% file of content type mime-type is requested. It sends the URL and +%% file path of the requested document using the standard CGI PATH_INFO +%% and PATH_TRANSLATED environment variables. + +%%{action, {"image/gif", "/cgi-bin/printenv.sh"}}, + +%% ErlScriptAlias: This specifies how "Erl" server scripts are called. +%% Format: ErlScriptAlias fakename realname allowed_modules + +{erl_script_alias, {"/down/erl", [httpd_example]}}, + +%% Point certfile to a PEM encoded certificate. If the key is not combined +%% with the certificate, use keyfile directive to point to the key file. +{ssl, [{certfile, "/var/tmp/server_root/ssl/ssl_server.pem"}, + {keyfile, "/var/tmp/server_root/ssl/ssl_server.pem"}, + {verify, verify_none}]}, + +%% Each directory to which INETS has access, can be configured with respect +%% to which services and features are allowed and/or disabled in that +%% directory (and its subdirectories). + +{directory, {"/var/tmp/server_root/htdocs/open", + [{require,["user","one","Aladdin"]}, + {auth_group_file,"/var/tmp/server_root/auth/group"}, + {auth_user_file,"/var/tmp/server_root/auth/passwd"}, + {auth_name,"Open Area"}, + {auth_type,"plain"}]}}, + +{directory, {"/var/tmp/server_root/htdocs/secret", + [{require,["group","group1","group2"]}, + {auth_group_file,"/var/tmp/server_root/auth/group"}, + {auth_user_file,"/var/tmp/server_root/auth/passwd"}, + {auth_name,"Secret Area"}, + {auth_type,"plain"}]}}, + +{directory, {"/var/tmp/server_root/htdocs/secret/top_secret", + [{require,["group","group3"]}, + {auth_group_file,"/var/tmp/server_root/auth/group"}, + {auth_user_file,"/var/tmp/server_root/auth/passwd"}, + {auth_name,"Top Secret Area"}, + {auth_type,"plain"}]}}, + +{directory, {"/var/tmp/server_root/htdocs/mnesia_open", + [{require,["user","one","Aladdin"]}, + {auth_name,"Open Area"}, + {auth_type,"mnesia"}]}}, + +{directory, {"/var/tmp/server_root/htdocs/mnesia_secret", + [{require,["group","group1","group2"]}, + {auth_name,"Secret Area"}, + {auth_type,"mnesia"}]}}, + +{directory, {"/var/tmp/server_root/htdocs/mnesia_secret/top_secret", + [{security_callback_module,"security_callback"}, + {security_auth_timeout,1}, + {security_fail_expire_time,1}, + {security_block_time,10}, + {security_max_retries,3}, + {security_data_file,"logs/security_data"}, + {deny_from,["100.234.22.12","194.100.34.1","130.100.34.25"]}, + {allow_from,["130.100.34","130.100.35"]}, + {require,["group","group3"]}, + {auth_name,"Top Secret Area"}, + {auth_type,"mnesia"}]}}]. diff --git a/lib/inets/examples/server_root/conf/ssl.conf b/lib/inets/examples/server_root/conf/ssl.conf index de49ceafd0..33ef749cf6 100644 --- a/lib/inets/examples/server_root/conf/ssl.conf +++ b/lib/inets/examples/server_root/conf/ssl.conf @@ -1,66 +1,54 @@ -Port 8088 -#ServerName your.server.net -SocketType ssl -Modules mod_alias mod_auth mod_esi mod_actions mod_cgi mod_dir mod_get mod_head mod_log mod_disk_log -ServerAdmin jocke@erix.ericsson.se -ServerRoot /var/tmp/server_root -ErrorLog logs/error_log_8088 -TransferLog logs/access_log_8088 -ErrorDiskLog logs/error_disk_log_8088 -ErrorDiskLogSize 200000 10 -TransferDiskLog logs/access_disk_log_8088 -TransferDiskLogSize 200000 10 -MaxClients 150 -DocumentRoot /var/tmp/server_root/htdocs -DirectoryIndex index.html welcome.html -DefaultType text/plain -Alias /icons/ /var/tmp/server_root/icons/ -Alias /pics/ /var/tmp/server_root/icons/ -ScriptAlias /cgi-bin/ /var/tmp/server_root/cgi-bin/ -ScriptAlias /htbin/ /var/tmp/server_root/cgi-bin/ -ErlScriptAlias /cgi-bin/erl httpd_example io -EvalScriptAlias /eval httpd_example io -SSLCertificateFile /var/tmp/server_root/ssl/ssl_server.pem -SSLCertificateKeyFile /var/tmp/server_root/ssl/ssl_server.pem -SSLVerifyClient 0 -#Script HEAD /cgi-bin/printenv.sh -#Action image/gif /cgi-bin/printenv.sh - -<Directory /var/tmp/server_root/htdocs/open> -AuthName Open Area -AuthUserFile /var/tmp/server_root/auth/passwd -AuthGroupFile /var/tmp/server_root/auth/group -require user one Aladdin -</Directory> - -<Directory /var/tmp/server_root/htdocs/secret> -AuthName Secret Area -AuthUserFile /var/tmp/server_root/auth/passwd -AuthGroupFile /var/tmp/server_root/auth/group -require group group1 group2 -</Directory> - -<Directory /var/tmp/server_root/htdocs/secret/top_secret> -AuthName Top Secret Area -AuthUserFile /var/tmp/server_root/auth/passwd -AuthGroupFile /var/tmp/server_root/auth/group -require group group3 -</Directory> - -<Directory /var/tmp/server_root/htdocs/mnesia_open> -AuthName Open Area -AuthMnesiaDB On -require user one Aladdin -</Directory> - -<Directory /var/tmp/server_root/htdocs/mnesia_secret> -AuthName Secret Area -AuthMnesiaDB On -require group group1 group2 -</Directory> - -<Directory /var/tmp/server_root/htdocs/mnesia_secret/top_secret> -AuthName Top Secret Area -AuthMnesiaDB On -require group group3 -</Directory> +[{port, 8088}, + {server_name, "your.server.net"}, + {socket_type, {essl,[]}}, + {modules, [mod_alias,mod_auth,mod_esi,mod_actions,mod_cgi,mod_dir,mod_get, + mod_head,mod_log,mod_disk_log]}, + {server_admin, "jocke@erix.ericsson.se"}, + {server_root, "/var/tmp/server_root"}, + {error_log, "logs/error_log_8088"}, + {transfer_log, "logs/access_log_8088"}, + {error_disk_log, "logs/error_disk_log_8088"}, + {error_disk_log_size, {200000,10}}, + {transfer_disk_log, "logs/access_disk_log_8088"}, + {transfer_disk_log_size, {200000,10}}, + {max_clients, 150}, + {document_root, "/var/tmp/server_root/htdocs"}, + {directory_index, ["index.html","welcome.html"]}, + {default_type, "text/plain"}, + {alias, {"/icons/", "/var/tmp/server_root/icons/"}}, + {alias, {"/pics/", "/var/tmp/server_root/icons/"}}, + {script_alias, {"/cgi-bin/", "/var/tmp/server_root/cgi-bin/"}}, + {script_alias, {"/htbin/", "/var/tmp/server_root/cgi-bin/"}}, + {erl_script_alias, {"/cgi-bin/erl", [httpd_example]}}, + {ssl, [{certfile, "/var/tmp/server_root/ssl/ssl_server_cert.pem"}, + {keyfile, "/var/tmp/server_root/ssl/ssl_key.pem"}, + {verify, verify_none}]}, + %%{script, {"HEAD" "/cgi-bin/printenv.sh"}}, + %%{action, {"image/gif", "/cgi-bin/printenv.sh"}}, + {directory, {"/var/tmp/server_root/htdocs/open", + [{require,["user","one","Aladdin"]}, + {auth_group_file,"/var/tmp/server_root/auth/group"}, + {auth_user_file,"/var/tmp/server_root/auth/passwd"}, + {auth_name,"Open Area"}]}}, + {directory, {"/var/tmp/server_root/htdocs/secret", + [{require,["group","group1","group2"]}, + {auth_group_file,"/var/tmp/server_root/auth/group"}, + {auth_user_file,"/var/tmp/server_root/auth/passwd"}, + {auth_name,"Secret Area"}]}}, + {directory, {"/var/tmp/server_root/htdocs/secret/top_secret", + [{require,["group","group3"]}, + {auth_group_file,"/var/tmp/server_root/auth/group"}, + {auth_user_file,"/var/tmp/server_root/auth/passwd"}, + {auth_name,"Top Secret Area"}]}}, + {directory, {"/var/tmp/server_root/htdocs/mnesia_open", + [{require,["user","one","Aladdin"]}, + {auth_mnesia_d_b,"On"}, + {auth_name,"Open Area"}]}}, + {directory, {"/var/tmp/server_root/htdocs/mnesia_secret", + [{require,["group","group1","group2"]}, + {auth_mnesia_d_b,"On"}, + {auth_name,"Secret Area"}]}}, + {directory, {"/var/tmp/server_root/htdocs/mnesia_secret/top_secret", + [{require,["group","group3"]}, + {auth_mnesia_d_b,"On"}, + {auth_name,"Top Secret Area"}]}}]. -- 2.35.3
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor