티스토리 뷰

ubuntu 14.04 아파치웹서버 재기동 시 ServerName 관련 경고가 나올 때 조치 방법

참고: https://httpd.apache.org/docs/current/mod/core.html#servername

아파치를 재기동할 때나 /var/log/apache2/error.log에서 아래와 같은 경고문을 본다면

$ sudo service apache2 restart
AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1. Set the 'ServerName' directive globally to
suppress this message
$ 
$ find /var/log/apache2/ | xargs grep --color=auto -ni 2>/dev/null ServerName
...
AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1. Set the 'ServerName' directive globally to
suppress this message
....

ServerName 지시자가 정의되지 않아서 입니다.

<VirtualHost>섹션에 ServerName을 명시한 뒤 아파치를 재기동하거나

$ sudo vi /etc/apache2/sites-enabled/test.conf
.....
	DocumentRoot /var/www/html
        ServerName www.test.com
.....

conf-available디렉토리에 적당한 파일(servername.conf)하나 생성 후 거기에 ServerName을 명시한 뒤 a2enconf으로 생성 파일을 활성화 한 뒤

$ echo "ServerName localhost" | sudo tee /etc/apache2/conf-available/servername.conf
$ sudo a2enconf servername

아파치를 재기동하면..

$ sudo service apache2 reload
 * Reloading web server apache2                                                  
 *

아무런 경고 없이 실행됩니다..

'Web > apache' 카테고리의 다른 글

ubuntu 14.04 아파치웹서버 Listen포트 변경하기  (0) 2016.03.08
댓글
공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
«   2025/03   »
1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31
글 보관함