Users' Guide to Orenosv for versions 1.1.3 or later. Contents -------- - Notation - HTTP - enabling PHP - enabling PERL - enabling SSI - enabling CGI - customizing directory index - enabling bandwidth control - controlling output buffering - enabling security - enabling HTTP compression - enabling content rewrite - enabling virtual hosts - configuring access log - setting up rotating access logs - enabling custom error message files - FTP - basic configuration - ftp admin module on HTTP - access logs - virtual paths (directory aliases) - setting up anonymous account - setting up normal user accounts - setting up access control - enabling bandwidth control - setting up user message files - setting up ftp server behind NAT - setting up FTP over SSL - Client Certificate Mapping and Authorization - enabling One Time Password (OTP) - Using Network Drives - OS-Integrated Authentication and Authorization - OS authentication (os_auth) - OS authorization (os_acl) - Anonymous user and os_acl - os_acl and network drives - Per-process OS security - Managing Orenosv Server - main console - ftp admin module - obfuscating passwords in passwd.txt - using md5-hashed passwords in passwd.txt - using encrypted passwords in passwd.txt - allowing users to change their own passwords - master password - HTML Files Application - IPv6 issues Notation ======== ORENOSV_HOME : the directory to which you installed orenosv server software. HTTP Service ============ virtual paths (directory aliases) --------------------------------- Virtual paths (or directory aliases) are specified with http_doc_alias paramter. Note: Orenosv is basically case-sensitive. example physical path: c:\Data virt. path phy. path http_doc_alias = /data c:\data ^----- has be "Data" Virtual paths in access control are only the exception to this rule. example http_auth_assign = /private ... Not only "/private/..." but also "/Private/..." and "/PRIVATE/..." matches with this line. enabling PHP ------------ - install PHP4 for Win32 to a directory. (assume it's c:\progs\php4 in here) Please note that Orenosv requires "cgi.force_redirect = 0" in php.ini. - define PHP handlers. CGI handler - uncomment out this line #http_handler_define = cgi-php mod_cgi c:/progs/php4/php.exe ISAPI handler - uncomment out this line #http_handler_define = dll-php mod_isapi c:/progs/php4/sapi/php4isapi.dll You can uncomment both lines. Please don't forget to adjust paths to EXE/DLL to suit your environment! - map URLs to either of two PHP handlers defined above to use ISAPI handler, uncomment this #http_handler_assign = *.php dll-php to use CGI handler, uncomment this #http_handler_assign = *.php cgi-php Note you have to choose only one to uncomment in the above example. Reboot the main server, try to access a PHP script and check event.log for any errors. ---- That's it. Read on below only if you want to do complex things. ---- - If you want to use CGI version for some part of your website and use ISAPI version for other part of your website, use different URL patterns. http_handler_assign = /myapp1/*.php cgi-php http_handler_assign = /phpgroupware/*.php dll-php - If you want to use separate processes for executing ISAPI version of PHP, specify process group in your http_handler_assign line. http_handler_assign = /phpgroupware/*.php dll-php pg=pg-default Read Proces Group sections in the config file for defining a process group. There's more info on various configurations in default config file. -- Advanced: multiple versions of PHP --- MS Windows basically don't allow multiple versions of a single application to coexist. However you follow the instructions below you can install multiple versions of PHP and specify which version to use. Note that a single instance of Orenosv can only use a single version of PHP. Let's say that we are installing PHP 4.2.1 into c:\progs\php421. - unpack php zip file into a install directory, from here refered to as . - collect all DLLs that your PHP require under . - copy \sapi\php4isapi.dll to - for required DLLs under \dll\ (those that you use to copy to \Winnt\System32), you should copy them to . - in http.conf specify /php4isapi.dll as PHP ISAPI handler. also add "-alt=1" option to it. # PHP ISAPI http_handler_define = dll-php mod_isapi -alt=1 c:/progs/php421/php4isapi.dll - to use CGI PHP, specify /php.exe as PHP CGI handler. also add "-env=all" option to it. # PHP CGI http_handler_define = cgi-php mod_cgi -env=all c:/progs/php421/php.exe - create php.ini under . use the environment variable PHPRC to specify path to that php.ini. # set environment variable env_add = PHPRC=c:\progs\php421 - naturally, you will change the following php.ini parameters appropriately. extension_dir = c:\progs\php421\extensions include_path = ".;c:\progs\php421;c:\progs\php4\pear" error_log = c:/progs/php421/errors.log If configured as noted in the above, - all required DLLs for PHP 4.2.1 are located under c:/progs/php421. - to change the PHP version that your Orenosv will use, you can just change the following parameters in http.conf: - env_add = PHPRC=... parameter - http_handler_define's for PHP or you can create another Orenosv instance to use another PHP version. enabling PERL ------------- Basically, the same as PHP. shbang (e.g., #!/usr/local/bin/perl) line in individual Perl script is ignored. - Install ActivePerl for Win32. We'll assume you install it in c:\Perl. - define Perl handler CGI handler - uncomment out this line #http_handler_define = cgi-perl mod_cgi perl.exe ISAPI handler - uncomment out this line #http_handler_define = dll-perl mod_isapi c:/perl/bin/perlIS.dll you can uncomment both lines. Be sure to correct paths to EXE and DLL to suit your environment. - map URLs to either of two Perl handlers defined above to use ISAPI handler, uncomment this #http_handler_assign = *.cgi dll-perl to use CGI handler, uncomment this #http_handler_assign = *.cgi cgi-perl You can uncomment only one of the two assign lines. If you want to execute .pl files also as Perl scripts, map *.pl to Perl handler. #execute *.pl scripts with CGI Perl #http_handler_assign = *.pl cgi-perl Reboot the main server, try to access a Perl script and check event.log for any errors. trouble shooting PHP/Perl problems ---------------------------------- - CGI perl Error messages that are written to stderr will go to main server's error.log. - ISAPI Perl Error messages will go to $PERLDIR/bin/PerlIS-Err.log. - PHP Depends on settings in php.ini: log_errors = on ; error_log = ; if set up this way, error messages will be written to . Tips on PHP Windows ------------------- [limits] php.ini max_execution_time = 1000 ; Maximum execution time of each script, in seconds max_input_time = 1000 ; Maximum amount of time each script may spend parsing request data memory_limit = 8M ; Maximum amount of memory a script may consume (8MB) post_max_size = 100M ; Maximum size of POST data that PHP will accept. upload_max_filesize = 100M ; Maximum allowed size for uploaded files http.conf mod_cgi -x=900 : max execution time of php.exe [Windows-specific] php.ini session.save_path = c:\temp extension=php_gd2.dll ; use this ext for GD 2.x. enabling SSI ------------ - Currently SSI is implemented as a CGI program. Because of this, there are some restrictions on usage of "virtual" attribute. Supported commands and their attributes: o #config { timefmt="" | sizefmt="" } o #echo { var="" } : All CGI variables and DATE_LOCAL,DATE_GMT,DOCUMENT_NAME,DOCUMENT_URI o #include { file="" | virtual="" } o #flastmod { file="" | virtual="" } o #fsize { file="" | virtual="" } o #exec { cmd="" } NOTE: this command needs to be enabled explicitly by giving "-exec_cmd" option to cgissi.exe. o #exec { cgi="" } NOTE: this command needs to be enabled explicitly by giving "-exec_url" option to cgissi.exe. for SSI usage, please refer to the following page: http://hoohoo.ncsa.uiuc.edu/docs/tutorials/includes.html - CGI SSI is already enabled in default http.conf. If you want to change its config or disable it totally, look for the following lines in http.conf. --- http_handler_define = cgi-ssi mod_cgi -x=15 cgissi.exe http_handler_assign = *.shtm cgi-ssi http_handler_assign = *.shtml cgi-ssi --- For example if you want to enable "#exec" command, change the line of "http_handler_define" to: http_handler_define = cgi-ssi mod_cgi -x=15 cgissi.exe -exec - Options to cgissi.exe cgissi.exe [-exec|-exec_cmd] [-exec_url] [-incl_url] -exec or -exec_cmd : enable #exec cmd="" command. if not enabled, #exec cmd= cannot be used. -exec_url : enable #exec cgi="" command. if not enabled, #exec cgi= cannot be used. -incl_url : enable #include virtual="" functionality. if not enabled, #include virtual= can only be used for including local files, but not from URL. can be either - full URL, e.g., "http://localhost:8888/test.cgi" - local absolute virtual path, e.g., "/test.cgi" - local relative virtual path, e.g., "test.html" In all cases, cgissi program executes a full HTTP transaction to fetch the requested resource, independent from the original request. That is, cgissi will not forward any request headers sent in from the original request. If the resource to be fetched requires username/passwd, specify "http://username:passwd@localhost:8888/test.cgi". enabling CGI ------------ customizing directory index --------------------------- enabling bandwidth control -------------------------- Let's assume that you have upstream of 128Kb (Kilo Bits). and you want to restrict bandwidth of your MP3 download area to 64Kb. With 64Kbps, you can probably do 6KB (Kilo Bytes) per second. - define a bandwidth group of 6KB/sec # http_bw_define = music 6K - map requests to MP3 area to the bandwidth group defined above # http_bw_assign = /mymusic/*.mp3 music http_bw_assign = /mymusic/*.MP3 music Configured like the above, all the connections requesting MP3 files share the same bandwidth of 6KB/sec. In other words, the bandwidth is distributed among all the connections. Note that this bandwidth scheduling is not fair in any sense. 1) One connection on a fast link and one connection on a slow link. The faster connection can consume large portion of the allotted bandwidth while the slow connection will be left with any remaining bandwidth. 2) N connections from one host and one connection from another host. The speed of the link is the same between the two hosts. The first host consumes bandwidth N times larger than the second host. Typical is a specialized downloader program that does "divide and download" scheme. To solve both problems, another option is introduced. Limit Per Host: Bandwidth in a bandwidth group is distributed fairly with regard to each client host. To continue with the previous example, if 3 PCs are downloading MP3 files, each of them can download at maximum speed of 6K/3 (= 2KB), regardless of how many connections a PC is using. To use this options specify "-pip" (Per IP) like: #