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.
mobotAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

matrix8086Commented:
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!
mobotAuthor Commented:
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?
matrix8086Commented:
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!
Acronis True Image 2019 just released!

Create a reliable backup. Make sure you always have dependable copies of your data so you can restore your entire system or individual files.

mobotAuthor Commented:
I've tried modifying /sites/enabled/000-default.  No luck.  I'm looking into Apache mod-proxy for a possible solution.
mobotAuthor Commented:
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.
mobotAuthor Commented:
This link has the documentation on how it's done. https://tomcat.apache.org/connectors-doc/generic_howto/proxy.html

I'm using Debian so the file to edit is /etc/apache2/apache2.conf.  I believe that for other distro's it may /etc/apache2/httpd.conf.

I added this line to the end of apachec2.conf and restarted Apache2.
RedirectMatch ^/$ http://www.mycompany.com/myapp/

This works for me.  Now instead of the app being under http://app.myserver.com:8080/myapp/ it's under http://app.myserver.com

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
mobotAuthor Commented:
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
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Apache Web Server

From novice to tech pro — start learning today.