최근 Apache2 업데이트가 가상 호스트를 깨뜨렸고 다시 시작 또는 시작시 새로운 오류 발생 ServerAdmin webmaster@localhost

내가 우분투 12.04 상자에, 최근에 하나의 apache2 업데이 트를 설치 한 이후로 모든 가상 호스트가 올바른 디렉토리를 가리키고 있지 않아, 이제는 기본 로컬 호스트를 가리키고 있습니다. 또한 아파치 2를 다시 시작하면 오류가 발생합니다.

shafox@shafox:~$ sudo /etc/init.d/apache2 restart
* Restarting web server apache2 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 [ OK ].

servername이 localhost가 아니지만 오류 메시지 앞에 AH00558 스탬프가있는 이유는 무엇입니까?
내 사이트 – 내 시스템에서 사용할 수 있습니다.

/etc/apache2/sites-available$ ls
000-default.conf       default-ssl.conf  localbox-local
000-default.conf.dpkg-new  devbox-dev        sites-si

이전에는 다음과 같았습니다.

/etc/apache2/sites-available$ ls
000-default  default-ssl  localbox-local  devbox-dev   sites-si

예를 들어, 가상 호스트 파일 중 하나는 다음과 같습니다.

<VirtualHost *:80>
        ServerAdmin webmaster@localhost
        ServerName localbox.local
        DocumentRoot /home/shafox/Localbox
        <Directory />
                Options FollowSymLinks
                AllowOverride All
        </Directory>
        <Directory /home/shafox/Localbox/>
                Options Indexes FollowSymLinks MultiViews
                AllowOverride All
                Order allow,deny
                allow from all
        </Directory>

        ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
        <Directory "/usr/lib/cgi-bin">
                AllowOverride None
                Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
                Order allow,deny
                Allow from all
        </Directory>

        ErrorLog ${APACHE_LOG_DIR}/error.log

        # Possible values include: debug, info, notice, warn, error, crit,
        # alert, emerg.
        LogLevel warn

        CustomLog ${APACHE_LOG_DIR}/access.log combined

    Alias /doc/ "/usr/share/doc/"
    <Directory "/usr/share/doc/">
        Options Indexes MultiViews FollowSymLinks
        AllowOverride None
        Order deny,allow
        Deny from all
        Allow from 127.0.0.0/255.0.0.0 ::1/128
    </Directory>

</VirtualHost>

나는이 모든 가상 호스트를 다시 만들고 싶지 않습니다. 나는에서 쓰여진 단계를 따라 갔다. 이 튜토리얼 모든 가상 호스트를 생성합니다.

다음은 / etc / hosts 파일입니다.

127.0.0.1       localhost
127.0.1.1       shafox
127.0.1.1       devbox.dev
127.0.1.1       localbox.local
127.0.1.1       sites.si

# The following lines are desirable for IPv6 capable hosts
::1     ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters

apache2 error.log의 오류 로그 오류 로그 링크



답변

그것은 기술적으로 “오류”는 아니지만 … 경고입니다. 이전 init.d 스크립트는 단순히 경고를 로그에 기록하고 다시 시작할 때 아무것도보고하지 않습니다. 이 메시지는 Apache가 사용 가능한 정보를 기반으로 서버의 fqdn을 식별 할 수있는 방법이 없다는 점에서 정확합니다. 다음과 같이 호스트 파일의 루프백 인터페이스 항목에 간단하게 추가 할 수 있습니다.

127.0.1.1       servername server.fully.qualified.name.tld

또는 서버 이름 지시문은 apache.conf에 경고가 있음을 나타냅니다.

ServerName www.example.com

또한 우분투를 사용하기로 결정했다면, init.d 스크립트 대신 아파치와 같은 서비스를 제어하기 위해 upstart 명령을 사용해야합니다. 이렇게 :

sudo restart apache2

답변

Drupal multisite dev 시스템 용으로 Apache 2.4로 업그레이드 한 후에도 동일한 문제가있었습니다. mod_rewrite가 전혀 작동하지 않았습니다. 열쇠는 가상 호스트 파일의 지시어입니다 :

<Directory /whatever-path/>
  Options Indexes FollowSymLinks
  AllowOverride All
  Require all granted
</Directory>

참고 사항 AllowOverride 모두 모두 부여 필요 아파치 2.2와는 다르다.

희망이 도움이됩니다.


답변

또한이 문제가 있었지만 Diogenes와 같은 대답을 사용하여 해결했습니다. 구체적으로 바꾸려는 구문이 있습니다.

…에서 https://httpd.apache.org/docs/trunk/upgrading.html

이 예에서는 모든 요청이 거부됩니다.

2.2 구성 :
주문 거부, 허용
모두 거부

2.4 구성 :
모두 거부해야 함

이 예에서는 모든 요청이 허용됩니다.

2.2 구성 :
주문 허용, 거부
모두 허용

2.4 구성 :
모두 부여 필요

다음 예제에서는 example.org 도메인의 모든 호스트에 액세스가 허용됩니다. 다른 모든 호스트는 액세스가 거부됩니다.

2.2 구성 :
주문 거부, 허용
모두 거부
example.org 허용

2.4 구성 :
example.org 호스트 필요