url hello.apoio.co가 var / www / hello.apoio.co 폴더가 아닌 var / www / 폴더로 확인되는 이유를 알 수 없습니다.
간단한 것 같지만 보이지 않나요? 나는 편지에 대한 공식적인 지시를 따랐다. 어떤 도움이라도 대단히 감사하겠습니다.
다음은 가상 호스트 파일의 코드입니다.
DocumentRoot /var/www/hello.apoio.co/
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /var/www/hello.apoio.co/>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
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
가상 호스트 파일은 Apache2에서 액세스 할 수 있어야하는 일부 디렉토리의 경로를 보여줍니다.
http://hello.apoio.co
broswer 를 입력하여이 디렉토리에 액세스하고 싶다고 가정합니다. 이 경우 ServerName
가상 호스트 파일 내부의 지시문 이어야 합니다.
따라서 게시 한 파일은 다음과 같아야합니다.
<VirtualHost *:80>
ServerName hello.apoio.co
ServerAlias www.hello.apoio.co
DocumentRoot /var/www/hello.apoio.co/
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /var/www/hello.apoio.co/>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
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
</VirtualHost>
위의 가상 호스트 구성에서 ServerName 및 ServerAlias는 해당 URL과 해당 별칭을 설정하는 데 사용됩니다.
추가 정보 이름 기반 가상 호스트 사용
이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.
침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제
몇 마디 만하겠습니다