You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "Tim Urberg (JIRA)" <ji...@apache.org> on 2013/02/01 01:53:12 UTC

[jira] [Comment Edited] (WICKET-5000) HttpsMapper Appends Context Root when Behind Apache Proxy

    [ https://issues.apache.org/jira/browse/WICKET-5000?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13568309#comment-13568309 ] 

Tim Urberg edited comment on WICKET-5000 at 2/1/13 12:51 AM:
-------------------------------------------------------------

I've reproduced this in Tomcat 7 and Apache 2.2 on Ubuntu 12.04.  I've uploaded the file and here was the setup (for Ubuntu specifically):

1, Install Ubuntu 12.04, I used a VirtualBox machine
2. Install Apache with mod_ssl, mod_proxy and, libxml2
sudo apt-get install apache2 libapache2-mod-proxy-html libxml2-dev
sudo a2enmod ssl
sudo a2enmod proxy
sudo a2enmod proxy_http
sudo a2ensite default-ssl
sudo service apache2 restart
You should now be able to go to http://localhost and https://localhost

3. Install tomcat and build the attached source code with maven and copy the generated war file as myproject.war to ${TOMCAT_HOME}/webapps. At that point you should be able to see http://localhost:8080/myproject and there will be a simple link to go to a secure page.

Next edit the following to files replacing the contents with what is below:

/etc/apache2/sites-available/default
<VirtualHost *:80>
        ProxyPass / http://localhost:8080/myproject/
        ProxyPassReverse / http://localhost:8080/myproject/
</VirtualHost>

/etc/apache2/sites-available/default-ssl
<IfModule mod_ssl.c>
<VirtualHost _default_:443>
	ProxyPass / http://localhost:8080/myproject/
        ProxyPassReverse / http://localhost:8080/myproject/

	SSLEngine on
	SSLCertificateFile    /etc/ssl/certs/ssl-cert-snakeoil.pem
	SSLCertificateKeyFile /etc/ssl/private/ssl-cert-snakeoil.key
</VirtualHost>
</IfModule>

Also edit /etc/apache2/mods-available/proxy-html.conf and edit first few lines to look like this:
# Configuration example.
#
# First, to load the module with its prerequisites
#
# For Unix-family systems:
LoadFile	/usr/lib/i386-linux-gnu/libxml2.so #if this file isn't in this location, search for it

With both apache httpd and Tomcat running, go to http://localhost and click the link.  You'll be directed to https://localhost/myproject/secure which will come up with a 404.

Let me know if you need anything else or if you need help setting up.
Tim
                
      was (Author: tim273):
    I've reproduced this in Tomcat 7 and Apache 2.2 on Ubuntu 12.04.  I've uploaded the file and here was the setup (for Ubuntu specifically):

1, Install Ubuntu 12.04, I used a VirtualBox machine
2. Install Apache with mod_ssl, mod_proxy and ,
sudo apt-get install apache2 libapache2-mod-proxy-html libxml2-dev
sudo a2enmod ssl
sudo a2enmod proxy
sudo a2enmod proxy_http
sudo a2ensite default-ssl
sudo service apache2 restart
You should now be able to go to http://localhost and https://localhost

3. Install tomcat and build the attached source code with maven and copy the generated war file as myproject.war to ${TOMCAT_HOME}/webapps. At that point you should be able to see http://localhost:8080/myproject and there will be a simple link to go to a secure page.

Next edit the following to files replacing the contents with what is below:

/etc/apache2/sites-available/default
<VirtualHost *:80>
        ProxyPass / http://localhost:8080/myproject/
        ProxyPassReverse / http://localhost:8080/myproject/
</VirtualHost>

/etc/apache2/sites-available/default-ssl
<IfModule mod_ssl.c>
<VirtualHost _default_:443>
	ProxyPass / http://localhost:8080/myproject/
        ProxyPassReverse / http://localhost:8080/myproject/

	SSLEngine on
	SSLCertificateFile    /etc/ssl/certs/ssl-cert-snakeoil.pem
	SSLCertificateKeyFile /etc/ssl/private/ssl-cert-snakeoil.key
</VirtualHost>
</IfModule>

Also edit /etc/apache2/mods-available/proxy-html.conf and edit first few lines to look like this:
# Configuration example.
#
# First, to load the module with its prerequisites
#
# For Unix-family systems:
LoadFile	/usr/lib/i386-linux-gnu/libxml2.so #if this file isn't in this location, search for it

With both apache httpd and Tomcat running, go to http://localhost and click the link.  You'll be directed to https://localhost/myproject/secure which will come up with a 404.

Let me know if you need anything else or if you need help setting up.
Tim
                  
> HttpsMapper Appends Context Root when Behind Apache Proxy
> ---------------------------------------------------------
>
>                 Key: WICKET-5000
>                 URL: https://issues.apache.org/jira/browse/WICKET-5000
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 6.5.0
>         Environment: Ubuntu 12.04 and Mac OS X Mountain Lion
>            Reporter: Tim Urberg
>            Priority: Minor
>         Attachments: myproject.zip
>
>
> I have a Wicket app running Wicket 6.5.0 which uses HttpsMapper to switch to HTTPS for a login page and on another page.  The app is deployed in Weblogic version 10.3.5.0 with a context root of /documentation.  Weblogic sits behind an Apache HTTP server which uses the Weblogic HTTP Server plugin (http://docs.oracle.com/cd/E13222_01/wls/docs81/plugins/apache.html#120648) and set up like this:
> <VirtualHost *:80>
> 	WebLogicHost 10.0.2.2
> 	WebLogicPort 7011
> 	
> 	SetHandler weblogic-handler
> 	PathPrepend /documentation
> 	ErrorLog ${APACHE_LOG_DIR}/error.log
> 	# Possible values include: debug, info, notice, warn, error, crit,
> 	# alert, emerg.
> 	LogLevel info
> 	CustomLog ${APACHE_LOG_DIR}/access.log combined
> </VirtualHost>
> <IfModule mod_ssl.c>
> <VirtualHost _default_:443>
> 	WebLogicHost 10.0.2.2
> 	WebLogicPort 7011
> 	ErrorLog ${APACHE_LOG_DIR}/ssl_error.log
> 	SetHandler weblogic-handler
> 	PathPrepend /documentation
> 	WLProxySSL ON
> 	SecureProxy ON
> 	# Possible values include: debug, info, notice, warn, error, crit,
> 	# alert, emerg.
> 	LogLevel info
> 	CustomLog ${APACHE_LOG_DIR}/ssl_access.log combined
> 	SSLEngine on
> 	SSLCertificateFile    /etc/ssl/certs/ssl-cert-snakeoil.pem
> 	SSLCertificateKeyFile /etc/ssl/private/ssl-cert-snakeoil.key
> </VirtualHost>
> </IfModule>
> I have tried overriding HttpsMapper#createRedirectUrl to remove /documentation from the URL, but it only works if I go directly to the page that is annotated with @RequireHTTPS.  While debugging I discovered that the above method doesn't get called if a link is clicked or if RestartResponseAtInterceptPageException is used (with wicket-auth-roles).

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira