2014年2月11日 星期二

[apache] 轉址

1. rewrite 要打開

2. vhost 加上下面程式,網址打 www.abc.idv.tw 網址會轉到 www.abc.com
<VirtualHost *:80>
    ServerAdmin wsxrtgvbuikm@hotmail.com
    DocumentRoot "/home/user/web"
    ServerName www.abc.idv.tw
    RewriteEngine on
    RewriteRule ^(.*) http://www.abc.com$1 [R=301,L]
</VirtualHost>

3. 在 httpd.cnf 或 .htaccess 加上
Redirect /yahoo  http://tw.yahoo.com  -> 打上 www.abc.idv.tw/yahoo 會轉到 tw.yahoo.com
Redirect /google  http://www.google.com

2014年2月7日 星期五

[apache] windows中優化apache

Windows 與 linux 的回收機制和進程管理不同

1. http-mpm.conf設置
修改 httpd.conf 將 #Indude conf/extra/httpd-mpm.conf 去掉#
開啟 extra/httpd-mpm.conf 裡面有很多設定,但只有下方的設定有效果


ThreadsPerChild
是Apache進程的子線程數,這個指令設置了每個子進程建立的線程數。子進程在啟動時建立這些線程後就不再建立新的線程了。
不能設定太大會當機

待續...

參考資料:
http://www.pigo.idv.tw/archives/1708
http://www.piaoyi.org/php/Windows-Apache-mpm_winnt_module.html