Apache 使用 mod_php 讓 VH 有獨立的 php.ini 檔
作者:cross 日期:2009-02-06 10:34
另一種玩法,使每個 php.ini 不一樣,
預設在 phpinfo 裡會看到 Configuration File (php.ini) Path 是在 /etc/php.ini
使用 mod_php 這個模組,就可以讓每一個 Virtual Host 有自已的 php.ini 設定檔
只要這樣
<VirtualHost 1.2.3.4:80>
PHPINIDir /放置路徑/
</VirtualHost>
接著在 /放置路徑/ 裡產生一個 php.ini 就可以了
Apache + 可以限制 .htaccess 只能使用某些參數嗎
作者:cross 日期:2009-02-02 18:52
Quote: http://phorum.study-area.org/index.php/topic,55321.0.html
sycross:
比方說 register_globals 預設是 Off,是可以用 .htaccess 設定
php_flag register_globals On
.htaccess 是可以允許使用來修改參數,但如何才可以達到某些參數不被 .htaccess 允許設定,
比方說我要限制 upload_max_filesize 永遠只能夠 2MB,就算 .htaccess 設定了也沒有效,是可以在 httpd.conf 就設定使用 php_admin_value,因為 php_admin_value 權力比 php_value 大,
但這樣子就比較麻煩了,對多個 virtual host不就要一個一個設定,有其它簡單的方式嗎?
fillano:
偷吃步的方法:在 httpd.conf 裡面加上
對 Apache 連線數多個概念
作者:cross 日期:2008-10-29 11:50
日期:2008-07-17 作者:喜騰小二 來源:PHPChina
版權宣告:可以任意轉載,但轉載時必須標明原作者charlee、原始連結http://tech.idv2.com/2007/08/09/about-apache-perf-tuning/以及本宣告。
今天說說Apache的最佳化。為什麼要最佳化?因為伺服器資源不夠用。資源有很多方麵,但根據木桶理論,只要有一種資源不夠用,整個伺服器的效能就會受到影響(所謂瓶頸)。
伺服器資源
那麼伺服器的資源包括哪些?對於網站來說主要是CPU、TCP連線數這兩者。 CPU表現在工作數上,在Linux下使用平均負載(loadavg)來衡量。可透過以下指令來檢視(參考這篇文章):
cat /proc/loadavg對於單CPU的伺服器,loadavg高於1,表明工作隊列出現了等待,CPU忙不過來了。超過2以上就會明顯感到效能降低了。
TCP連線數可透過以下指令檢視:
netstat -ant | grep :80 | wc -l如果要即時監控伺服器資源,可參考OpenNMS項目。
注1:記憶體不算,低廉的價格使得網站伺服器很少有因為記憶體不夠而down掉的。
注2:CPU%是瞬時的CPU使用率,通常無法反映出整體負載。Apache配置指令
apache + mod_gnutls 達到單一IP多個domain使用SSL服務
作者:cross 日期:2008-09-17 19:26
Apache 無法在單一IP建置SSL給多個 Virtual Host (name-based)使用,也就是說 SSL 服務只能在 ip-based 底下使用,
Apache 官網 http://httpd.apache.org/docs/2.0/ssl/ssl_faq.html#vhosts 說明了一切
http://help.directadmin.com/item.php?id=89Why can't I use SSL with name-based/non-IP-based virtual hosts?
The reason is very technical, and a somewhat "chicken and egg" problem. The SSL protocol layer stays below the HTTP protocol layer and encapsulates HTTP. When an SSL connection (HTTPS) is established Apache/mod_ssl has to negotiate the SSL protocol parameters with the client. For this, mod_ssl has to consult the configuration of the virtual server (for instance it has to look for the cipher suite, the server certificate, etc.). But in order to go to the correct virtual server Apache has to know the Host HTTP header field. To do this, the HTTP request header has to be read. This cannot be done before the SSL handshake is finished, but the information is needed in order to complete the SSL handshake phase. Bingo!
http://httpd.apache.org/docs/2.0/ssl/ssl_faq.htmlWhy do I need an owned IP for my own SSL certificate? Last Modified: Oct 26, 2005, 3:20 pm
The reason you must have your own IP address when you want to use your own SSL certificate (when you don't want the server wide shared certificate) is because of the way SSL and apache (httpd) works.
For name based webhosting (when many domains are on one IP) the web browser will pass the name of the domain being requested inside the httpd headers along with the request. This way, apache knows which domain you are trying to access even though there are many domains on that one IP address.
When you do the same thing through an SSL connection, the connection has to be made *before* the request can be sent. In this connection, the certificate is passed. The only information that apache knows before the request is made is which IP the connection is being made to. It has to be able to know which certificate to send before the request is made, thus you can't use mutiple certificates on the same IP (if you do, apache will use the first certificate listed which DA will always set to the server shared certificate for shared IPs).
If you want to use your own certificate, it must be the first certificate listed. This wouldn't work for a shared IP, because there would multiple domain wanting this status, and the first certificate would the one shown. For this resaon the shared certificate is always used on a shared IP. For your certificate, DA will aknowledge the IP as being 'owned' and will remove the server shared certificate as the first cert to be loaded, thus your certificate will be loaded instead.
Apache httpd.conf 中的 prefork 及 worker
作者:cross 日期:2008-08-22 16:43
Apache 模組: 頻寬限制 mod_bw
作者:cross 日期:2008-06-15 00:36
Apache error_log 出現了 child pid 22545 exit signal Segmentation fault (11)
作者:cross 日期:2008-06-03 17:44




