-->

2013-08-13

memo: httpd.conf

ServerRoot "/usr/local/apache_mod-php"
Listen 8084
LoadModule authz_core_module modules/mod_authz_core.so
LoadModule unixd_module modules/mod_unixd.so
LoadModule php5_module        modules/libphp5.so
LoadModule xsendfile_module   modules/mod_xsendfile.so
LoadModule alias_module modules/mod_alias.so
LoadModule log_config_module modules/mod_log_config.so
LoadModule logio_module modules/mod_logio.so
User daemon
Group daemon
ServerAdmin you@example.com
ServerName vmware-gentoo1
<Directory />
    AllowOverride None
    Options None
    Require all denied
</Directory>
DocumentRoot "/usr/local/apache_mod-php/htdocs/"
ForceType application/x-httpd-php
EnableSendfile On
XSendFile on
XSendFilePath /usr/local/apache_mod-php/files/download/
<Directory "/usr/local/apache_mod-php/files/download/">
    AllowOverride None
    Options None
    Require all granted
</Directory>
Alias / /usr/local/apache_mod-php/scripts/php/index.php/
<Directory "/usr/local/apache_mod-php/scripts/php/">
    AllowOverride None
    Options None
    Require all granted
</Directory>
ErrorDocument 400 "400 Bad Request"
ErrorDocument 401 "401 Unauthorized"
ErrorDocument 402 "402 Payment Required"
ErrorDocument 403 "403 Forbidden"
ErrorDocument 404 "404 Not Found"
ErrorDocument 405 "405 Method Not Allowed"
ErrorDocument 406 "406 Not Acceptable"
ErrorDocument 407 "407 Proxy Authentication Required"
ErrorDocument 408 "408 Request Timeout"
ErrorDocument 409 "409 Conflict"
ErrorDocument 410 "410 Gone"
ErrorDocument 411 "411 Length Required"
ErrorDocument 412 "412 Precondition Failed"
ErrorDocument 413 "413 Request Entity Too Large"
ErrorDocument 414 "414 Request-URI Too Long"
ErrorDocument 415 "415 Unsupported Media Type"
ErrorDocument 416 "416 Requested Range Not Satisfiable"
ErrorDocument 417 "417 Expectation Failed"
ErrorDocument 500 "500 Internal Server Error"
ErrorDocument 501 "501 Not Implemented"
ErrorDocument 502 "502 Bad Gateway"
ErrorDocument 503 "503 Service Unavailable"
ErrorDocument 504 "504 Gateway Timeout"
ErrorDocument 505 "505 HTTP Version Not Supported"
ErrorLog "logs/error_log"
LogLevel warn
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %I %O \"%{id}n\" \"%{time}n\"" combinedio
CustomLog "logs/access_log" combinedio
ServerTokens ProductOnly
StartServers             3
MinSpareThreads        750
MaxSpareThreads        750
ThreadsPerChild        250
MaxRequestWorkers      750
MaxConnectionsPerChild 25000
ServerLimit              3
ThreadLimit            750
MaxKeepAliveRequests   500
KeepAlive               On
KeepAliveTimeout         3
ListenBacklog        65535

// sample. \"%{id}n\" \"%{time}n\"
// auto_prepend_file etc.
{
    function microtime_float()
    {
        list($usec, $sec) = explode(" ", microtime());
        return ((float)$usec + (float)$sec);
    }
    register_shutdown_function(function ($timeStart) {
            apache_note("time", sprintf("%.5f", microtime_float() - $timeStart));
            apache_note("id", mydb::getuid());
        }, microtime_float());
}
// dummy.
class mydb
{
    static function getuid()
    {
        return "dummy-" . substr(md5(microtime()), 0, 8);
    }
}

/manual/をindex.phpでは無いアクセスにする場合。
# なにかが必要。
LoadModule xxx_module   modules/mod_xxx.so
# Alias / の前に書く。
Alias /manual/ /usr/local/apache_mod-php/manual/
<Directory "/usr/local/apache_mod-php/manual/">
    AllowOverride None
    Options None
    Require all granted
    ForceType None
</Directory>

...

Alias / /usr/local/apache_mod-php/scripts/php/index.php/

0 件のコメント: