2012-03-05 2 views
3

WordPress 3.3.1 멀티 사이트 (하위 도메인)가 localhost에서 작동하려고합니다. 그러나, 내 워드 프레스 가상 호스트에 와일드 카드 하위 도메인을 구성해야합니다. 이 아이디어는 any_subdomain.my_wordpress.localmy_wordpress.local으로 이동하는 것입니다.Mac OS Lion - 와일드 카드 하위 도메인 가상 호스트

Mac OS 10.7.3에서 Apache 2.2.22를 사용하면 어떻게됩니까?

이 그 로컬 사이트 내 HTTP-vhosts.conf 파일에서 설정 한 가상 호스트입니다 :

<VirtualHost *:80> 
    DocumentRoot "/Users/some_user/Sites/wordpress_mu" 
    ServerName wordpress_mu 
    ServerAlias *.wordpress_mu 
    ServerAdmin [email protected] 

# Logging 
    ErrorLog "logs/wordpress_mu.error_log.log" 
    CustomLog "logs/wordpress_mu.access_log.log" combined 

<Directory "/Users/some_user/Sites/wordpress_mu"> 
    RewriteEngine On 

    # To allow permalink as specified by wordpress admin interface 
    RewriteBase/
    RewriteRule ^index\.php$ - [L] 
    RewriteCond %{REQUEST_FILENAME} !-f 
    RewriteCond %{REQUEST_FILENAME} !-d 
    RewriteRule . /index.php [L] 

      Options FollowSymLinks MultiViews Includes ExecCGI 
      AllowOverride All 
      Order allow,deny 
      Allow from all 
    </Directory> 

    # Set valid directory pages 
    DirectoryIndex index.html index.htm index.shtml index.php 

나는 또한/etc/hosts 파일에 wordpress_mu을 추가했습니다.

127.0.0.1 wordpress_mu 

감사합니다.

답변

5

/etc/hosts 와일드 카드를 지원하지 않으므로 각 하위 도메인을 /etc/hosts에 추가해야합니다. 그렇지 않으면 작동하지 않습니다.

또는 로컬 컴퓨터, 다른 상자 또는 라우터에 관계없이 로컬 네트워크의 어딘가에서 DNS 서버를 실행할 수 있습니다. dnsmasq은 설치가 매우 쉽습니다. ddwrt을 지원하는 무선 라우터를 사용하고 있다면 거기에서 실행할 수도 있습니다. 그렇게하면 와일드 카드 만 사용할 수 있습니다.

+1

감사합니다. 나는 dnsmasq를 시도 할 것이다. – bananaaus

+0

그것은 작동합니다! 고맙습니다. :) – bananaaus

관련 문제