UNIX/Apache HTTP Server 2.0.x のバックアップ差分(No.1)


  • 追加された行はこの色です。
  • 削除された行はこの色です。
* apache2 2.0.53 [#yad479f1]

通常
 apt-get install openssl
 apt-get install libssl-dev
 
 OPTIM="-O2"
 ./configure --prefix=/usr/local/apache2-2.0.53 --enable-so --enable-ssl
 
 make
 make install
 
 cd /usr/local
 ln -s apache2-2.0.53 apache2
 
 LanguagePriorityのjaを先頭に移動する
 AddDefaultCharsetにnoneを設定する

~
全てmodule
# allを指定すると本当に全部(Order等も)moduleになってしまう。
 ./configure --enable-so \
 --enable-modules=all \
 --enable-mods-shared=all

~
proxy付き
 ./configure --prefix=/usr/local/apache2 \
 --enable-so \
 --enable-cache=shared \--enable-disk-cache=shared \
 --enable-mem-cache=shared \
 --enable-file-cache=shared \
 --enable-proxy=shared \
 --enable-proxy_connect=shared \
 --enable-rewrite=shared

~
このエラーがでた場合、/etc/ld.so.confに/usr/local/libを追記してからldconfigを実行する。
 /usr/local/apache2-2.0.53/bin/httpd: error while loading shared libraries: libiconv.so.2: cannot open shared object file: No such file or directory

** logrotate [#h2f42f03]
 /var/log/apache2/access_log /var/log/apache2/error_log /var/log/apache2/ssl_request_log /var/log/apache2/ssl_engine_log /var/log/apache2/suexec_log {
     weekly
     rotate 5
     compress
     missingok
     sharedscripts
     postrotate
         /bin/kill -HUP `cat /usr/local/apache2/logs/httpd.pid 2> /dev/null` 2> /dev/null
     endscript
 }

** 起動スクリプト [#dcc4fe73]
 #!/bin/bash
 #
 # chkconfig: 345 98 02
 # description: apache2
 #
 # Startup script for Apache Web Server
 #
 
 
 # ----- Save and Set Environment Variables --------------------------------
 
 PROGDIR=/usr/local/apache2/bin
 
 
 # ----- Define Function ---------------------------------------------------
 
 start() {
   echo -n $"Starting apache2: "
   ${PROGDIR}/apachectl start
   RETVAL=$?
   if [ $RETVAL -eq 0 ]; then
     echo -e " \033[1m[\033[32m OK \033[37m]\033[0m"
   else
     echo -e " \033[1m[\033[31m NG \033[37m]\033[0m"
   fi
 }
 
 stop() {
   echo -n $"Stopping apache2: "
   ${PROGDIR}/apachectl stop
   RETVAL=$?
   if [ $RETVAL -eq 0 ]; then
     echo -e " \033[1m[\033[32m OK \033[37m]\033[0m"
   else
     echo -e " \033[1m[\033[31m NG \033[37m]\033[0m"
   fi
 }
 
 
 # ----- Execute The Requested Command -------------------------------------
 
 case "$1" in
   start)
     start
     ;;
   stop)
     stop
     ;;
   restart|reload)
     stop
     start
     ;;
   *)
     echo "Usage: $0 {start|stop|restart}"
     exit 1
 esac
 
 exit 0