centOS+apache+mod_ssl+mod_phpの環境にhttpsでphpにアクセスして環境変数を見る。

実験用環境(vmwareにCentOS5.5をパッケージ選択なしでインストール)

yum -y install httpd mod_ssl mod_php

実験用スクリプト

<?php

foreach($_SERVER as $key => $value){
  echo '$_SERVER["'.$key.'"]=>'.$value."<br />";
}

実験結果

$_SERVER["HTTPS"]=>on
$_SERVER["SSL_VERSION_INTERFACE"]=>mod_ssl/2.2.3
$_SERVER["SSL_VERSION_LIBRARY"]=>OpenSSL/0.9.8e-fips-rhel5
$_SERVER["SSL_PROTOCOL"]=>TLSv1
$_SERVER["SSL_SECURE_RENEG"]=>true
$_SERVER["SSL_COMPRESS_METHOD"]=>NULL
$_SERVER["SSL_CIPHER"]=>AES128-SHA
$_SERVER["SSL_CIPHER_EXPORT"]=>false
$_SERVER["SSL_CIPHER_USEKEYSIZE"]=>128
$_SERVER["SSL_CIPHER_ALGKEYSIZE"]=>128
$_SERVER["SSL_CLIENT_VERIFY"]=>NONE
$_SERVER["SSL_SERVER_M_VERSION"]=>3
$_SERVER["SSL_SERVER_M_SERIAL"]=>637D
$_SERVER["SSL_SERVER_V_START"]=>Aug 14 03:11:22 2010 GMT
$_SERVER["SSL_SERVER_V_END"]=>Aug 14 03:11:22 2011 GMT
$_SERVER["SSL_SERVER_S_DN"]=>/C=--/ST=SomeState/L=SomeCity/O=SomeOrganization/OU=SomeOrganizationalUnit/CN=localhost.localdomain/emailAddress=root@localhost.localdomain
$_SERVER["SSL_SERVER_S_DN_C"]=>--
$_SERVER["SSL_SERVER_S_DN_ST"]=>SomeState
$_SERVER["SSL_SERVER_S_DN_L"]=>SomeCity
$_SERVER["SSL_SERVER_S_DN_O"]=>SomeOrganization
$_SERVER["SSL_SERVER_S_DN_OU"]=>SomeOrganizationalUnit
$_SERVER["SSL_SERVER_S_DN_CN"]=>localhost.localdomain
$_SERVER["SSL_SERVER_S_DN_Email"]=>root@localhost.localdomain
$_SERVER["SSL_SERVER_I_DN"]=>/C=--/ST=SomeState/L=SomeCity/O=SomeOrganization/OU=SomeOrganizationalUnit/CN=localhost.localdomain/emailAddress=root@localhost.localdomain
$_SERVER["SSL_SERVER_I_DN_C"]=>--
$_SERVER["SSL_SERVER_I_DN_ST"]=>SomeState
$_SERVER["SSL_SERVER_I_DN_L"]=>SomeCity
$_SERVER["SSL_SERVER_I_DN_O"]=>SomeOrganization
$_SERVER["SSL_SERVER_I_DN_OU"]=>SomeOrganizationalUnit
$_SERVER["SSL_SERVER_I_DN_CN"]=>localhost.localdomain
$_SERVER["SSL_SERVER_I_DN_Email"]=>root@localhost.localdomain
$_SERVER["SSL_SERVER_A_KEY"]=>rsaEncryption
$_SERVER["SSL_SERVER_A_SIG"]=>sha1WithRSAEncryption
$_SERVER["SSL_SESSION_ID"]=>4A8846DD16506F8550BF88DA5E287863F1D9084E2F133C66CE2BD57FDF02B8CF
$_SERVER["HTTP_HOST"]=>192.168.0.133
$_SERVER["HTTP_CONNECTION"]=>keep-alive
$_SERVER["HTTP_USER_AGENT"]=>Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/533.4 (KHTML, like Gecko) Chrome/5.0.375.126 Safari/533.4
$_SERVER["HTTP_CACHE_CONTROL"]=>max-age=0
$_SERVER["HTTP_ACCEPT"]=>application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
$_SERVER["HTTP_ACCEPT_ENCODING"]=>gzip,deflate,sdch
$_SERVER["HTTP_ACCEPT_LANGUAGE"]=>ja,en-US;q=0.8,en;q=0.6
$_SERVER["HTTP_ACCEPT_CHARSET"]=>Shift_JIS,utf-8;q=0.7,*;q=0.3
$_SERVER["PATH"]=>/sbin:/usr/sbin:/bin:/usr/bin
$_SERVER["SERVER_SIGNATURE"]=>
Apache/2.2.3 (CentOS) Server at 192.168.0.133 Port 443

$_SERVER["SERVER_SOFTWARE"]=>Apache/2.2.3 (CentOS)
$_SERVER["SERVER_NAME"]=>192.168.0.133
$_SERVER["SERVER_ADDR"]=>192.168.0.133
$_SERVER["SERVER_PORT"]=>443
$_SERVER["REMOTE_ADDR"]=>192.168.0.1
$_SERVER["DOCUMENT_ROOT"]=>/var/www/html
$_SERVER["SERVER_ADMIN"]=>root@localhost
$_SERVER["SCRIPT_FILENAME"]=>/var/www/html/index.php
$_SERVER["REMOTE_PORT"]=>56430
$_SERVER["GATEWAY_INTERFACE"]=>CGI/1.1
$_SERVER["SERVER_PROTOCOL"]=>HTTP/1.1
$_SERVER["REQUEST_METHOD"]=>GET
$_SERVER["QUERY_STRING"]=>
$_SERVER["REQUEST_URI"]=>/index.php
$_SERVER["SCRIPT_NAME"]=>/index.php
$_SERVER["PHP_SELF"]=>/index.php
$_SERVER["REQUEST_TIME"]=>1281759413