Re: [users@httpd] How to enable deflate content-encoding with Apache2 mod_deflate?

2012-04-10 Thread howard chen
Hi, On Mon, Apr 9, 2012 at 7:01 PM, Eric Covener wrote: > mod_deflate only does one kind of encoding, but I couldn't tell you if > it's actually more gzip then deflate or vice versa wrt 2616. > I am already using AddOutputFilterByType DEFLATE text/html text/plain text/xml So I suppose it is

[users@httpd] How to enable deflate content-encoding with Apache2 mod_deflate?

2012-04-08 Thread howard chen
No matter how I test using different value of Accept-Encoding, it always returned as gzip. curl -I -H 'Accept-Encoding: gzip' http://www.example.com Content-Encoding: gzip curl -I -H 'Accept-Encoding: deflate' http://www.example.com Content-Encoding: gzip Seems the documentation is confusing

Re: [us...@httpd] mod_ssl newbie question

2010-03-17 Thread howard chen
Thanks. On Wed, Mar 17, 2010 at 11:13 PM, Mark Watts wrote: > If you are hosting the same site on two machines, and load-balancing > between the two, then yes; assuming your Certificate is licensed for two > machines, you can use the same Key/Certificate pair on both machines. > > You would *not

Re: [us...@httpd] mod_ssl newbie question

2010-03-17 Thread howard chen
Hi, On Wed, Mar 17, 2010 at 10:41 PM, Philip Wigg wrote: > You would have generated a public key and a private key initially > (they're a pair) because your public key is needed to generate your > CSR (Certificate Signing Request). > Thanks for your link. So it seems that now I missed the priva

[us...@httpd] mod_ssl newbie question

2010-03-17 Thread howard chen
I have a .crt file and it is issued by a CA. By looking at the .crt file, the Private Key is not included in the .crt file. My question: How can I generate the Private Key so I can use the directive SSLCertificateKeyFile? reference: http://httpd.apache.org/docs/2.0/mod/mod_ssl.html#sslcertifica

[us...@httpd] application/x-javascript vs application/javascript

2009-10-07 Thread howard chen
Hello, Why in some Apache httpd, JavaScript is sent by Content Type = application/x-javascript, but some httpd is application/javascript? Both are 2.2. Thanks. - The official User-To-User support forum of the Apache HTTP Serve

Re: [us...@httpd] Reset the REQUEST_URI variable with mod_rewrite

2009-09-22 Thread howard chen
Hello, > RewriteRule ^/test.php  /test2.php [R=301,L] > > use this in ur redirection , it will redirect as you expected. > In fact, I can do it using the P flag (proxy). But just to know if anything smater... - The official Us

[us...@httpd] Reset the REQUEST_URI variable with mod_rewrite

2009-09-22 Thread howard chen
Hello, Consider rewrite rule as: RewriteRule ^/test.php /test2.php [PT,L] So when I access it via http://www.example.com/test.php I want the field REQUEST_URI shown as test2.php, is it possible? THanks. - The official Us

[us...@httpd] mod_rewrite question

2009-07-16 Thread howard chen
A simple rewrite rule: RewriteRule ^/(.*) /index.php?q=test1 [QSA] RewriteRule ^/test2 /index.php?q=test2 [QSA,L] The above rules rewrite everything to "q=test1", even I enter the URL = http://www.example.com/test2 How to do the following... => Rewrite all url, except /test2, with the que

Re: [us...@httpd] DocumentRoot Directive

2009-07-14 Thread howard chen
Hello, On Wed, Jul 15, 2009 at 1:20 AM, J. Greenlees wrote: > > Yup, the server puts the trailing slash on the url when it responds to > the browser request. > If you put the trailing slash on the document root, then the server > REQUIRES it. > this makes http://example.com fail to resolve, the ty

[us...@httpd] DocumentRoot Directive

2009-07-14 Thread howard chen
In the document: http://httpd.apache.org/docs/2.0/mod/core.html#documentroot It said >> The DocumentRoot should be specified without a trailing slash. However, even I end with a trailing slash, it is ok. Any other impact? (as the document only told you not to, without reason) Thanks.

[us...@httpd] Virtualhost config file precedence

2009-07-13 Thread howard chen
I am using Ubuntu 9.04, using the build in vhost management scripts such as a2ensite/a2dissite. I am also using namebased virtualhost. (NameVirtualHost *:80), which I have serveral vhost scripts under /etc/apache2/sites-available, in the format such as... DocumentRoot ... ServerName www.example

[us...@httpd] How to trace/debug httpd?

2009-06-13 Thread howard chen
Hello, Is it possible to trace/debug how httpd is handling a request? e.g. which module is handling stuff and how much time they are spending on. Thanks. - The official User-To-User support forum of the Apache HTTP Server Proj

Re: [us...@httpd] What module/config trigger Vary: Host?

2009-04-29 Thread howard chen
Hi, On Wed, Apr 29, 2009 at 2:55 PM, André Warnier wrote: > howard chen wrote: >> negotiation   <=== Tested, no. So quite confusing... - The official User-To-User support forum of the Apache HTTP Server Proje

[us...@httpd] What module/config trigger Vary: Host?

2009-04-28 Thread howard chen
I am using apache2.2 on ubuntu 8.10, even I have disabled mod_deflate, my apache is keep sending out Vary: Host. Any other module or config will lead to this? I have the following modules enabled: alias auth_basic authn_file authz_default authz_groupfile authz_host authz_user autoindex cgi dir en

[us...@httpd] IE failed to cache images on subdomain if Vary header is sent

2009-04-19 Thread howard chen
Hello, Since I am using mod_deflate to compress resources (js, html) But it also give me Vary: Host for images resources, this is okay. But I found that now if the images is served from subdomain, it will not be cached by IE7 (by looking at the Temporary Internet Files folder) Now I have no met

Re: [us...@httpd] chunked encoding & mod_deflate

2009-04-17 Thread howard chen
Hey On Fri, Apr 17, 2009 at 4:34 PM, Nick Kew wrote: > That probably means mod_deflate reduced the response sufficiently > to buffer all of it and set a Content-Length header.  Chunked encoding > is only useful where there's no Content-Length set. > Becuase I have exactly the "same php program

[us...@httpd] chunked encoding & mod_deflate

2009-04-16 Thread howard chen
Hello, Just want to ask if possible to set mod_deflate + chunked encoding together, similar to yahoo.com, e.g. Transfer-Encoding=chunked Content-Encoding=gzip Currently I found if I set mod_deflate to process my php program, then it will skip Transfer-Encoding=chunked Any idea? Thanks.

Re: [us...@httpd] Chunked encoding like Yahoo!

2009-03-07 Thread howard chen
Hi On Sat, Mar 7, 2009 at 8:19 PM, Eric Covener wrote: > On Sat, Mar 7, 2009 at 4:28 AM, howard chen wrote: > There's only an advantage when you don't know the length ahead of > time, or your processing it in such a way that the length will change. >  When it's

[us...@httpd] Chunked encoding like Yahoo!

2009-03-07 Thread howard chen
Hello, When viewing Yahoo! main page, it is encoded as "compressed/chunked", I know how to use mod_gzip to enable to compression, but how to use "chunked encoding"? (In fact, what is the advangage?) Thanks. - The official User-T

[us...@httpd] Benchmark Apache using old access log

2009-03-03 Thread howard chen
I know how to use ab to benchmark a particular url, but I think it would be more useful to use my previous access log to generate the load, so I can test the performance in a more scientific way...so are there any tools recommended? Thanks.

[us...@httpd] What expire value I should set?

2009-02-26 Thread howard chen
Hello, Consider currently I am using mod_expire to set a HTML file to 15 minutes expire. The file change quite frequently, sometime maybe changed within 15 minutes so I want my user to see the change as soon as possible... sometimes the file does not change even for 10 days! So what expire value

Re: [us...@httpd] Threaded MPM + mod_php/mod_python/mod_perl/mod_ruby.. thread safe?

2009-02-12 Thread howard chen
On Thu, Feb 12, 2009 at 12:34 AM, Eric Covener wrote: > Bizarre conclusion. Other interpreters are likely more > thread-aware/thread-exploitative when not embedded in Apache, so > they'd be less likely to casually link with non-threadsafe libraries. > Why? Since if mod_php has thread safety pro

[us...@httpd] Threaded MPM + mod_php/mod_python/mod_perl/mod_ruby.. thread safe?

2009-02-11 Thread howard chen
Hello, According to PHP install guide, it said... http://hk.php.net/manual/en/faq.installation.php#faq.installation.apache2 PHP is glue. It is the glue used to build cool web applications by sticking dozens of 3rd-party libraries together and making it all appear as one

[us...@httpd] httpd is opening a private directory

2009-02-08 Thread howard chen
Hello, I have a quite busy web server, so I use lsof to trace what files/directory are actually using: /usr/sbin/lsof and I found SO MANY... httpd 1745 web cwd DIR8,6 4096 8427988 /var/my_web_site/private httpd 1747 web cwd DIR

[us...@httpd] Why fastcgi is not popular in Apache?

2009-01-17 Thread howard chen
Hello, Just wonder why not many people using fastcgi in Apache, rather, people tends to use mod_php, mod_perl, mod_python etc. Seems fastcgi is more popular in Lighttpd, are there technical reason behind? Thanks. - The official

[us...@httpd] Precompression using mod_deflate

2009-01-15 Thread howard chen
Hello, If I remember correctly, back to the old day when I use Apache 1.3x, is it possible with mod_gzip, why this function is dropped in 2.x mod_deflate? http://httpd.apache.org/docs/2.2/mod/mod_deflate.html Don't you guy think compressing a static CSS or JS on-the-fly is wasteful? Any idea?

Unknown shutdown of Apache process

2008-12-17 Thread howard chen
Hello, My apache server will almost shutdown once every day, at an unexpected time, for unknown reason. So, I have setup a cron job to check in every minute, if process done away, then restart the apache. Howevery, this does not solve my problem. I have look into the access and error log, still c

Re: [EMAIL PROTECTED] mod_rewrite, mod_proxy, order of execution?

2008-10-15 Thread howard chen
Thanks. On Wed, Oct 15, 2008 at 7:19 PM, Eric Covener <[EMAIL PROTECTED]> wrote: > Only where they overlap and it's before 2.2, because it's undefined as > to which will run first. > > In 1.3 you might be able to control it by AddModule ordering, but in > 2.0 it may differ from system to system an

Re: [EMAIL PROTECTED] mod_rewrite, mod_proxy, order of execution?

2008-10-15 Thread howard chen
Hello, On Wed, Oct 15, 2008 at 6:49 PM, Eric Covener <[EMAIL PROTECTED]> wrote: > On Wed, Oct 15, 2008 at 4:47 AM, howard chen <[EMAIL PROTECTED]> wrote: >> >> Seems that Rewrite is done after the proxy? How to control the order then? > > in 2.2, rewrite will

[EMAIL PROTECTED] mod_rewrite, mod_proxy, order of execution?

2008-10-15 Thread howard chen
Hello , I have the following config in httpd.conf: my site is http://www.example.com (port 80) == RewriteEngine On RewriteRule ^/$/cgi-bin/index.cgi ProxyPass /cgi-bin/ http://www.example.com:9000/cgi-bin/ ProxyPassReverse /cgi-bin/ http://www.example.c

Re: [EMAIL PROTECTED] Force IE to cache

2008-10-02 Thread howard chen
Hello, Thanks for you valuable comments... On Fri, Oct 3, 2008 at 4:24 AM, André Warnier <[EMAIL PROTECTED]> wrote: > I have not verified, but maybe you are interpreting the rules of caching > a bit more extensively than what the HTTP RFCs really say. > It may be that, by using your various HTTP

[EMAIL PROTECTED] Force IE to cache

2008-10-02 Thread howard chen
Hello, In the httpd.conf, I have already set all the images files to expire +10 years from now, using mod_expire. Example response: = Status=OK - 200 Date=Thu, 02 Oct 2008 16:23:15 GMT Server=Apache Last-Modified=Thu, 27 Mar 2008 08:02:14 GMT Accept-Ranges=bytes Content-Length=3945 Ca

[EMAIL PROTECTED] Rewrite rule - Check by file exist...

2008-10-01 Thread howard chen
Hello, Is it possible to do the following, just using sort of rewrite rules in httpd.conf, E.g.http://www.example.com/foo ALGO: If a file foo.html exist rewrite to target.html Else 404 not found The foo is just a dynamic variables... Thanks.

Re: [EMAIL PROTECTED] Disable keepalive at runtime

2008-09-25 Thread howard chen
Hi On Thu, Sep 25, 2008 at 11:03 PM, Eric Covener <[EMAIL PROTECTED]> wrote: > no-keepalive is the environment variable you want to set > > http://httpd.apache.org/docs/2.2/env.html#special Great Thanks. - The official User-To-

[EMAIL PROTECTED] Disable keepalive at runtime

2008-09-24 Thread howard chen
Currently I have an runtime environment variable to tell if a client want keepalive or not, specified by their cookie value, e.g. RewriteCond %{HTTP_COOKIE} ^.*NO_KEEPALIVE=TRUE.*$ RewriteRule ^.*$ - [E=NO_KEEPALIVE:1] Is it possible, based on the environment variable to runtime disable the HTT

[EMAIL PROTECTED] How memory are actually used?

2008-09-17 Thread howard chen
Hello, I am running Apache HTTPD 1.3.37 with mod_php, when using the top command, I see: PID USER PR NI VIRT RES SHR S %CPU %MEMTIME+ COMMAND 12584 web 15 0 142m 12m 9176 S8 0.3 2:07.01 httpd 12586 web 15 0 142m 12m 9168 S8 0.3 2:08.85 httpd 12589

Re: [EMAIL PROTECTED] Difference in mod_perl & mod_php

2008-06-03 Thread howard chen
On Wed, Jun 4, 2008 at 1:16 AM, Joshua Slive <[EMAIL PROTECTED]> wrote: > On Tue, Jun 3, 2008 at 1:09 PM, howard chen <[EMAIL PROTECTED]> wrote: > > Yes, if by "embedded" you mean "running in the same process/thread > space with direct access to the apache AP

Re: [EMAIL PROTECTED] Difference in mod_perl & mod_php

2008-06-03 Thread howard chen
It is probably true that mod_perl exposes > more of the API than any other similar module. > > Joshua. > Yes, this is the point which I don't understand. Since Perl is embedded into Apache, so is mod_php mean php interpreter also embedded into Apache into the apache? Howard --

Re: [EMAIL PROTECTED] Difference in mod_perl & mod_php

2008-06-03 Thread howard chen
On Wed, Jun 4, 2008 at 12:24 AM, Matus UHLAR - fantomas <[EMAIL PROTECTED]> wrote: > > - mod_php interprets PHP files and sends them to client > > > If you want apache to parse perl scripts in the same way as mod_php does > with php scripts, you need to install an apache module that will do that. >

Re: [EMAIL PROTECTED] Apache Log File 2GB

2008-06-03 Thread howard chen
On Tue, Jun 3, 2008 at 11:28 PM, Stusynski, Dan <[EMAIL PROTECTED]> wrote: > To rotate the logs you can use Apaches piped rotatelogs: > > http://httpd.apache.org/docs/2.2/programs/rotatelogs.html > > Put something like the following in your httpd.conf (or whereever your > logging is define), 'Cust

[EMAIL PROTECTED] Difference in mod_perl & mod_php

2008-06-03 Thread howard chen
I mean the theory behind. People saying that mod_perl is closer to the Apache core, as it can be used to write Apache module, but in fact, what are their difference in term of processing model? Howard - The official User-To-User

[EMAIL PROTECTED] X_FORWARDED_FOR, squid and apache IP cheating

2008-05-23 Thread howard chen
Hi, This is my current setup in using squid3 as reverse proxy in front of apache: browser (e.g. 202.182.201.3) <> squid3 stable6 <> apache 1.3.37 (PHP) My PHP will get the user IP by HTTP_X_FORWARDED_FOR pass by squid. Now the problem is: 1. if user send a request already contains head

Re: [EMAIL PROTECTED] Apache dynamic page caching?

2008-04-16 Thread howard chen
Hi all, On Wed, Apr 16, 2008 at 9:21 PM, Narendra Verma <[EMAIL PROTECTED]> wrote: > Hi Howard, > 1. Be sure to load following module > > LoadModule headers_module modules/mod_headers.so > > 2. Add following Header directive at the last of httpd.conf file. > > Header add Cache-Control ma

Re: [EMAIL PROTECTED] Apache dynamic page caching?

2008-04-16 Thread howard chen
Hi, On Wed, Apr 16, 2008 at 3:53 PM, Nick Kew <[EMAIL PROTECTED]> wrote: > > mod_cache. > > The problem with mod_cache is when user update a page, how do I tell the cache should be removed from mod_cache? Currently I stored the cache in local file system and it can be easily unlink() to force

[EMAIL PROTECTED] Apache dynamic page caching?

2008-04-15 Thread howard chen
Hi, Are there any existing method for Apache which can do the followings? E.g. When a user first go to a page, www.example.com/article.php?id=123, my PHP problem will generated a static copy of HTML under a temp folder (e.g. /tmp/article/md5(123).html), so following requests to the page will not

Re: [EMAIL PROTECTED] Server Side Include (SSI) is slower than PHP ?

2008-02-19 Thread howard chen
On Feb 18, 2008 11:22 PM, howard chen <[EMAIL PROTECTED]> wrote: > > On Mon, Feb 18, 2008 at 10:47 PM, Nick Kew <[EMAIL PROTECTED]> wrote: > > On Mon, 18 Feb 2008 15:49:09 +0800 > > > > "howard chen"

Re: [EMAIL PROTECTED] Server Side Include (SSI) is slower than PHP ?

2008-02-18 Thread howard chen
On Mon, Feb 18, 2008 at 10:47 PM, Nick Kew <[EMAIL PROTECTED]> wrote: > On Mon, 18 Feb 2008 15:49:09 +0800 > > "howard chen" <[EMAIL PROTECTED]> wrote: > > > > SSI > > === > > > > > > > > > > > > &g

Re: [EMAIL PROTECTED] Server Side Include (SSI) is slower than PHP ?

2008-02-18 Thread howard chen
On Mon, Feb 18, 2008 at 9:03 PM, Vincent Bray <[EMAIL PROTECTED]> wrote: > On 18/02/2008, howard chen <[EMAIL PROTECTED]> wrote: > > I am running Apache/2.2.6 on Windows XP, testing on a very simple > > include testes, e.g. > > > > SSI > > ===

[EMAIL PROTECTED] Server Side Include (SSI) is slower than PHP ?

2008-02-17 Thread howard chen
Hello, I am running Apache/2.2.6 on Windows XP, testing on a very simple include testes, e.g. SSI === PHP === I was surprised that PHP is faster, i.e. ab -n 2000 -c 10 http://localhost/benchmark.php => 99 reqs/sec ab -n 2000 -c 10 http://localhost/benchmark.shtml => 61 reqs/sec m