Link to home
Start Free TrialLog in
Avatar of mobot
mobotFlag for United States of America

asked on

Shorten long url? Apache2 and Tomcat.

How is this done?

I want to shorten http://servername.domain.com:8080/ipt-2.2.1 to just http://servername.domain.com

There's just the ipt app on the server.  No plans to add other apps to the server.
Avatar of matrix8086
matrix8086
Flag of Romania image

It's easy: You need to edit httpd.conf (located probably in /etc/http) and edit in the default host configuration the line DocumentRoot from "/var/www/html" to the path where is your application pit-2.2.1.

Best regards!
Avatar of mobot

ASKER

I don't have an httpd.conf file on the server.  A little more detail.

Debian 7.8, Apache2 with mod-jk module enabled, Java 7, Tomcat 7.

The /etc/apache2/apache2.conf file don't have the line DocumentRoot in it.  So that's a no go.
I've tried modifying the /etc/apache2/sites-available/default file which does have line DocumentRoot in it.
And the /etc/apache2/sites-available/vhost.domain.com file I created.
And the /etc/apache2/sites-enabled/000-default file.
And no luck.
Any other suggestions?
Hi,

I never work on debian. As I have read is a little different from RedHat:

/etc/apache2/sites-available/ directory contains defined sites (virtual hosts)
/etc/apache2/sites-enabled/ directory contains enabled sites. I don't understand how a site became enabled/active.

In my opinion I would try to modify /etc/apache2/sites-available/default and if that is not working I would copy default file in /etc/apache2/sites-enabled/

However, you have to restart apache after each modification, in order that modification to occurs

Best regards!
Avatar of mobot

ASKER

I've tried modifying /sites/enabled/000-default.  No luck.  I'm looking into Apache mod-proxy for a possible solution.
Avatar of mobot

ASKER

Looks like Apache's mod_proxy_ajp module may be the solution.  I'm just getting up to speed with it.  If you've worked with it before and have some tips or tricks on setting it up let me know.
ASKER CERTIFIED SOLUTION
Avatar of mobot
mobot
Flag of United States of America 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
Avatar of mobot

ASKER

The solution I found through my own trial and error works.  Here's a link that explains it.
https://tomcat.apache.org/connectors-doc/generic_howto/proxy.html