まあ一度実例をあげておきましょう”httpd.conf”は 省略しますが?にゃん たろうが行ったものです。
nyan:~# df
Filesystem 1k-blocks Used Available Use% Mounted on
/dev/hdb1 4960464 2381204 2323212 51% /
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
nyan:/home# cd /var/
nyan:/var# mkdir data
nyan:/var# ls -l data/
total 0
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
nyan:/var# mount /dev/hda2 /var/data/
nyan:/var# df
Filesystem 1k-blocks Used Available Use% Mounted on
/dev/hdb1 4960464 2381212 2323204 51% /
/dev/hda2 2822080 8 2678716 1% /var/data
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
nyan:/var# cat /etc/mtab
/dev/hdb1 / ext3 rw 0 0
none /proc proc rw 0 0
none /dev/pts devpts rw,gid=5,mode=620 0 0
/dev/hda2 /var/data ext2 rw 0 0
nyan:/var# umount /var/data/
nyan:/var# df
Filesystem 1k-blocks Used Available Use% Mounted on
/dev/hdb1 4960464 2381220 2323196 51% /
nyan:/var# cat /etc/mtab
/dev/hdb1 / ext3 rw 0 0
none /proc proc rw 0 0
none /dev/pts devpts rw,gid=5,mode=620 0 0
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
non@nyan:~/apache$ cp /etc/fstab .
non@nyan:~/apache$ cat fstab
/dev/sda10 swap swap defaults 0 0
/dev/hdb1 / ext3 defaults 1 1
/dev/cdrom /cdrom iso9660 \
user,ro,noauto,exec,codepage=932,iocharset=euc-jp 0 0
none /proc proc defaults 0 0
none /dev/pts devpts gid=5,mode=620 0 0
non@nyan:~/apache$ emacs fstab &
non@nyan:~/apache$ mv fstab~ 014_fstab_org
non@nyan:~/apache$ diff -s fstab 014_fstab_org
3d2
< /dev/hda2 /var/data ext2 defaults 1 2
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
nyan:/etc# mv fstab 014_fstab_org
nyan:/etc# cp /home/non/apache/fstab .
nyan:/etc# diff -s fstab 014_fstab_org
3d2
< /dev/hda2 /var/data ext2 defaults 1 2
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Reboot
nyan:~# df
Filesystem 1k-blocks Used Available Use% Mounted on
/dev/hdb1 4960464 2381868 2322548 51% /
/dev/hda2 2822080 8 2678716 1% /var/data
nyan:~# mount
/dev/hdb1 on / type ext3 (rw)
/dev/hda2 on /var/data type ext2 (rw)
none on /proc type proc (rw)
none on /dev/pts type devpts (rw,gid=5,mode=620)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
OK
nyan:~# cat /etc/group | grep apache
nyan:~# cat /etc/passwd | grep apache
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
nyan:~# groupadd -g 80 apache
nyan:~# useradd -g apache -d /var/data/www -s /bin/false -u 80 apache
nyan:~# cat /etc/group | grep apache
apache:x:80:
nyan:~# cat /etc/passwd | grep apache
apache:x:80:80::/var/data/www:/bin/false
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
nyan:~# mkdir /var/data/www
nyan:~# ls -l /var/data/
total 8
drwxr-xr-x 2 root root 4096 Apr 14 16:03 lost+found/
drwxr-xr-x 2 root root 4096 Sep 24 20:30 www/
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
nyan:~# cd /usr/local/src/
nyan:/usr/local/src# cp /home/tar_dir/httpd-2.0.49.tar.gz .
nyan:/usr/local/src# ls -l httpd-2.0.49.tar.gz
-rw------- 1 root root 5919279 Sep 24 20:32 httpd-2.0.49.tar.gz
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
nyan:/usr/local/src# tar zxvf httpd-2.0.49.tar.gz
nyan:/usr/local/src# cd httpd-2.0.49/
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
nyan:/usr/local/src/httpd-2.0.49#\
./configure --enable-so --prefix=/var/data/www/apache2
nyan:/usr/local/src/httpd-2.0.49# make
nyan:/usr/local/src/httpd-2.0.49# make install
nyan:/usr/local/src/httpd-2.0.49# ps ax | grep http
14452 pts/0 S 0:00 grep http
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
nyan:/usr/local/src/httpd-2.0.49# cd /var/data/www/apache2/bin/
nyan:/var/data/www/apache2/bin# ./apachectl start
nyan:/var/data/www/apache2/bin# ps ax | grep http
14458 ? S 0:00 /var/data/www/apache2/bin/httpd -k start
14459 ? S 0:00 /var/data/www/apache2/bin/httpd -k start
14460 ? S 0:00 /var/data/www/apache2/bin/httpd -k start
14461 ? S 0:00 /var/data/www/apache2/bin/httpd -k start
14462 ? S 0:00 /var/data/www/apache2/bin/httpd -k start
14463 ? S 0:00 /var/data/www/apache2/bin/httpd -k start
14465 pts/0 S 0:00 grep http
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
you can see apache01w300h263.png
nyan:~# cd /etc/rc.d/
nyan:/etc/rc.d# nl rc.M | grep httpd
111 if [ -x /etc/rc.d/rc.httpd ]; then
112 . /etc/rc.d/rc.httpd
nyan:/etc/rc.d# wc -l rc.M
160 rc.M
nyan:/etc/rc.d# tail -31 rc.M | head -6
# Start Web server:
if [ -x /etc/rc.d/rc.httpd ]; then
. /etc/rc.d/rc.httpd
fi
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
non@nyan:~/apache$ emacs rc.httpd &
nyan:/etc/rc.d# cp /home/non/apache/rc.httpd .
nyan:/etc/rc.d# ls -l rc.httpd
-rw-r--r-- 1 root root 54 Sep 24 21:19 rc.httpd
nyan:/etc/rc.d# chmod 755 rc.httpd
nyan:/etc/rc.d# ls -l rc.httpd
-rwxr-xr-x 1 root root 54 Sep 24 21:19 rc.httpd*
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
nyan:/etc/rc.d# cat /var/named/bcnet.hosts | grep www
www IN CNAME nyan
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
non@nyan:~/apache$ cp /var/data/www/apache2/conf/httpd.conf .
non@nyan:~/apache$ emacs httpd.conf &
non@nyan:~/apache$ mv httpd.conf~ httpd.conf_first_org
nyan:/etc/rc.d# cd /var/data/www/apache2/conf/
nyan:/var/data/www/apache2/conf# mv httpd.conf httpd.conf_org
nyan:/var/data/www/apache2/conf# mv /home/non/apache/httpd.conf .
nyan:/var/data/www/apache2/conf# cd ../
nyan:/var/data/www/apache2# cd htdocs/
nyan:/var/data/www/apache2/htdocs# pwd
/var/data/www/apache2/htdocs
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
nyan:/var/data/www/apache2/htdocs# mkdir u_org_data
nyan:/var/data/www/apache2/htdocs# mv apache_pb* u_org_data/
nyan:/var/data/www/apache2/htdocs# mv index.html.* u_org_data/
nyan:/var/data/www/apache2/htdocs# cd /var/data/www/
nyan:/var/data/www# ls -l
total 4
drwxr-xr-x 15 root root 4096 Sep 24 20:55 apache2/
nyan:/var/data/www# chown -R apache.apache apache2/
nyan:/var/data/www# ls -l
total 4
drwxr-xr-x 15 apache apache 4096 Sep 24 20:55 apache2/
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
put into sample css and sample index.html
nyan:/var/data/www# cd apache2/htdocs/
nyan:/var/data/www/apache2/htdocs# ls -l
total 12
-rw-r--r-- 1 apache apache 2988 Sep 24 22:55 first.css
-rw-r--r-- 1 apache apache 1515 Sep 24 22:58 index.html
drwxr-xr-x 2 apache apache 4096 Sep 24 21:47 u_org_data/
~~~~~~~~~~~~~~~~~~~~~~
you may see apache02w300h294.png
End of text.
この様な塩梅です。尚 apache01w300h263.png と apache02w300h294.png 最 初の 場合と 何か index.html を作成した後での画像を 添付します。
初期画面 は この様になります。
また index.html 作成後はこの様になります。
これが にゃんたろうの実例です。