테스트 환경
네이버 클라우드 플랫폼(NCP) 일반 리눅스 서버 (CentOS 7.8)
1.아파치설치
# yum install java-1.8*
# wget https://downloads.apache.org/httpd/httpd-2.4.51.tar.gz
# wget https://downloads.apache.org/apr/apr-1.6.5.tar.gz
# wget https://downloads.apache.org/apr/apr-util-1.6.1.tar.gz
# tar -zxvf httpd-2.4.51.tar.gz tar -xvzf apr-1.6.5.tar.gz tar -xvzf apr-util-1.6.1.tar.gz
# mv apr-1.6.5 httpd-2.4.51/srclib/apr mv apr-util-1.6.1 httpd-2.4.51/srclib/apr-util mkdir /apache
# yum install expat-devel
2.아파치 컴파일
# ./httpd-2.4.51/configure --prefix=/apache/httpd-2.4.51 --with-included-apr --enable-so --enable-ssl=shared --with-ssl=/usr/local/ssl --enable-rewrite --with-included-apr-util --with-included-pcre
# make
# make install
3.아파치 서비스 등록
# vi /usr/lib/systemd/system/httpd.service
아래 내용 작성 후 저장
# vi /apache/httpd-2.4.51/conf/httpd.conf
내용중 user, group 에 daemon이라고 되어있는부분 nobody로 수정
4.아파치 시작,확인,종료
# systemctl daemon-reload
# systemctl start httpd
# systemctl status httpd
# systemctl stop httpd
# vi /apache/httpd-2.4.51/conf/httpd.conf (아래처럼 내용에서 DocumentRoot & Directory 변경)
DocumentRoot "/var/www/html" <Directory "/var/www/html">
# vi /var/www/html/index.html (생성후 편집)
<h1> web01 server running </h1>
# systemctl enable httpd;systemctl start httpd
(웹페이지 확인 or curl -s http://localhost)
'Linux Server' 카테고리의 다른 글
[Linux&Window] Zabbix Server & Agent 설치하기 (0) | 2022.07.18 |
---|---|
[CentOS 7.8] Grafana-Node Exporther-Prometheus 구성하기 (0) | 2022.07.18 |
[CentOS 7.8] MySQL 8 설치 및 저장소 위치 변경 (0) | 2022.01.07 |
[CentOS 7.8] 쿠버네티스(K8S) 클러스터 구축 (0) | 2022.01.06 |
[CentOS 7.8] Linux LVM 세팅 (0) | 2022.01.06 |