반응형
반응형
반응형

퍼온 글

 - http://dochi575.egloos.com/4867779



아파치 포트가 1024보다 크고, root 권한으로 실행하는데,
아래와 같은 오류가 발생하면서 아파치 서버가 실행되지 않는 경우가 있다.

service httpd start
Starting httpd: 
(13)Permission denied: make_sock: could not bind to address [::]:8000
(13)Permission denied: make_sock: could not bind to address 0.0.0.0:8000
no listening sockets available, shutting down
Unable to open logs
                                                           [FAILED]

이 경우 SELinux(Security-Enhanced Linux) 정책으로 인한 문제이므로, 아래와 같이 확인한다.

sestatus
SELinux status:                 enabled
SELinuxfs mount:                /selinux
Current mode:                   enforcing
Mode from config file:          enforcing
Policy version:                 24
Policy from config file:        targeted

setenforce 0

service httpd start
Starting httpd: 
                                                           [  OK  ]

setenforce 1

이 방식으로는 restart를 하게 되면 동일한 오류가 또 발생하기 때문에,
setenforce를 아예 꺼버리거나 아니면 semanage를 이용하여 SELinux 설정을 변경한다.

semanage가 없으면 설치한다.
$ sudo yum -y install policycoreutils-python

설치 완료되면, 
http 포트로 지정되어 있는 설정 정보를 확인한다.

semanage port -l | grep http
http_cache_port_t              tcp      3128, 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

사용하려는 포트가 지정된 포트인지 확인한다.
semanage port -m -t http_port_t -p tcp 8000
/usr/sbin/semanage: tcp/800에 대한 포트가 지정되지 않았습니다

포트가 지정되어 있지 않으면, 해당 포트를 추가한다.
semanage port -a -t http_port_t -p tcp 8000

정상적으로 등록되었는지 확인한다.
semanage port -l | grep http
http_cache_port_t              tcp      3128, 8080, 8118, 8123, 10001-10010
http_cache_port_t              udp      3130
http_port_t                    tcp      8000, 80, 81, 443, 488, 8008, 8009, 8443, 9000
pegasus_http_port_t            tcp      5988
pegasus_https_port_t           tcp      5989

아파치 restart를 다시 실행한다.
# service httpd restart
httpd 를 정지 중:                                          [  OK  ]
httpd (을)를 시작 중:                                      [  OK  ]



반응형

'Server > Apache' 카테고리의 다른 글

client denied by server configuration  (0) 2021.06.29
[설치] DocumentRoot .. does not exist  (0) 2015.09.23
ssl 설정.  (2) 2015.08.16
[설치] DocumentRoot must be a directory  (0) 2015.06.16
에러 : libexpat.so.0: 열기 실패  (0) 2014.03.24
반응형

초단위로 결과가 나옴.

ms 로 사용할때는 1000 을 곱해주면 됨.



mysql> select UNIX_TIMESTAMP('2015-09-21 15:50:00');

+---------------------------------------+

| UNIX_TIMESTAMP('2015-09-21 15:50:00') |

+---------------------------------------+

|                            1442818200 |

+---------------------------------------+

1 row in set (0.00 sec)




mysql> select from_unixtime(1442818200, '%Y-%m-%d %H:%i:%s') from dual;
+------------------------------------------------+
| from_unixtime(1442818200, '%Y-%m-%d %H:%i:%s') |
+------------------------------------------------+
| 2015-09-21 15:50:00                            |
+------------------------------------------------+
1 row in set (0.00 sec)



반응형

'Database > Mysql' 카테고리의 다른 글

index 생성 기준?  (0) 2021.09.24
[API] 앱 버전 체크 시 사용할 만한 쿼리  (1) 2017.10.11
mysql bin log 삭제.  (0) 2014.05.15
mysql dump  (0) 2014.03.24
[mysql] InnoDB  (1) 2014.03.24
반응형


<VirtualHost *:80>

    DocumentRoot /home/xxx

</VirtualHost>


위 처럼 설정하고 service httpd restart 했는데.. 다음과 같이 에러가 발생. 해당 디렉토리가 있음에도 불구하고..

Starting httpd: Warning: DocumentRoot [/home/xxx] does not exist



아파치 사용자에 대해서 해당 디렉토리 접근 허용해야 한다.

chcon -R -t httpd_user_content_t /home



반응형

+ Recent posts