Apache2 서버를 설정하려고합니다. 설치 및 구성이 잘 된 것 같았지만 사용자 지정 웹 URL로 이동하려고하면 "이 사이트에 연결할 수 없습니다."오류가 발생합니다. 이 답변을 통해 구성 파일 설정을 시도했습니다- 브라우저에서 Apache 2.4.7 웹 서버에 액세스하려고 할 때 403 오류 금지 .
내 호스트 파일은 다음과 같습니다.
127.0.0.1 localhost
127.0.0.1 justtestingthis
127.0.1.1 Hacker
# The following lines are desirable for IPv6 capable hosts
...
내 apache2/sites-available/http.justtestingthis.conf
파일은 다음과 같습니다.
<VirtualHost 127.0.0.1:80>
ServerAdmin [email protected]
ServerName justtestingthis.com
ServerAlias www.justtestingthis.com
DocumentRoot /home/donatas/Desktop/Projects/justtestingthis/dist/src
DirectoryIndex index.php
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
<Directory /home/donatas/Desktop/Projects/justtestingthis/dist/src>
# Allow .htaccess
AllowOverride All
Allow from All
</Directory>
</VirtualHost>
.NET을 apache2/sites-enabled
사용 하여이 파일의 링크도 만들었습니다 sudo a2ensite http.justtestingthis.conf
.
http : // localhost를 입력하여 웹 사이트에 액세스 할 때 내 웹 사이트가 성공적으로 검색되지만 justtestingthis.com 또는 www.justtestingthis.com을 통해 액세스하려고하면 "이 사이트 오류에 도달 할 수 없습니다. "...
내가 무엇을 잘못하고 있지?
브라우저에서 justtestingthis.com
페이지를 열 수없는 이유는 페이지가 이동해야하는 위치를 가리키는 별칭이 없기 때문입니다. 당신은 당신에있는 /etc/hosts
유일한 파일 127.0.0.1 justtestingthis
그건 그냥 이름입니다. 브라우저는 이름이 .com
지정되지 않았기 때문에 이름이 어디에 있는지 알지 못합니다.
이 문제를 해결하려면 라인을 다음 /etc/hosts
으로 변경하십시오 .
127.0.0.1 www.justtestingthis.com
이제이 별명해야 justtestingthis.com
받는 사람 localhost
또는 127.0.0.1
아파치 페이지 웹 브라우저를. justtestingthis.com
www 없이도 열립니다 .
도움이 되었기를 바랍니다!
이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.
침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제
몇 마디 만하겠습니다