wordpressmu use subdomains

在subdomains地方卡住。
找了google 找了好久,沒看到什麼有營養的
回去看readme.txt,馬上就解了(這告訴我們一定要看README呀)
一般的安裝我就不講了
README.txt上寫到

Apache
======
Apache must be configured so that mod_rewrite works. Here are
instructions for Apache 2. Apache 1.3 is very similar.

1. Make sure a line like the following appears in your httpd.conf
LoadModule rewrite_module /usr/lib/apache2/modules/mod_rewrite.so

2. In the directive of your virtual host, look for this
line
“AllowOverride None”
and change it to
“AllowOverride FileInfo Options”

3. In the section of the config file for your host there
will be a line defining the hostname. You need to add the following
if you want virtual hosts to work properly:
“ServerAlias *.domain.tld”
Replace domain.tld with whatever your one is, and remove the quotes.

DNS
===
If you want to host blogs of the form http://blog.domain.tld/ where
domain.tld is the domain name of your machine then you must add a
wildcard record to your DNS records.
This usually means adding a “*” hostname record pointing at your
webserver in your DNS configuration tool.
Matt has a more detailed explanation:
http://photomatt.net/2003/10/10/wildcard-dns-and-sub-domains/

簡單來說就是
把你的apache 上的
virtualhost 的directory tag 上加這個
AllowOverride FileInfo Options

然後dns上設
@ IN A xxx.xxx.xxx.xxx
*.twbsd.net. IN A xxx.xxx.xxx.xxx
這樣基本上你的subdomains 就好了
============================example==================================
我的virtualhost設定如下
NameVirtualHost *:80


DocumentRoot /path/to/wordpressmu
ServerName yourdoamin.tld
ServerAlias *.yourdoamin.tld

AllowOverride FileInfo Options

PS:記得要用name-based 的virtual host 呀。

發佈留言

這個網站採用 Akismet 服務減少垃圾留言。進一步了解 Akismet 如何處理網站訪客的留言資料