LAMP環境を構築する前に、libiconvをインストールしておくと良いかな

SSLを入れておく

yum install openssl-devel

Apache2のインストール

http://www.apache.org/

httpd 2.0の場合

./configure \
--enable-so \
--enable-ssl \
--enable-rewrite \
--enable-deflate \
--enable-mods-shared=all \
--with-z=/usr/local \
--with-ssl=/usr/local \

httpd 2.2の場合

./configure \
--enable-so \
--enable-modules=all \
--enable-mods-shared=all \
--enable-ssl

--with-included-apr

make -j

make install

起動スクリプトをコピーする
cp ./build/rpm/httpd.init /etc/rc.d/init.d/httpd

パーミッション
chmod 755 /etc/rc.d/init.d/httpd

自動起動
chkconfig httpd on

httpd.conf

PHPのMIMEの設定
AddType application/x-httpd-php .php .phtml
AddType application/x-httpd-php-source .phps

ServerLimit

<IfModule mpm_prefork_module>
ServerLimit 512
StartServers 5
MinSpareServers 5
MaxSpareServers 10
MaxClients 256
MaxRequestsPerChild 0
</IfModule>

ログの設定

SetEnvIf Request_URI "(\.gif|\.jpe?g|\.png|\.css|\.js|\.ico|\.3gp|\.3g2|\.amc)$" log
SetEnvIf Remote_Addr "^192\.168\." log
SetEnvIf Remote_Addr "^127\.0\." log

ErrorLog "|/usr/local/apache2/bin/rotatelogs /usr/local/apache2/logs/error.%Y%m%d.log 86400 540"

CustomLog "|/usr/local/apache2/bin/rotatelogs /usr/local/apache2/logs/access.%Y%m%d.log 86400 540" combined env=!log

リダイレクト

###################################################
# リダイレクト
###################################################


ServerName domain.domain
ServerAlias *.domain.domain
Redirect permanent / http://www.dom.dom/

コメントを残す