본문 바로가기
  • Computer & Rose
+ Rocky Linux/+ APM 설치

[APM설치] 최신 Apache 서비스 등록 및 설정 (Apache 2.4.54)

by 컴앤로즈 2022. 12. 14.
반응형

최신 Apache 서비스 등록 및 설정 (Apache 2.4.54)

 

1. httpd service 등록 및 시작
: httpd 설치 디렉토리/bin/apachectl  파일을 시스템 서비스 파일로 복사하고 변경해 줍니다.

 

# cp /usr/local/apache2/bin/apachectl /etc/init.d/httpd
# vi /etc/init.d/httpd 실행하여 아래의 5 줄을 추가해 줍니다.

# chkconfig: 2345 90 90
# description: Apache is a World Wide Web server.
# processname: /usr/local/apache2/bin/apachectl
# config: /usr/local/apache2/conf/httpd.conf
# pidfile: /usr/local/apache2/logs/httpd.pid

 

 

2. /usr/local/apache2/conf/httpd.conf 파일 환경 설정 

# vi /usr/local/apache2/conf/httpd.conf (아래의 ServerName에 서버의 ip주소를 설정하고 80번 포트를 연결시켜 줍니다.)

 ServerName=xxx.xxx.xxx.xxx:80  (ex: 192.168.0.4:80)

: 나머지 환경 설정은 본인 서버의 운용 상황에 맞게 설정해 줍니다.


3. 서비스를 등록하고 시작해 줍니다.
chkconfig --add httpd
chkconfig httpd on
chkconfig --list | grep httpd

systemctl enable httpd
systemctl start httpd
systemctl status httpd

4. 방화벽 설정
firewall-cmd --permanent --zone=public --add-port=80/tcp
firewall-cmd --reload

5. apache 설치가 정상적으로 되었는지 확인합니다.

 

웹브라우저에 http://IP주소/ 로 탐색하면 It works가 뜨면 정상적으로 설치가 된 것입니다.

 

 

반응형

댓글