typing domain name showing default Tomcat home page

Hi All,

Here is the problem description:-

I am using Linode VPS services for hosting our two web applications. These applications are deployed in tomcat. But when I am typing domain name in the browser, the tomcat default page(It works!) is showing every time.

The technology stack includes Apache, mod_jk and Tomcat. I have done the required configuration but seems missing something somewhere.

Can any please help me to solve this problem.

Following is the virtual host entry for one of the domain names

JkMount /* default

ServerAdmin admin@domain1.com

ServerName domain1.com

ServerAlias domain1.com

RewriteEngine On

RewriteCond %{HTTP_HOST} ^(?
RewriteRule /(.*) http://www.%1/$1 [R=permanent,L]

DocumentRoot /var/lib/tomcat6/webapps/Domain1App/

ErrorLog /var/www/vhosts/domain1.com/logs/error.log

CustomLog /var/www/vhosts/domain1.com/logs/access.log combined

Thanks,

Vikram

3 Replies

Your virtual host definition only works for domain1.com and not for www.domain1.com, so if you're typing www.domain1.com into your browser, your virtual host definition would not be used by Apache. Fix up your ServerAlias line.

Thanks for the reply . Can you please provide input on what should be the entry against ServerAlias .

I have tried with following entries and restarted Apached but still no luck

ServerName domain1.com

ServerAlias www.domain1.com

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct