Link to home
Start Free TrialLog in
Avatar of WASAdmin25
WASAdmin25

asked on

IBM HTTP Server Routing/Rewriting problem

Hi,

I have installed an application on Standalone WebSphere Application Server and I configured the application with the IBM HTTP Server by generating plugin.

As we had an IIS server installed on the same machine so we are using http port 8080 and https port 443 for IBM HTTP Server.

Now I am able to access the application using the URL http://machinename:8080/<application-name>

However, I have been asked to implement a short URL which will route to this http://machinename:8080/<application-name>

So, I have updated the httd.conf file by adding the code below and created a DNS entry  like abc

LoadModule rewrite_module modules/mod_rewrite.so
NameVirtualHost <host-name>:8080

#First Redirection
<VirtualHost <host-name>:8080>
ServerName abc
DocumentRoot "D:/IBM/HTTPServer/htdocs/en_US"
RewriteEngine on
RewriteRule ^/(.*) http://<host-name>:8080/<application-name> [R,L]
</VirtualHost>


Then I restarted both IBM HTTP Server and the WAS.

Now the problem is when I try to hit this short URL http://abc:8080 I am getting "Page Cannot be  displayed error."

Moreover, its not even working with this URL http://<hostname>:8080/<application-name> too

So I changed the port number to 9080 in the redirection code inside httpd.conf file i.e

RewriteRule ^/(.*) http://<host-name>:9080/<application-name> [R,L]

Now it works like a charm...I am able to rewrite the short URL http://abc:8080 to lengthy URL

My question is why its not working with the port 8080 in the redirection code.

If I use port 9080 instead of port 8080 inside the redirection code then there is no point of using the plugin file but I want the http request to be routed through Plugin.

So, please advice if there is anything I can do to fix this issue.


Thanks in Advance !!!
WASAdmin

















Avatar of dipinci
dipinci

Hi,

I guess you have not updated the new DNS entry abc:8080 in the WAS Virtual host alias.  Once update the Virtual host entry please restart webserver and Application server.
The Plugin file must be looking for the new DNS entry with the port number.
If you are using the hostname:9080 it is directly hitting the WebContainer,so it is bypassing the Plugin file.
Still you find error could you send us the Plugin log, error/access log.
Avatar of WASAdmin25

ASKER

Hi,

Thanks for your response...!!

I have updated the new DNS entry abc:8080 in the WAS virtual host alias and restarted the WAS and webserver(IBM Http Server). Moreover, I have generated and propagated the plugin-cfg.xml from the WAS console too.

After making all these updates I couldn't find any changes while accessing the application.

i.e whenever I try to access the application using http://abc:8080 it goes to the trying mode but it never completes the request.

I believe there is something missing in the code of rewriting in httpd.conf becoz I removed the rewriting code and tried with http://hostname:8080/<application-name> and it works with http server hostname.

However its not working while rewriting the short URL.

Anyways I have attached the log files too.

Please Advice !!!!

Thanks,
WASAdmin






access.log
error.log
http-plugin.log
ASKER CERTIFIED SOLUTION
Avatar of dipinci
dipinci

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
I iguess you mean:


ServerName your-host-name
ServerAlias abc
....


then you also don't need a rewrite rule.