로컬** 웹사이트 테스트에 사용되는 Ubuntu 14.10 컴퓨터가 있는데 인터넷에 연결되지 않습니다. 이 컴퓨터에는 7개의 웹 사이트가 설정되어 있습니다. 그런데 7개 중 2개에 접속하면 내 색인 페이지가 아닌 '아파치2 우분투 기본 페이지'가 표시됩니다.
내가 알 수있는 한, 나는 똑같은 프로세스를 사용하여 7 개를 모두 설정 했으므로이 두 가지가 누락 된 것이 무엇인지 모르겠습니다. 또한 내 아파치 로그 디렉토리에는 두 개의 오작동 사이트 각각에 대해 error
및 access
라는 두 개의 로그 파일이 있지만 모두 비어 있습니다. 아파치2` 서비스를 다시 시작하면 오류가 없습니다. 여러 번 단계를 되짚어 보았지만 작동하는 사이트와 작동하지 않는 사이트 사이에 어떤 차이도 볼 수 없습니다.
이 문제를 진단하기 위해 어떤 옵션이 있나요? 어떻게 하면 더 자세한 오류 로그를 강제할 수 있나요? 참조할 수 있는 다른 로그가 어딘가에 있나요?
다음은 오작동하는 사이트 중 하나에 대한 .conf
파일의 예입니다:
<VirtualHost *:80>
ServerName www.local_example.com
ServerAlias local_example.com
ServerAdmin [email protected]
DocumentRoot /var/www/Websites/example.com
<Directory /var/www/Websites/example.com/>
Options Indexes FollowSymLinks MultiViews
# pcw AllowOverride None
AllowOverride All
Order allow,deny
allow from all
# This directive allows us to have apache2's default start page
# in /apache2-default/, but still have / go to the right place
# Commented out for Ubuntu
#RedirectMatch ^/$ /apache2-default/
</Directory>
ErrorLog /home/example/Apache_Logs/local_example.com_error.log
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn
CustomLog /home/example/Apache_Logs/local_example.com_access.log combined
ServerSignature On
</VirtualHost>
다음을 시도해 보세요.
상세 로그 사용하기
sudo nano /etc/apache2/apache2.conf
LogLevel 변수를 찾아 기본 경고에서 정보 또는 디버그로 업데이트합니다. 디버그가 가장 많은 양의 출력을 생성합니다.
# LogLevel: Control the number of messages logged to the error_log.
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
#
LogLevel debug
아파치를 재시작합니다.
sudo service apache2 restart
아파치에는 멋진 구문 검사 도구가 있다.
apache2ctl -t
가상호스트 정의 확인
apache2ctl -S