centos apache http 서버 구동시키기
<아파치를 이용해 파일을 http로 제공하기>
<centos6.5>
설치하기
# yum -y install httpd*
시작하기
# service httpd start or # /etc/rc.d/init.d/httpd start
apache 데몬 활성화
# chkconfig httpd on
( 서버 부팅 시 자동으로 Apache 데몬을 실행할 수 있게 추가 합니다)
설정파일
설정파일 변경
#
# 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/inspace/TEST_WEB"
#
# This should be changed to whatever you set DocumentRoot to.
#
<Directory "/home/~~/~~">
#
# Each directory to which Apache has access can be configured with respect
# to which services and features are allowed and/or disabled in that
# directory (and its subdirectories).
#
# First, we configure the "default" to be a very restrictive set of
# features.
#
<Directory />
Options FollowSymLinks
AllowOverride None
Order deny,allow
Allow from all
</Directory>
위와같이 설정하면 http 서비스를 통해서 내 디렉토리에 접근할 수 있다.
단, 권한문제때문에 공유한 폴더는 -755로 해줘야 한다. (/home/user -> 여기폴더부터 권한을 줘야한다. 그렇지 않으면 안되네)
<centos6.5>
설치하기
# yum -y install httpd*
시작하기
# service httpd start or # /etc/rc.d/init.d/httpd start
apache 데몬 활성화
# chkconfig httpd on
( 서버 부팅 시 자동으로 Apache 데몬을 실행할 수 있게 추가 합니다)
설정파일
# 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/inspace/TEST_WEB"
#
# This should be changed to whatever you set DocumentRoot to.
#
<Directory "/home/~~/~~">
#
# Each directory to which Apache has access can be configured with respect
# to which services and features are allowed and/or disabled in that
# directory (and its subdirectories).
#
# First, we configure the "default" to be a very restrictive set of
# features.
#
<Directory />
Options FollowSymLinks
AllowOverride None
Order deny,allow
Allow from all
</Directory>
위와같이 설정하면 http 서비스를 통해서 내 디렉토리에 접근할 수 있다.
단, 권한문제때문에 공유한 폴더는 -755로 해줘야 한다. (/home/user -> 여기폴더부터 권한을 줘야한다. 그렇지 않으면 안되네)
댓글
댓글 쓰기