戻る

httpd-2-2-0.tgz with pkgtool install

Out line

httpd-2-2-0.tgz を /var/data/aaa/apache2/ に インストール しませう

ユーザーと グループの 作成

# cat /etc/passwd | grep apache
# cat /etc/group | grep apache
# groupadd -g 80 apache
# useradd -g apache -d /var/data/www/apache2 -s /bin/false -u 80 apache
/*  note
-g initial_group
-d home_dir
-s shell
-u uid
   */
# cat /etc/passwd | grep apache
apache:x:80:80::/var/data/www/apache2:/bin/false
# cat /etc/group | grep apache
apache:x:80:

ほたら 単純に インストール しませう

# pwd
/var/data/mkpackage/http-2-2-0
# pkgtool
httpd non exist so del apache server non need
install only

/etc/rc.d/rc.httpd

from slackware

#!/bin/sh # # /etc/rc.d/rc.httpd # # Start/stop/restart the Apache web server. # # To make Apache start automatically at boot, make this # file executable: chmod 755 /etc/rc.d/rc.httpd # case "$1" in 'start') /usr/sbin/apachectl start ;; 'stop') /usr/sbin/apachectl stop ;; 'restart') /usr/sbin/apachectl restart ;; *) echo "usage $0 start|stop|restart" ;; esac

これを 頂きましょう こういう風に 変更して

#!/bin/sh
#
# /etc/rc.d/rc.httpd
#
# Start/stop/restart the Apache web server.
#
# To make Apache start automatically at boot, make this
# file executable:  chmod 755 /etc/rc.d/rc.httpd
# Fri Mar  3 23:04:46 JST 2006 copy from slackware and modefy 
# place of apachectl
case "$1" in
   'start')
      /var/data/aaa/apache2/bin/apachectl -k start ;;
   'stop')
      /var/data/aaa/apache2/bin/apachectl -k stop ;;
   'restart')
      /var/data/aaa/apache2/bin/apachectl -k restart ;;
   *)
      echo "usage $0 start|stop|restart" ;;
esac

おっしゃる とおりに 致しましょう

# cd /etc/rc.d/
# chmod 775 rc.httpd
# chown root.root rc.httpd 
# ls -l rc.httpd 
-rwxrwxr-x    1 root     root          530 Mar  3 23:07 rc.httpd*

daemon

# cat -n  rc.M | grep http
   228  if [ -x /etc/rc.d/rc.httpd ]; then
   230      /etc/rc.d/rc.httpd > /dev/null 2>&1
# wc -l rc.M
    319 rc.M
# bc -q
319-228+1
92
quit
# tail -94 rc.M | head -7

# Start Apache.
if [ -x /etc/rc.d/rc.httpd ]; then
    echo -n " Apache"
    /etc/rc.d/rc.httpd > /dev/null 2>&1
fi

reboot

設定なしで よいのか?

# shutdown -r now

$ su -
Password: 
# ps ax | grep http

ほら みてみろ

# ./rc.httpd start
httpd: Syntax error on line 29 of /var/data/www/apache2/conf/httpd.conf:
ServerRoot must be a valid directory

httpd.conf

ほたら

# cd /var/data/aaa/
# chown -R apache.apache apache2/
# cd apache2/conf/
# cp httpd.conf 0001_httpd.conf_org
# vi httpd.conf  
# diff -s httpd.conf 0001_httpd.conf_org
17,18c17,18
< # with ServerRoot set to "/var/data/aaa/apache2" will be interpreted by the
< # server as "/var/data/aaa/apache2/logs/foo.log".
---
> # with ServerRoot set to \
"/var/data/mkpackage/http-2-2-0/httpd-2.2.0/work/var/data/aaa/apache2" will be interpreted by the
> # server as "/var/data/mkpackage/http-2-2-0/httpd-2.2.0/work/var/data/aaa/apache2/logs/foo.log".
29c29
< ServerRoot "/var/data/aaa/apache2"
---
> ServerRoot "/var/data/mkpackage/http-2-2-0/httpd-2.2.0/work/var/data/aaa/apache2"
65,69c65,66
< #User daemon
< #Group daemon
< User apache
< Group apache
< 
---
> User daemon
> Group daemon
90,91c87,88
< #ServerAdmin you@example.com
< ServerAdmin postmaster@bcnet.ne.jp 
---
> ServerAdmin you@example.com
> 
99,100c96,97
< #ServerName www.example.com:80 :::### lx www nl qqq -bcnet.ne.jp
< ServerName www.bcnet.ne.jp:80
---
> #ServerName www.example.com:80
> 
146,147c143,144
<     #    Options Indexes FollowSymLinks ### Change
<         Options  FollowSymLinks
---
>     Options Indexes FollowSymLinks
> 

force start

再度

# /etc/rc.d/rc.httpd start

UA (ブラウザ) に 書き込んで
http://192.168.0.5/
こんなもんが 見えるでしょう
It works!
至極あっさり したもんですな

correct error

# cd /etc/rc.d
# cp rc.M 0002_rc.M
# vi rc.M
# diff -s rc.M 0002_rc.M 
230c230
<     /etc/rc.d/rc.httpd start > /dev/null 2>&1
---
>     /etc/rc.d/rc.httpd > /dev/null 2>&1

再掲

# tail -94 /etc/rc.d/rc.M | head -7 # Start Apache. if [ -x /etc/rc.d/rc.httpd ]; then echo -n " Apache" /etc/rc.d/rc.httpd start > /dev/null 2>&1 fi

にゃんたろう 拝!
2006年 3月16日 (木) 21:20:10 JST 作成


戻る

Copyright © 2004.-2007. nyantarou All Rights Reserved.