Solved

How to add an alias directory?

Posted on 2011-03-12
5
1,410 Views
Last Modified: 2013-12-02
I have an application that runs in Tomcat 5.5. To access the application I use a url like this:

http://company.com:8080/appname

This application stores images on a different drive on the server. I would like to an alias so I can acess the images like this:

http://company.com:8080/appname_images

What file needs to be edited and what is the syntax?

Thanks
0
Comment
Question by:greddin
  • 3
  • 2
5 Comments
 
LVL 92

Accepted Solution

by:
objects earned 500 total points
ID: 35118493
0
 

Author Comment

by:greddin
ID: 35119039
hmm, I added this under the <Host> section of my server.xml:

<Context path="/myimages"
             docBase="c:\path\to\images"
             reloadable="true"
             crossContext="true" />

Then I restarted Apache Tomcat but I get Http 404 when I try to hit the url

HTTP Status 404 - /myimages/
--------------------------------------------------------------------------------
type Status report
message /myimages/
description The requested resource (/myimages/) is not available.


0
 
LVL 92

Expert Comment

by:objects
ID: 35119053
is there an index.html file i that directory?
try specify a path to one of the images
0
 

Author Comment

by:greddin
ID: 35119196
Ah, it was working. You're right, there isn't an index.htm but I can reference my images when I added one to the url.

Thanks for your help.
0
 

Author Closing Comment

by:greddin
ID: 35119197
Thanks again.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
JDBC error in Apache tomcat 6 248
Java Exception example issues 11 84
Java concurrency in pictures ( or animations ) 1 107
Safari, Firefox, IE, Java, Plugin, Java Security error 13 52
Verbose logging is used to diagnose garbage collector problems. By default, -verbose:gc output is written to either native_stderr.log or native_stdout.log.   It is also possible to redirect the logs to a user-specified file. This article will de…
Most of the developers using Tomcat find it easy to configure the datasource in Server.xml and use the JNDI name in the code to get the connection.  So the default connection pool using DBCP (or any other framework) is made available and the life go…
Hi friends,  in this video  I'll show you how new windows 10 user can learn the using of windows 10. Thank you.
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

910 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now