본문으로 바로가기

[Linux] RHCSA SELinux http Listen 포트 추가

category Linux 2020. 12. 8. 17:59
728x90

1. 기존 http 포트 확인

[root@JeongYD01 ~]# semanage port -l | grep http
http_cache_port_t              tcp      8080, 8118, 8123, 10001-10010
http_cache_port_t              udp      3130
http_port_t                    tcp      80, 81, 443, 488, 8008, 8009, 8443, 9000
pegasus_http_port_t            tcp      5988
pegasus_https_port_t           tcp      5989

 

2. http 포트로 82포트 추가

[root@JeongYD01 ~]# semanage port -a -t http_port_t -p tcp 82
[root@JeongYD01 ~]# semanage port -l | grep http
http_cache_port_t              tcp      8080, 8118, 8123, 10001-10010
http_cache_port_t              udp      3130
http_port_t                    tcp      82, 80, 81, 443, 488, 8008, 8009, 8443, 9000
pegasus_http_port_t            tcp      5988
pegasus_https_port_t           tcp      5989

 

3. vi /etc/httpd/conf/httpd.conf 파일에 Listen 82 추가

# Listen: Allows you to bind Apache to specific IP addresses and/or
# ports, instead of the default. See also the <VirtualHost>
# directive.
#
# Change this to Listen on specific IP addresses as shown below to
# prevent Apache from glomming onto all bound IP addresses.
#
#Listen 12.34.56.78:80
Listen 80
Listen 82

 

4. http데몬 재기동 및 Listen port 상태 확인

[root@JeongYD01 conf]# systemctl restart httpd
[root@JeongYD01 conf]# systemctl status httpd

5. 80, 82 포트 정상 동작 확인

[root@JeongYD01 conf]# wget localhost:82/index.html

 

'Linux' 카테고리의 다른 글

[Linux] RHCSA chrony 설정(ntp)  (0) 2020.12.10
[Linux] RHCSA find 활용  (0) 2020.12.09
[Linux] RHCSA Virtual Data Optimizer (VDO) volume 만들기  (1) 2020.12.07
[Linux] RHCSA ssh-keygen  (0) 2020.11.25
[Linux] RHCSA swap 늘리기  (0) 2020.11.24