Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium


IBM HTTP Server Routing/Rewriting problem

Posted on 2009-04-17
Medium Priority
Last Modified: 2013-12-11

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]

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 !!!

Question by:WASAdmin25
  • 2

Expert Comment

ID: 24178368

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.

Author Comment

ID: 24184690

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 !!!!



Accepted Solution

dipinci earned 1500 total points
ID: 24189404

The Virtual host entry in the httpd.conf fille should be abc:8080 not the hostname, then you should be providing the redirect match You wont be able to access abc:8080 from the browser since there is no website named abc:8080 running. So ur trying to hit the non-working url.
Once u hit the hostname:8080 u can access since there 8080 is listening on hostname.

1. U can configure redirect in different ways. u can configure with index.html file tagged with redirect url
ex: DirectoryIndex Index.html(Inside Virtual host)
Index.html file can be tagged with
<META HTTP-EQUIV="Refresh" Content="0; URL=https://abc:8080/context-root">
2. u can use Redirect 301 / http://abc:8080/<context root>

3. U can user rewrite engine.

LVL 51

Expert Comment

ID: 24223893
I iguess you mean:

ServerName your-host-name
ServerAlias abc

then you also don't need a rewrite rule.

Featured Post

Become an Android App Developer

Ready to kick start your career in 2018? Learn how to build an Android app in January’s Course of the Month and open the door to new opportunities.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

With the withdrawal of support for Windows Server 2003 this summer, many clients face the issue of moving away from their 2003 installs. There are a few options out there that many people/companies are selling. But the clients I have, haven't wanted…
Files go missing when using DFS (Distributed File System) Replication and how to recover them and fix it.
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
Internet Business Fax to Email Made Easy - With  eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, f…
Suggested Courses
Course of the Month10 days, 8 hours left to enroll

572 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question