아파치 실행 확인
apachectl status
아파치 실행
apachectl start
설정 파일 변경
/etc/httpd/conf/httpd.conf
설치 : yum -y install httpd
httpd : /usr/sbin/httpd
apachectl : /usr/sbin/apachectl
conf : /etc/httpd/conf/httpd.conf
conf | /etc/httpd/conf |
---|---|
홈 | /var/www/html |
로그 | /etc/httpd/logs |
pid-file | /etc/httpd/run/httpd.pid |
apachectl start httpd start
apachectl stop httpd stop
apachectl restart httpd restart
아파치 시작 /etc/rc.d/init.d/httpd start
아파치 중지 /etc/rc.d/init.d/httpd stop
아파치 리스타트 /etc/rc.d/init.d/httpd restart
apachectl status
/etc/init.d/httpd /sbin/service httpd /usr/sbin/apachectl
service httpd start
curl 127.0.0.1
ps -ef | grep httpd
sudo service apache2 status
sudo netstat -lntp | grep apache2
find / -name apachectl
/usr/local/apache/bin/httpd -v
-D name | <IfDefine name> 지시자에 사용되는 이름을 정의함 |
---|---|
-d directory | 아파치실행시에 아파치의 Root 경로를 따로 지정해 줄 수 있음 |
-f file | 아파치 설정파일을 직접 지정해 줄 수 있음 |
-C “directive” | 아파치 설정파일을 읽기 전 의 process directive |
-c “directive” | 아파치 설정파일을 읽은 후 의 process directive |
-v | 아파치의 버전을 보여줌 |
-V | 컴파일시 사용했던 옵션을 보여줌 |
-h | httpd 실행시 사용할 수 있는 옵션들의 도움말을 보여줌 |
-l | 컴파일시에 사용했던 모듈들을 보여줌 |
-L | 설정가능한 지시자를 보여줌 |
-S | 설정되어있는 가상호스트를 보여줌 |
-t | 설정파일(httpd.conf)파일의 문법적인 체크를 할 수 있음 |
-T | DocumentRoot 항목체크는 제외하고 설정파일의 문법적인 테스트함 |
기존에 설치되어 있는 아파치에 모듈 추가 설치하기
find . -name “모듈이름”
{아파치 설치디렉토리}/bin/apxs -iax {2번에서 찾은 모듈경로}/모듈이름.c
{아파치 설치디렉토리}/bin/apachectl restart
또는
{아파치 설치디렉토리}/bin/apachectl graceful
apxs 파일이 /usr/sbin
에 위치함
libxml 은 /usr/include/libxml2/
# apxs -c -I/usr/include/libxml2 -I. -i mod_proxy_html.c # apxs -c -I/usr/include/libxml2 -I. -i mod_xml2enc.c
LoadModule proxy_module modules/mod_proxy.so LoadModule proxy_http_module modules/mod_proxy_http.so LoadModule headers_module modules/mod_headers.so LoadFile /usr/lib/libxml2.so LoadModule proxy_html_module modules/mod_proxy_html.so LoadModule xml2enc_module modules/mod_xml2enc.so