Link to home
Start Free TrialLog in
Avatar of manoj2066
manoj2066

asked on

Apache vhost RedirectMatch and ajp13 problem

hi
I have a an apache 2.0.52 connected to tomcat 5.5.25 using JkMount  ajp13 connector.

Now I have 2 vhosts configured for my domain one listing on port 80 and the other listening on port 443

I am transfering all the requests from apache to tomcat using JkMount /* ajp13.
Now my requirement is I need to transfer all the requests to tomcat except a coulple of pages like login.jsp.
The request for login.jsp should be redirected to the vhost listening on the ssl port 443.
Usually this can be done by using Redirectmatch or Redirect but because I am using JkMount /* ajp13
it overrides the Redirectmatch entry for login page.

Could you please tell me how give the Redirectmatch prefrence over JkMount /* ajp13.
Requests for all other pages except login.jsp should be sent to tocmat. I do not wish to use apache for server static content.
Please find the two virtual host entries in the code snippet.


NameVirtualHost 64.151.81.100:80 
NameVirtualHost 64.151.81.100:443 
 
 
# apache configuration
 
<VirtualHost 64.151.81.100:443>
 
	ServerName www.drdenisetarasuk.egenhealth.com
 
	ServerAlias drdenisetarasuk.egenhealth.com *drdenisetarasuk.egenhealth.com
	
	SSLEngine On
 
	SSLCertificateFile    /etc/httpd/conf/ssl.crt/drdenise.crt
       SSLCertificateKeyFile /etc/httpd/conf/ssl.key/drdenise.key
 
	
	
 
	ServerAdmin manoj@egenhealth.com.com
	DocumentRoot /home/virtual/site6/fst/var/www/html
 
	JkMount /* ajp13
	RewriteEngine on
	suexecUserGroup admin6 admin6
 
	
 
	
 
	<Directory /home/virtual/site6/fst/var/www/html/>
		Allow from all
		AllowOverride All
		Order allow,deny
	</Directory>
 
	<Directory /home/virtual/site6/fst/home/*/public_html/>
		Allow from all
		AllowOverride All
		Order allow,deny
	</Directory>
 
	SetEnv SITE_ROOT /home/virtual/site6/fst
	SetEnv SITE_HTMLROOT /home/virtual/site6/fst/var/www/html
 
        <IfModule mod_php4.c>
                # need to set php on explicitly (PR 24077).
                # using php_flag so site can override.
                php_flag engine on
		# php_admin_value sendmail_path  "/usr/sbin/sendmail -t -i -f %s@%s"
        </IfModule>
        <IfModule sapi_apache2.c>
                php_flag engine on
		# php_admin_value sendmail_path  "/usr/sbin/sendmail -t -i -f %s@%s"
        </IfModule>
 
        <Directory /home/virtual/site6/fst/var/www/interpreters>
                Options ExecCGI
                SetHandler cgi-script
        </Directory>
        Alias /interpreters/ /home/virtual/site6/fst/var/www/interpreters/
 
	
</VirtualHost>
 
 
 
 
 
<VirtualHost 64.151.81.100:80>
 
	
	ServerName www.drdenisetarasuk.egenhealth.com
 
	ServerAlias drdenisetarasuk.egenhealth.com *drdenisetarasuk.egenhealth.com
	
	RedirectMatch permanent ^/(.*)login\.jsp$ https://www.egenhealth.com/$1 
 
 
	ServerAdmin manoj@egenhealth.com.com
	DocumentRoot /home/virtual/site6/fst/var/www/html
	#JkMount /*.jsp ajp13
	JkMount /* ajp13
	RewriteEngine on
	suexecUserGroup admin6 admin6
 
	
 
	
 
	<Directory /home/virtual/site6/fst/var/www/html/>
		Allow from all
		AllowOverride All
		Order allow,deny
	</Directory>
 
	<Directory /home/virtual/site6/fst/home/*/public_html/>
		Allow from all
		AllowOverride All
		Order allow,deny
	</Directory>
 
	SetEnv SITE_ROOT /home/virtual/site6/fst
	SetEnv SITE_HTMLROOT /home/virtual/site6/fst/var/www/html
 
        <IfModule mod_php4.c>
                # need to set php on explicitly (PR 24077).
                # using php_flag so site can override.
                php_flag engine on
		# php_admin_value sendmail_path  "/usr/sbin/sendmail -t -i -f %s@%s"
        </IfModule>
        <IfModule sapi_apache2.c>
                php_flag engine on
		# php_admin_value sendmail_path  "/usr/sbin/sendmail -t -i -f %s@%s"
        </IfModule>
 
        <Directory /home/virtual/site6/fst/var/www/interpreters>
                Options ExecCGI
                SetHandler cgi-script
        </Directory>
        Alias /interpreters/ /home/virtual/site6/fst/var/www/interpreters/
 
	
 
 
 
</VirtualHost>

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of caterham_www
caterham_www
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial