apache HTTPD의 환경 설정은 /etc/httpd/conf/httpd.conf 에서 한다.
위 파일을 보면 많은 내용들이 있는데, 그중에 소스 파일의 위치는 변경하기 위해서는
위의 두부분을 찾아서 변경하고 httpd 데몬을 재구동시키면 된다.
웹브라우저는 띄우고 http://localhost/ 하면 새로운 디렉토리에서 시작되는 것을 볼수 있을것이다.
위 파일을 보면 많은 내용들이 있는데, 그중에 소스 파일의 위치는 변경하기 위해서는
[citylock@localhost conf]$ vi /etc/httpd/conf/httpd.conf
#
# DocumentRoot: The directory out of which you will serve your
# documents. By default, all requests are taken from this directory, but
# symbolic links and aliases may be used to point to other locations.
#
# DocumentRoot "/var/www/html"
DocumentRoot "/home/citylock/src/html"
(중간 생략)
#
# This should be changed to whatever you set DocumentRoot to.
#
#<Directory "/var/www/html">
<Directory "/home/citylock/src/html">
#
# DocumentRoot: The directory out of which you will serve your
# documents. By default, all requests are taken from this directory, but
# symbolic links and aliases may be used to point to other locations.
#
# DocumentRoot "/var/www/html"
DocumentRoot "/home/citylock/src/html"
(중간 생략)
#
# This should be changed to whatever you set DocumentRoot to.
#
#<Directory "/var/www/html">
<Directory "/home/citylock/src/html">
위의 두부분을 찾아서 변경하고 httpd 데몬을 재구동시키면 된다.
[root@localhost init.d]# /etc/init.d/httpd restart
Stopping httpd: [ OK ]
Starting httpd: [ OK ]
Stopping httpd: [ OK ]
Starting httpd: [ OK ]
웹브라우저는 띄우고 http://localhost/ 하면 새로운 디렉토리에서 시작되는 것을 볼수 있을것이다.