The appBase should be more like: appBase="/www/hosts/firstd
Main Topics
Browse All TopicsHi everyone,
I am working on an internal webapp using tomcat and mysql installed in a server. What I am trying to do is to set up a virtual host with an appropriate name like for example
www. adminsys.com
So I went to the server.xml file and added the following:
<!-- Setting up my virtual host -->
<Host name="127.0.0.1" debug="0" appBase="webapps/AdminSyst
unpackWARs="true" autoDeploy="true">
<Alias>AdminSys</Alias>
<Context path="" docBase="" debug="0"/>
</Host>
But when write AdminSys in my iexplorer address nothing comes up, even though its working fine the normal way, which is http://localhost/AdminSys
Many thanks,
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
many thanks for your comments , sorry but i couldn't relate to your example. Unfortunately I don't have much experience with tomcat server configuration.
my web application is stored inside Tomcat's webapps folder. its under a folder called AdminSys inside webapps. when i try to browser my web application using the tomcat manager page its working fine but as i explained i would like to create a virtual address for my web application.
So what is the equivalent in my application to appBase?? is it the link i find when i am browsing my webapplication using the tomcat management page or is it the physical address in the computer. or perhaps i am missing something??
Many thankx again,
I'm not sure that everything is clear to me. Do you need to use several domain names with each a different environment? Or do you only use one domain name? If you use only one domain name for all applications (one or many), then you don't need to add a host. You can use the default one.
If not, please let me know.
Try the following:
<!-- Setting up my virtual host -->
<Host name="127.0.0.1" debug="0" appBase="webapps"
unpackWARs="true" autoDeploy="true">
<Context path="" docBase="" debug="0"/>
<Alias>www.adminsys.com</A
</Host>
The location of your webapps is:
$CATALINA_HOME/webapps/
"$CATALINA_HOME" is the installation directory of Tomcat.
If you put your "AdminSystem" webapp inside the webapps dir, the URL is:
http://www.adminsys.com/Ad
Inside the ROOT directory, you can add an index file to redirect to your webapp.
Btw, this is not a virtual host. This is just an alias! A virtual host is used when you only have one IP-address and different domain names. Each domain name should have its own webapp folder. You could of course let them share the same folder, using only <Alias>, but that would have many disadvantages.
Another thing... Is the domain name (www.adminsys.com) pointing to your machine, to the right IP-address? If not, and if this is just for testing purposes, you need to edit the host file of your computer, so it catches the domain name and directs it to 127.0.0.1. If you want to try a real world example, you can register with dyndns.org and try a dynamic or static subdomain that points to your machine.
Many thanks for your very informative answer, everything is working fine except for the alias thing. I can’t use the alias name to access the server from the other workstations in the local network:
My server.xml <host> tag is as follows:
<Host name="MyNetworkDomainName”
unpackWARs="true" autoDeploy="true"
xmlValidation="false" xmlNamespaceAware="false">
<Context path="" docBase="" debug="0"/>
<! -- This part of the file doesn’t work from other workstations in the network-->
<Alias>www.adminsys.com</A
</Host>
Thanks for the points!
When a computer sends out a request for a website page, using a domain name, the first thing that happens is matching the domain name to an ip-address. This is done by a DNS server. This can be the DNS server of your provider, or if your on a local network it can be the router and even your local computer. The point is that somehow this link has to be made.
I don't know if adminsys.com is the actual name you are using or not. Suppose it is, then your computer, and your router will look it up in their local dns-database, and find nothing. Then they go to the dns-server of your provider. That will find nothing, after which it will send out a request to some higher dns-server, etc.
You can however filter domain names on your local network and route them to other ip-addresses. So you could route adminsys.com to 192.168.0.10, if that is your webserver. You can make such a link in your computer's host file. Then it will only work for that one computer. You can do this for each computer in the network. But that's not really easy to maintain. Thus it's better to do this on your router/firewall. Then all computers on the network that use the router's dns will end up at your webserver.
Another thing is that domain names that are routed to this machine and that don't have an alias, those domain names will be handled by the default host in your server.xml. So if you only have one host, then you don't need an alias. Aliases are only meant so Tomcat understands which domain name belongs to what host.
Business Accounts
Answer for Membership
by: R7AFPosted on 2007-04-27 at 04:06:30ID: 18987844
The Alias is for domain names, like: lias>
debug="1" appBase="firstdomain/webap ps" unpackWARs="true"> lina.logge r.FileLogg er" directory="logs" ias> " debug="1" appBase="seconddomain/weba pps" unpackWARs="true"> lina.logge r.FileLogg er" directory="logs" lias>
ps". See that I reversed webapps and firstdomain?
pps". Each host has a seperate webapp directory. Therefor I suggest using a file structure like:
<Alias>admin.domain.com</A
Another example:
<Host name="www.firstdomain.com"
<Logger className="org.apache.cata
prefix="projects." suffix=".txt" timestamp="true"/>
<Context path="" docBase="" debug="1" reloadable="true" crossContext="true" />
<Alias>firstdomain.com</Al
</Host>
<Host name="www.seconddomain.com
<Logger className="org.apache.cata
prefix="projects." suffix=".txt" timestamp="true"/>
<Context path="" docBase="" debug="1" reloadable="true" crossContext="true" />
<Alias>seconddomain.com</A
</Host>
In this example www.firstdomain.com and firstdomain.com point to appBase="firstdomain/webap
www.seconddomain.com and seconddomain.com point to appBase="seconddomain/weba
* hosts
** firstdomain/webapps
** seconddomain/webapps
** etc/webapps
I've tried to leave out the webapps and put the wars/applications directly in the firstdomain directory, but for some reason that didn't work. That was on a Windows system though!