Re: [users@httpd] How to prevent mod_proxy from rewriting redirects into absolute URLs?

2013-01-19 Thread Yang Zhang
For posterity, Igor's solution is what worked for me - thanks!

Specifically:

  proxy_redirect http://host.com:88/ http://host.com/;

On Sun, Nov 18, 2012 at 9:21 PM, Igor Cicimov icici...@gmail.com wrote:



 On Mon, Nov 19, 2012 at 12:56 PM, Yang Zhang yanghates...@gmail.com wrote:

 (The app server is this:
 http://gitit.net/README#proxying-to-httpmysite.comwiki)

 On Sun, Nov 18, 2012 at 5:55 PM, Yang Zhang yanghates...@gmail.com
 wrote:
  This is not an option because the point of my using the proxy in this
  case is that I need to rewrite the URLs and content (with
  mod_proxy_html). The app server hosts at / and I need to translate it
  to a subdirectory /sub.
 
  On Sun, Nov 18, 2012 at 5:53 PM, Igor Cicimov icici...@gmail.com
  wrote:
 
 
 
  On Mon, Nov 19, 2012 at 12:38 PM, Yang Zhang yanghates...@gmail.com
  wrote:
 
  On Sun, Nov 18, 2012 at 3:21 PM, Igor Cicimov icici...@gmail.com
  wrote:
  
   On Mon, Nov 19, 2012 at 9:48 AM, Yang Zhang yanghates...@gmail.com
   wrote:
  
   I have: nginx (port 80) reverse-proxying to apache2 (port 88)
   reverse-proxying to a web app (port 5001).
  
   However, when the web app responds with a redirect like `Location:
   /foo`, apache2 rewrites this into `Location:
   http://host.com:88/sub/foo`,
  
  
   Yes that's what reverse proxy is all about, it rewrites the Location
   header
   using ProxyPassReverseso it doesn't get bypassed in case of backend
   server
   redirection.
 
  nginx doesn't do the same rewrite from host.com:88 to host.com - I'd
  also be fine with a solution where nginx does this rewrite as well.
 
  
   even though port 88 is publicly
   inaccessible. I'd like it to just redirect to the relative URL
   `Location: /sub/foo`.
  
  
   So use a redirect then. Looks like reverse proxy is not applicable
   for
   your
   user case.
 
  What specifically do you mean when you suggest to use a redirect?
  Are you suggesting redirecting host.com:88 to host.com?  That's not
  possible because port 88 is not (and should not be) publicly
  reachable.
 
 
  I meant redirecting  /notes/ to the backend using [P] flag if you like
  instead of proxying it.
 
 
  
  
  
   Any ideas?
  
   My apache config (using mod_proxy_http, mod_proxy_html,
   mod_substitute):
  
 Location /notes/
   Allow from all
   ProxyPass http://127.0.0.1:5001/
   SetOutputFilter  proxy-html
   ProxyPassReverse /
   ProxyHTMLURLMap  /   /notes/
   RequestHeader unset Accept-Encoding
   AddOutputFilterByType SUBSTITUTE application/atom+xml
   Substitute s|127.0.0.1:5001|host.com/notes|
 /Location
  
   Thanks.
  
  
   -
   To unsubscribe, e-mail: users-unsubscr...@httpd.apache.org
   For additional commands, e-mail: users-h...@httpd.apache.org
  
  
 
 
 
  --
  Yang Zhang
  http://yz.mit.edu/
 
  -
  To unsubscribe, e-mail: users-unsubscr...@httpd.apache.org
  For additional commands, e-mail: users-h...@httpd.apache.org
 
 
 
 
 
  --
  Yang Zhang
  http://yz.mit.edu/



 --
 Yang Zhang
 http://yz.mit.edu/

 -
 To unsubscribe, e-mail: users-unsubscr...@httpd.apache.org
 For additional commands, e-mail: users-h...@httpd.apache.org


 Can't you solve this in nginx? Rewrite the Location header set by apache
 using proxy_redirect?




--
Yang Zhang
http://yz.mit.edu/

-
To unsubscribe, e-mail: users-unsubscr...@httpd.apache.org
For additional commands, e-mail: users-h...@httpd.apache.org



[users@httpd] How to prevent mod_proxy from rewriting redirects into absolute URLs?

2012-11-18 Thread Yang Zhang
I have: nginx (port 80) reverse-proxying to apache2 (port 88)
reverse-proxying to a web app (port 5001).

However, when the web app responds with a redirect like `Location:
/foo`, apache2 rewrites this into `Location:
http://host.com:88/sub/foo`, even though port 88 is publicly
inaccessible. I'd like it to just redirect to the relative URL
`Location: /sub/foo`.

Any ideas?

My apache config (using mod_proxy_http, mod_proxy_html, mod_substitute):

  Location /notes/
Allow from all
ProxyPass http://127.0.0.1:5001/
SetOutputFilter  proxy-html
ProxyPassReverse /
ProxyHTMLURLMap  /   /notes/
RequestHeader unset Accept-Encoding
AddOutputFilterByType SUBSTITUTE application/atom+xml
Substitute s|127.0.0.1:5001|host.com/notes|
  /Location

Thanks.

-
To unsubscribe, e-mail: users-unsubscr...@httpd.apache.org
For additional commands, e-mail: users-h...@httpd.apache.org



Re: [users@httpd] How to prevent mod_proxy from rewriting redirects into absolute URLs?

2012-11-18 Thread Yang Zhang
On Sun, Nov 18, 2012 at 4:03 PM, Nick Kew n...@webthing.com wrote:
 On Sun, 18 Nov 2012 14:48:35 -0800
 Yang Zhang yanghates...@gmail.com wrote:

 I have: nginx (port 80) reverse-proxying to apache2 (port 88)
 reverse-proxying to a web app (port 5001).

 However, when the web app responds with a redirect like `Location:
 /foo`,

 That is not valid HTTP.  A Location header must be an absolute URI.

OK, in that case I'd like `Location: http://host.com/sub/foo` and not
`http://host.com:88/sub/foo`.


  apache2 rewrites this into `Location:
 http://host.com:88/sub/foo`, even though port 88 is publicly
 inaccessible.

 So where does :88 come from?  Looks like a misconfiguration
 somewhere outside the section you quoted.

Well, I know from inspecting the wire traffic that this is coming from
apache's response to nginx (since, again, apache listens on 88).

The top of the config is what specifies this:

VirtualHost *:88



 --
 Nick Kew

 -
 To unsubscribe, e-mail: users-unsubscr...@httpd.apache.org
 For additional commands, e-mail: users-h...@httpd.apache.org




--
Yang Zhang
http://yz.mit.edu/

-
To unsubscribe, e-mail: users-unsubscr...@httpd.apache.org
For additional commands, e-mail: users-h...@httpd.apache.org



Re: [users@httpd] How to prevent mod_proxy from rewriting redirects into absolute URLs?

2012-11-18 Thread Yang Zhang
On Sun, Nov 18, 2012 at 3:21 PM, Igor Cicimov icici...@gmail.com wrote:

 On Mon, Nov 19, 2012 at 9:48 AM, Yang Zhang yanghates...@gmail.com wrote:

 I have: nginx (port 80) reverse-proxying to apache2 (port 88)
 reverse-proxying to a web app (port 5001).

 However, when the web app responds with a redirect like `Location:
 /foo`, apache2 rewrites this into `Location:
 http://host.com:88/sub/foo`,


 Yes that's what reverse proxy is all about, it rewrites the Location header
 using ProxyPassReverseso it doesn't get bypassed in case of backend server
 redirection.

nginx doesn't do the same rewrite from host.com:88 to host.com - I'd
also be fine with a solution where nginx does this rewrite as well.


 even though port 88 is publicly
 inaccessible. I'd like it to just redirect to the relative URL
 `Location: /sub/foo`.


 So use a redirect then. Looks like reverse proxy is not applicable for your
 user case.

What specifically do you mean when you suggest to use a redirect?
Are you suggesting redirecting host.com:88 to host.com?  That's not
possible because port 88 is not (and should not be) publicly
reachable.




 Any ideas?

 My apache config (using mod_proxy_http, mod_proxy_html, mod_substitute):

   Location /notes/
 Allow from all
 ProxyPass http://127.0.0.1:5001/
 SetOutputFilter  proxy-html
 ProxyPassReverse /
 ProxyHTMLURLMap  /   /notes/
 RequestHeader unset Accept-Encoding
 AddOutputFilterByType SUBSTITUTE application/atom+xml
 Substitute s|127.0.0.1:5001|host.com/notes|
   /Location

 Thanks.

 -
 To unsubscribe, e-mail: users-unsubscr...@httpd.apache.org
 For additional commands, e-mail: users-h...@httpd.apache.org





--
Yang Zhang
http://yz.mit.edu/

-
To unsubscribe, e-mail: users-unsubscr...@httpd.apache.org
For additional commands, e-mail: users-h...@httpd.apache.org



Re: [users@httpd] How to prevent mod_proxy from rewriting redirects into absolute URLs?

2012-11-18 Thread Yang Zhang
`fgrep -ir usecanonicalname /etc/apache2/` turns up nothing.  (FWIW
I'm using the apache2 from Ubuntu 12.04)

On Sun, Nov 18, 2012 at 5:04 PM, Igor Cicimov icici...@gmail.com wrote:



 On Mon, Nov 19, 2012 at 11:03 AM, Nick Kew n...@webthing.com wrote:

 On Sun, 18 Nov 2012 14:48:35 -0800
 Yang Zhang yanghates...@gmail.com wrote:

  I have: nginx (port 80) reverse-proxying to apache2 (port 88)
  reverse-proxying to a web app (port 5001).
 
  However, when the web app responds with a redirect like `Location:
  /foo`,

 That is not valid HTTP.  A Location header must be an absolute URI.

  apache2 rewrites this into `Location:
  http://host.com:88/sub/foo`, even though port 88 is publicly
  inaccessible.

 So where does :88 come from?  Looks like a misconfiguration
 somewhere outside the section you quoted.


 Maybe from UseCanonicalName ??



 --
 Nick Kew

 -
 To unsubscribe, e-mail: users-unsubscr...@httpd.apache.org
 For additional commands, e-mail: users-h...@httpd.apache.org





-- 
Yang Zhang
http://yz.mit.edu/

-
To unsubscribe, e-mail: users-unsubscr...@httpd.apache.org
For additional commands, e-mail: users-h...@httpd.apache.org



Re: [users@httpd] How to prevent mod_proxy from rewriting redirects into absolute URLs?

2012-11-18 Thread Yang Zhang
This is not an option because the point of my using the proxy in this
case is that I need to rewrite the URLs and content (with
mod_proxy_html). The app server hosts at / and I need to translate it
to a subdirectory /sub.

On Sun, Nov 18, 2012 at 5:53 PM, Igor Cicimov icici...@gmail.com wrote:



 On Mon, Nov 19, 2012 at 12:38 PM, Yang Zhang yanghates...@gmail.com wrote:

 On Sun, Nov 18, 2012 at 3:21 PM, Igor Cicimov icici...@gmail.com wrote:
 
  On Mon, Nov 19, 2012 at 9:48 AM, Yang Zhang yanghates...@gmail.com
  wrote:
 
  I have: nginx (port 80) reverse-proxying to apache2 (port 88)
  reverse-proxying to a web app (port 5001).
 
  However, when the web app responds with a redirect like `Location:
  /foo`, apache2 rewrites this into `Location:
  http://host.com:88/sub/foo`,
 
 
  Yes that's what reverse proxy is all about, it rewrites the Location
  header
  using ProxyPassReverseso it doesn't get bypassed in case of backend
  server
  redirection.

 nginx doesn't do the same rewrite from host.com:88 to host.com - I'd
 also be fine with a solution where nginx does this rewrite as well.

 
  even though port 88 is publicly
  inaccessible. I'd like it to just redirect to the relative URL
  `Location: /sub/foo`.
 
 
  So use a redirect then. Looks like reverse proxy is not applicable for
  your
  user case.

 What specifically do you mean when you suggest to use a redirect?
 Are you suggesting redirecting host.com:88 to host.com?  That's not
 possible because port 88 is not (and should not be) publicly
 reachable.


 I meant redirecting  /notes/ to the backend using [P] flag if you like
 instead of proxying it.


 
 
 
  Any ideas?
 
  My apache config (using mod_proxy_http, mod_proxy_html,
  mod_substitute):
 
Location /notes/
  Allow from all
  ProxyPass http://127.0.0.1:5001/
  SetOutputFilter  proxy-html
  ProxyPassReverse /
  ProxyHTMLURLMap  /   /notes/
  RequestHeader unset Accept-Encoding
  AddOutputFilterByType SUBSTITUTE application/atom+xml
  Substitute s|127.0.0.1:5001|host.com/notes|
/Location
 
  Thanks.
 
  -
  To unsubscribe, e-mail: users-unsubscr...@httpd.apache.org
  For additional commands, e-mail: users-h...@httpd.apache.org
 
 



 --
 Yang Zhang
 http://yz.mit.edu/

 -
 To unsubscribe, e-mail: users-unsubscr...@httpd.apache.org
 For additional commands, e-mail: users-h...@httpd.apache.org





-- 
Yang Zhang
http://yz.mit.edu/

-
To unsubscribe, e-mail: users-unsubscr...@httpd.apache.org
For additional commands, e-mail: users-h...@httpd.apache.org



Re: [users@httpd] How to prevent mod_proxy from rewriting redirects into absolute URLs?

2012-11-18 Thread Yang Zhang
(The app server is this: http://gitit.net/README#proxying-to-httpmysite.comwiki)

On Sun, Nov 18, 2012 at 5:55 PM, Yang Zhang yanghates...@gmail.com wrote:
 This is not an option because the point of my using the proxy in this
 case is that I need to rewrite the URLs and content (with
 mod_proxy_html). The app server hosts at / and I need to translate it
 to a subdirectory /sub.

 On Sun, Nov 18, 2012 at 5:53 PM, Igor Cicimov icici...@gmail.com wrote:



 On Mon, Nov 19, 2012 at 12:38 PM, Yang Zhang yanghates...@gmail.com wrote:

 On Sun, Nov 18, 2012 at 3:21 PM, Igor Cicimov icici...@gmail.com wrote:
 
  On Mon, Nov 19, 2012 at 9:48 AM, Yang Zhang yanghates...@gmail.com
  wrote:
 
  I have: nginx (port 80) reverse-proxying to apache2 (port 88)
  reverse-proxying to a web app (port 5001).
 
  However, when the web app responds with a redirect like `Location:
  /foo`, apache2 rewrites this into `Location:
  http://host.com:88/sub/foo`,
 
 
  Yes that's what reverse proxy is all about, it rewrites the Location
  header
  using ProxyPassReverseso it doesn't get bypassed in case of backend
  server
  redirection.

 nginx doesn't do the same rewrite from host.com:88 to host.com - I'd
 also be fine with a solution where nginx does this rewrite as well.

 
  even though port 88 is publicly
  inaccessible. I'd like it to just redirect to the relative URL
  `Location: /sub/foo`.
 
 
  So use a redirect then. Looks like reverse proxy is not applicable for
  your
  user case.

 What specifically do you mean when you suggest to use a redirect?
 Are you suggesting redirecting host.com:88 to host.com?  That's not
 possible because port 88 is not (and should not be) publicly
 reachable.


 I meant redirecting  /notes/ to the backend using [P] flag if you like
 instead of proxying it.


 
 
 
  Any ideas?
 
  My apache config (using mod_proxy_http, mod_proxy_html,
  mod_substitute):
 
Location /notes/
  Allow from all
  ProxyPass http://127.0.0.1:5001/
  SetOutputFilter  proxy-html
  ProxyPassReverse /
  ProxyHTMLURLMap  /   /notes/
  RequestHeader unset Accept-Encoding
  AddOutputFilterByType SUBSTITUTE application/atom+xml
  Substitute s|127.0.0.1:5001|host.com/notes|
/Location
 
  Thanks.
 
  -
  To unsubscribe, e-mail: users-unsubscr...@httpd.apache.org
  For additional commands, e-mail: users-h...@httpd.apache.org
 
 



 --
 Yang Zhang
 http://yz.mit.edu/

 -
 To unsubscribe, e-mail: users-unsubscr...@httpd.apache.org
 For additional commands, e-mail: users-h...@httpd.apache.org





 --
 Yang Zhang
 http://yz.mit.edu/



-- 
Yang Zhang
http://yz.mit.edu/

-
To unsubscribe, e-mail: users-unsubscr...@httpd.apache.org
For additional commands, e-mail: users-h...@httpd.apache.org



[us...@httpd] SSL errors

2010-09-08 Thread Yang Zhang
I'm running a (self-signed) SSL cert site on Apache/2.2.14 on Ubuntu
10.04, but various browsers are giving errors on half the connection
attempts, and wget too:

$ wget --no-check-certificate https://dev.partyondata.com/deps/
--2010-09-08 19:30:26--  https://dev.partyondata.com/deps/
Resolving dev.partyondata.com... 184.72.53.220
Connecting to dev.partyondata.com|184.72.53.220|:443... connected.
OpenSSL: error:0407006A:rsa
routines:RSA_padding_check_PKCS1_type_1:block type is not 01
OpenSSL: error:04067072:rsa routines:RSA_EAY_PUBLIC_DECRYPT:padding check failed
OpenSSL: error:1408D07B:SSL routines:SSL3_GET_KEY_EXCHANGE:bad signature
Unable to establish SSL connection.

Run it right away again and it works:

$ wget --no-check-certificate https://dev.partyondata.com/deps/
--2010-09-08 19:30:29--  https://dev.partyondata.com/deps/
Resolving dev.partyondata.com... 184.72.53.220
Connecting to dev.partyondata.com|184.72.53.220|:443... connected.
WARNING: cannot verify dev.partyondata.com's certificate, issued by
`/CN=dev.partyondata.com':
  Self-signed certificate encountered.
HTTP request sent, awaiting response... 200 OK
Length: 3157 (3.1K) [text/html]
Saving to: `index.html'

100%[==] 3,157   --.-K/s   in 0s

2010-09-08 19:30:29 (48.6 MB/s) - `index.html' saved [3157/3157]

In my sites-enabled/default-ssl:

  SSLCertificateFile/etc/ssl/certs/ssl-cert-snakeoil.pem
  SSLCertificateKeyFile /etc/ssl/private/ssl-cert-snakeoil.key

The cert:

-BEGIN CERTIFICATE-
MIIBszCCARwCCQCa0TzNwqLgsTANBgkqhkiG9w0BAQUFADAeMRwwGgYDVQQDExNk
ZXYucGFydHlvbmRhdGEuY29tMB4XDTEwMDgyNzA2MzA1N1oXDTIwMDgyNDA2MzA1
N1owHjEcMBoGA1UEAxMTZGV2LnBhcnR5b25kYXRhLmNvbTCBnzANBgkqhkiG9w0B
AQEFAAOBjQAwgYkCgYEAzXDEULpCUqIc9hV/ESFapkckR2uoYINA81DvG2aQZ9Ot
Q30OwX2ae2CC4bSzJEIVlahU8vjVrWpmpa28NEhQbqh4ywwbl1XDrEVYI6Gkfimf
snJhOKyaVrEhlwutYtBjmsz3ZIqwymMPm/6smVcSS5dJIynlSmtltxX6ivPcO8UC
AwEAATANBgkqhkiG9w0BAQUFAAOBgQBGxHVkpSSOnZjzuySRepjhAlV/yhe9Fx23
fh12WrjQMEi98B7JEuNSLXDWckUN7O6XRc3RzKmazcGHJqzhn0Ov6gAmAE2XjZ/x
VW21xmaLwk+KgYKFJbJJaP3jMSpU7I3aa11wqAkR2Zd4Nkm9N0YXYIzcBdfztTVI
Et8mEHBFdg==
-END CERTIFICATE-

The cert is in turn generated via:

$ make-ssl-cert generate-default-snakeoil --force-overwrite

Apache version.

$ apache2 -V
Server version: Apache/2.2.14 (Ubuntu)
Server built:   Apr 13 2010 20:22:19
Server's Module Magic Number: 20051115:23
Server loaded:  APR 1.3.8, APR-Util 1.3.9
Compiled using: APR 1.3.8, APR-Util 1.3.9
Architecture:   64-bit
Server MPM: Worker
  threaded: yes (fixed thread count)
forked: yes (variable process count)
Server compiled with
 -D APACHE_MPM_DIR=server/mpm/worker
 -D APR_HAS_SENDFILE
 -D APR_HAS_MMAP
 -D APR_HAVE_IPV6 (IPv4-mapped addresses enabled)
 -D APR_USE_SYSVSEM_SERIALIZE
 -D APR_USE_PTHREAD_SERIALIZE
 -D SINGLE_LISTEN_UNSERIALIZED_ACCEPT
 -D APR_HAS_OTHER_CHILD
 -D AP_HAVE_RELIABLE_PIPED_LOGS
 -D DYNAMIC_MODULE_LIMIT=128
 -D HTTPD_ROOT=
 -D SUEXEC_BIN=/usr/lib/apache2/suexec
 -D DEFAULT_PIDLOG=/var/run/apache2.pid
 -D DEFAULT_SCOREBOARD=logs/apache_runtime_status
 -D DEFAULT_ERRORLOG=logs/error_log
 -D AP_TYPES_CONFIG_FILE=/etc/apache2/mime.types
 -D SERVER_CONFIG_FILE=/etc/apache2/apache2.conf

Any ideas? Thanks in advance for any help.
--
Yang Zhang
http://yz.mit.edu/

-
The official User-To-User support forum of the Apache HTTP Server Project.
See URL:http://httpd.apache.org/userslist.html for more info.
To unsubscribe, e-mail: users-unsubscr...@httpd.apache.org
  from the digest: users-digest-unsubscr...@httpd.apache.org
For additional commands, e-mail: users-h...@httpd.apache.org



[us...@httpd] Re: SSL errors

2010-09-08 Thread Yang Zhang
Adding some more info - just now saw this transient error from Chrome:

Error 126 (net::ERR_SSL_BAD_RECORD_MAC_ALERT): Unknown error.

On Wed, Sep 8, 2010 at 1:03 PM, Yang Zhang yanghates...@gmail.com wrote:
 I'm running a (self-signed) SSL cert site on Apache/2.2.14 on Ubuntu
 10.04, but various browsers are giving errors on half the connection
 attempts, and wget too:

 $ wget --no-check-certificate https://dev.partyondata.com/deps/
 --2010-09-08 19:30:26--  https://dev.partyondata.com/deps/
 Resolving dev.partyondata.com... 184.72.53.220
 Connecting to dev.partyondata.com|184.72.53.220|:443... connected.
 OpenSSL: error:0407006A:rsa
 routines:RSA_padding_check_PKCS1_type_1:block type is not 01
 OpenSSL: error:04067072:rsa routines:RSA_EAY_PUBLIC_DECRYPT:padding check 
 failed
 OpenSSL: error:1408D07B:SSL routines:SSL3_GET_KEY_EXCHANGE:bad signature
 Unable to establish SSL connection.

 Run it right away again and it works:

 $ wget --no-check-certificate https://dev.partyondata.com/deps/
 --2010-09-08 19:30:29--  https://dev.partyondata.com/deps/
 Resolving dev.partyondata.com... 184.72.53.220
 Connecting to dev.partyondata.com|184.72.53.220|:443... connected.
 WARNING: cannot verify dev.partyondata.com's certificate, issued by
 `/CN=dev.partyondata.com':
  Self-signed certificate encountered.
 HTTP request sent, awaiting response... 200 OK
 Length: 3157 (3.1K) [text/html]
 Saving to: `index.html'

 100%[==] 3,157       --.-K/s   in 0s

 2010-09-08 19:30:29 (48.6 MB/s) - `index.html' saved [3157/3157]

 In my sites-enabled/default-ssl:

  SSLCertificateFile    /etc/ssl/certs/ssl-cert-snakeoil.pem
  SSLCertificateKeyFile /etc/ssl/private/ssl-cert-snakeoil.key

 The cert:

 -BEGIN CERTIFICATE-
 MIIBszCCARwCCQCa0TzNwqLgsTANBgkqhkiG9w0BAQUFADAeMRwwGgYDVQQDExNk
 ZXYucGFydHlvbmRhdGEuY29tMB4XDTEwMDgyNzA2MzA1N1oXDTIwMDgyNDA2MzA1
 N1owHjEcMBoGA1UEAxMTZGV2LnBhcnR5b25kYXRhLmNvbTCBnzANBgkqhkiG9w0B
 AQEFAAOBjQAwgYkCgYEAzXDEULpCUqIc9hV/ESFapkckR2uoYINA81DvG2aQZ9Ot
 Q30OwX2ae2CC4bSzJEIVlahU8vjVrWpmpa28NEhQbqh4ywwbl1XDrEVYI6Gkfimf
 snJhOKyaVrEhlwutYtBjmsz3ZIqwymMPm/6smVcSS5dJIynlSmtltxX6ivPcO8UC
 AwEAATANBgkqhkiG9w0BAQUFAAOBgQBGxHVkpSSOnZjzuySRepjhAlV/yhe9Fx23
 fh12WrjQMEi98B7JEuNSLXDWckUN7O6XRc3RzKmazcGHJqzhn0Ov6gAmAE2XjZ/x
 VW21xmaLwk+KgYKFJbJJaP3jMSpU7I3aa11wqAkR2Zd4Nkm9N0YXYIzcBdfztTVI
 Et8mEHBFdg==
 -END CERTIFICATE-

 The cert is in turn generated via:

 $ make-ssl-cert generate-default-snakeoil --force-overwrite

 Apache version.

 $ apache2 -V
 Server version: Apache/2.2.14 (Ubuntu)
 Server built:   Apr 13 2010 20:22:19
 Server's Module Magic Number: 20051115:23
 Server loaded:  APR 1.3.8, APR-Util 1.3.9
 Compiled using: APR 1.3.8, APR-Util 1.3.9
 Architecture:   64-bit
 Server MPM:     Worker
  threaded:     yes (fixed thread count)
    forked:     yes (variable process count)
 Server compiled with
  -D APACHE_MPM_DIR=server/mpm/worker
  -D APR_HAS_SENDFILE
  -D APR_HAS_MMAP
  -D APR_HAVE_IPV6 (IPv4-mapped addresses enabled)
  -D APR_USE_SYSVSEM_SERIALIZE
  -D APR_USE_PTHREAD_SERIALIZE
  -D SINGLE_LISTEN_UNSERIALIZED_ACCEPT
  -D APR_HAS_OTHER_CHILD
  -D AP_HAVE_RELIABLE_PIPED_LOGS
  -D DYNAMIC_MODULE_LIMIT=128
  -D HTTPD_ROOT=
  -D SUEXEC_BIN=/usr/lib/apache2/suexec
  -D DEFAULT_PIDLOG=/var/run/apache2.pid
  -D DEFAULT_SCOREBOARD=logs/apache_runtime_status
  -D DEFAULT_ERRORLOG=logs/error_log
  -D AP_TYPES_CONFIG_FILE=/etc/apache2/mime.types
  -D SERVER_CONFIG_FILE=/etc/apache2/apache2.conf

 Any ideas? Thanks in advance for any help.
 --
 Yang Zhang
 http://yz.mit.edu/




-- 
Yang Zhang
http://yz.mit.edu/

-
The official User-To-User support forum of the Apache HTTP Server Project.
See URL:http://httpd.apache.org/userslist.html for more info.
To unsubscribe, e-mail: users-unsubscr...@httpd.apache.org
  from the digest: users-digest-unsubscr...@httpd.apache.org
For additional commands, e-mail: users-h...@httpd.apache.org



Re: [us...@httpd] Redirecting URL to a location

2010-05-08 Thread Yang Zhang
On Wed, Apr 28, 2010 at 12:06 AM, Igor Cicimov icici...@gmail.com wrote:
 On the second thought this should work (tested):

 Location /notes
    DirectorySlash On
 /Location

This actually doesn't work because of a very key piece of information
that I had omitted -- the proxied web server won't accept
http://127.0.0.1:5001//, only http://127.0.0.1:5001/. So although
/notes will work with DirectorySlash On, /notes/ will take me to the
// URL, when I would like both to take me to the / URL.


 Any way, shouldn't the trailing slash automatically be added by mod_dir
 starting from apache2.0.5?

I'm using apache2.2.14-5ubuntu8
-- 
Yang Zhang
http://yz.mit.edu/

-
The official User-To-User support forum of the Apache HTTP Server Project.
See URL:http://httpd.apache.org/userslist.html for more info.
To unsubscribe, e-mail: users-unsubscr...@httpd.apache.org
  from the digest: users-digest-unsubscr...@httpd.apache.org
For additional commands, e-mail: users-h...@httpd.apache.org



Re: [us...@httpd] Redirecting URL to a location

2010-05-08 Thread Yang Zhang
Thanks! I'll use this for now, but is there a way to do without a redirect?

On Wed, Apr 28, 2010 at 1:08 AM, Luc Bastiaenssen luc.bastiaens...@ua.ac.be
 wrote:

  Another way to consider is to use a redirect like this:

 RedirectMatch permanent ^/notes([/]*)$ /notes/

 Luc


 On 28/04/2010 9:06, Igor Cicimov wrote:

 On the second thought this should work (tested):

 Location /notes
DirectorySlash On
 /Location

 Any way, shouldn't the trailing slash automatically be added by mod_dir
 starting from apache2.0.5?

 Igor

 On Wed, Apr 28, 2010 at 4:51 PM, Edgar Frank ef-li...@email.de wrote:

 2010/04/28 Yang Zhang
 Everything works fine, but is there a simple way for me to make
 /notes get redirected to /notes/?

  Hi,

 first - IIRC you can't rewrite inside a location. Secondly - you
 want the PT-Flag in your rewrite rule. This allows the
 Location-handler to kick in after the rewrite - otherwise the URL
 respectively the result of the rewrite is considered as mapped
 to filespace.

 Regards,
 Edgar

 -
 The official User-To-User support forum of the Apache HTTP Server Project.
 See URL:http://httpd.apache.org/userslist.html for more info.
 To unsubscribe, e-mail: users-unsubscr...@httpd.apache.org
  from the digest: users-digest-unsubscr...@httpd.apache.org
 For additional commands, e-mail: users-h...@httpd.apache.org



 --




-- 
Yang Zhang
http://yz.mit.edu/
emailbanner.png

[us...@httpd] Redirecting URL to a location

2010-04-27 Thread Yang Zhang
I have the following added to default site config (which is otherwise
/etc/apache2/sites-available/default on stock Ubuntu 9.10 apache2),
which sets up a HTML-rewriting reverse proxy to another webserver on
the same host on port 5001:

VirtualHost *:80
DocumentRoot /var/www
...
  #Alias /notes /notes/
  #Location /
  #  RewriteEngine on
  #  RewriteBase /notes
  #  RewriteCond %{REQUEST_FILENAME} ^/notes$
  #  RewriteRule . /notes/ [L]
  #/Location
  #Location /notes
  #  ProxyPass http://127.0.0.1/notes/
  #  SetOutputFilter  proxy-html
  #  ProxyPassReverse /
  #  ProxyHTMLURLMap  /   /notes
  #  RequestHeader unset Accept-Encoding
  #/Location
  Location /notes/
ProxyPass http://127.0.0.1:5001/
SetOutputFilter  proxy-html
ProxyPassReverse /
ProxyHTMLURLMap  /   /notes/
RequestHeader unset Accept-Encoding
  /Location
/VirtualHost

Everything works fine, but is there a simple way for me to make /notes
get redirected to /notes/? Is the only way to do this by setting up a
script at /notes? Currently /notes just results in a 404, and only
/notes/ works. You can tell from the commented lines that I tried a
few other things, but they didn't work. I'd also be curious to know
how to make /notes simply behave like /notes/ (instead of explicit
redirect). Thanks in advance for any hints.
--
Yang Zhang
http://yz.mit.edu/

-
The official User-To-User support forum of the Apache HTTP Server Project.
See URL:http://httpd.apache.org/userslist.html for more info.
To unsubscribe, e-mail: users-unsubscr...@httpd.apache.org
  from the digest: users-digest-unsubscr...@httpd.apache.org
For additional commands, e-mail: users-h...@httpd.apache.org



[us...@httpd] .htaccess not working

2010-04-24 Thread Yang Zhang
I'm using the Ubuntu stock install of Apach, but for some reason,
.htaccess files are not having any effect, despite that AccessFileName
is set to .htaccess.

E.g., here's a .htaccess, and neither the auth nor rewrite stuff is
working. In fact, I can just put gibberish into .htaccess, and no
complaints come up. Any hints would be greatly appreciated -- thanks!

AuthType Basic
AuthName Password Required
AuthUserFile /www/passwords/password.file
AuthGroupFile /www/passwords/group.file
Require Group admins

RewriteEngine On
RewriteBase /wp/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
#RewriteRule ^(.+)$ /index.php/$1 [L,QSA]
RewriteRule . /wp/index.php [L]
-- 
Yang Zhang
http://yz.mit.edu/

-
The official User-To-User support forum of the Apache HTTP Server Project.
See URL:http://httpd.apache.org/userslist.html for more info.
To unsubscribe, e-mail: users-unsubscr...@httpd.apache.org
  from the digest: users-digest-unsubscr...@httpd.apache.org
For additional commands, e-mail: users-h...@httpd.apache.org



Re: [us...@httpd] .htaccess not working

2010-04-24 Thread Yang Zhang
No, it's not on that server.

On Sat, Apr 24, 2010 at 4:16 AM, Sharl.Jimh.Tsin amoiz.sh...@gmail.com wrote:
 嗨,同胞:
 i checked your site http://yz.mit.edu/wp/,
 the rewrite module seems to work now.

 Best regards,
 Sharl.Jimh.Tsin



 2010/4/24 Yang Zhang yanghates...@gmail.com:
 o

 -
 The official User-To-User support forum of the Apache HTTP Server Project.
 See URL:http://httpd.apache.org/userslist.html for more info.
 To unsubscribe, e-mail: users-unsubscr...@httpd.apache.org
      from the digest: users-digest-unsubscr...@httpd.apache.org
 For additional commands, e-mail: users-h...@httpd.apache.org





-- 
Yang Zhang
http://yz.mit.edu/

-
The official User-To-User support forum of the Apache HTTP Server Project.
See URL:http://httpd.apache.org/userslist.html for more info.
To unsubscribe, e-mail: users-unsubscr...@httpd.apache.org
  from the digest: users-digest-unsubscr...@httpd.apache.org
For additional commands, e-mail: users-h...@httpd.apache.org