# groupadd -g 620 apache
# useradd -u 620 -g apache -s /sbin/nologin -M apache
# cd /usr/local/src/
# wget https://www.apache.org/dist/httpd/httpd-2.2.27.tar.gz
# tar xvzf httpd-2.2.27.tar.gz
# cd httpd-2.2.27
# ./configure --prefix=/usr/local/httpd-2.2.27 --libdir=/usr/local/httpd-2.2.27/lib64 --enable-rewrite=shared --enable-ssl=shared --enable-deflate --enable-headers=shared --enable-proxy=shared --enable-so --enable-proxy-ajp=shared --enable-proxy-balancer=shared --with-ssl
# make
# make install
# ln -s httpd-2.2.27/ httpd
# chown –R apache.apache /usr/local/httpd-2.2.27
# vim /usr/local/httpd/conf/httpd.conf
User apache Group apache ServerName 127.0.0.1:80 ErrorLog "/var/log/httpd/error_log" CustomLog "/var/log/httpd/access_log" common
# cp /usr/local/src/httpd-2.2.27/build/rpm/httpd.init /etc/rc.d/init.d/httpd
# chmod 755 /etc/init.d/httpd
# vi /etc/init.d/httpd
httpd=${HTTPD-/usr/local/httpd/bin/httpd} pidfile=${PIDFILE-/usr/local/httpd/logs/httpd.pid} # check for 1.3 configuration check13 () { CONFFILE=/usr/local/httpd/conf/httpd.conf
# chkconfig httpd on
# service httpd start Starting httpd: [ OK ]
秘密鍵、証明書、中間証明書ファイルを/usr/local/httpd/confにコピーしておく。
# vim /usr/local/httpd/conf/extra/httpd-ssl.conf
ServerName 127.0.0.1:443 ErrorLog "/var/log/httpd/ssl_error_log" TransferLog "/var/log/httpd/ssl_access_log" SSLCertificateFile "/usr/local/httpd-2.2.27/conf/server.crt" SSLCertificateKeyFile "/usr/local/httpd-2.2.27/conf/server.key" SSLCertificateChainFile "/usr/local/httpd-2.2.27/conf/server-ca.crt"
# vim /usr/local/httpd/conf/httpd.conf
# Secure (SSL/TLS) connections Include conf/extra/httpd-ssl.conf
# service httpd restart Stopping httpd: [ OK ] Starting httpd: Apache/2.2.27 mod_ssl/2.2.27 (Pass Phrase Dialog) Some of your private key files are encrypted for security reasons. In order to read them you have to provide the pass phrases. Server 127.0.0.1:443 (RSA) Enter pass phrase: OK: Pass Phrase Dialog successful. [ OK ]