나는 막혔다. 내 vHost 설정을 작동시키지 못하기 때문에 내 로컬 시스템을 개발 준비가되지 않습니다. 나는 브라우저로 내 문서 루트에 액세스 할 수 없다 (연결 실패, 서버에 연결할 수 있음).아파치 vHosts를 가진 국부적으로 기계에 VirtualDocumentRoot에 연결하십시오
세부 사항 :
OS: OSX 10.9.2
Apache/2.2.26
가상 호스트 설정은 다음과 같습니다 /path/to/vhosts/test/dev/htdocs
에서
<VirtualHost *:80>
ServerAdmin [email protected]
ServerName something.loc
ServerAlias *.someting.loc
UseCanonicalName Off
VirtualDocumentRoot /path/to/vhosts/%2/%1/htdocs
<IfModule dir_module>
DirectoryIndex index.php index.html
</IfModule>
<FilesMatch "\.js\.gzip$">
AddType "text/javascript" .js.gzip
</FilesMatch>
<FilesMatch "\.css\.gzip$">
AddType "text/css" .css.gzip
</FilesMatch>
AddEncoding x-gzip .gzip
<IfModule mod_deflate.c>
AddOutputFilterByType DEFLATE text/plain text/html
</IfModule>
</virtualHost>
내가 간단한 index.html
을 가지고, 그 안녕하세요 말한다!
127.0.0.1 dev.test.something.loc
mod_vhost_alias가 아파치 모듈 IST로드 :
LoadModule vhost_alias_module libexec/apache2/mod_vhost_alias.so
그래서 나는 액세스 기운이 폴더와 일치해야합니다 호스트는 내 /etc/hosts
에 포함 dev.test.something.loc입니다 index.html 브라우저를 통해,하지만 난 아파치 error.log에서 아무것도 얻지 못한다. wget으로 시도해보십시오.
$ wget dev.test.something.loc
--2014-04-05 10:12:40-- http://dev.test.something.loc/
Resolving dev.test.something.loc... 127.0.0.1
Connecting to dev.test.something.loc|127.0.0.1|:80... failed: Connection refused.
좋습니다. 작동하지 않습니다. 다음 접근 방식 :
wget --header="Host: dev.test.something.loc" -O - http://localhost
--2014-04-05 10:14:53-- http://localhost/
Resolving localhost... ::1, 127.0.0.1
Connecting to localhost|::1|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 67 [text/html]
Saving to: 'STDOUT'
0% [ ] 0 --.-K/s <html>
<head>
</head>
<body>
<h1>Hello World!</h1>
</body>
</html>
100%[============================>] 67 --.-K/s in 0s
2014-04-05 10:14:53 (5.32 MB/s) - written to stdout [67/67]
보세요, 내 index.html! localhost 대신 127.0.0.1을 사용해 보겠습니다.
wget --header="Host: dev.test.something.loc" -O - 127.0.0.1
--2014-04-05 10:17:24-- http://127.0.01/
Resolving 127.0.0.1... 127.0.0.1
Connecting to 127.0.0.1|127.0.0.1|:80... failed: Connection refused.
그게 제가 지금까지 얻은 전부입니다. 뭔가 잘못되었습니다. 하지만 나는 전체 apache 설정에 익숙하지 않은데, 내가 누락 된 부분을 스스로 해결할 수는 없다. 어쩌면 누군가가 도움이되는 제안을 할 수 있습니까?
미리 감사드립니다.