Tomcat Configure To Serve Static Files is not working - linux

I have linux machine, on which I have deployed my project. I have some static content which I have placed at /var/grt_dynamic_images on physical harddisk on linux. I am using it as /EchlonSurvey/images/dynamic/images. It is working fine on windows but not on linux.
Here is the server.xml file snapshot, where I am doing this configuration.
<Context docBase="/var/grt_dynamic_images" path="/EchelonSurvey/images/dynamic_images" />
<Context docBase="/var/grt_dynamic_images/category_images" path="/EchelonSurvey/images/dynamic_images/cat_images" />
<Context docBase="/var/grt_dynamic_images/profile_images" path="/EchelonSurvey/images/dynamic_images/prof_images" />
In webpage, I get 404 error. The path is same but the image are not coming from docBase. I have checked, there are all image which I need.
http://.../EchelonSurvey/images/dynamic_images/cat_images/277152_9449%20sml.png
image not available

one suggestion. if you have a ROOT webapp, you can create a symbolic link within it and point to the folder you want to serve. so something like
/tomcat/webapps/ROOT: ln -s /var/grt_dynamic_images /EchelonSurvey/images/dynamic_images
when i do this, it 'works' but only if i am specifying an actual resource on the url, like a .png file. i still get 404's if i just stop the url at a folder level. i'm sure there's some Tomcat setting for displaying a folder listing but haven't looked into it.

Related

Creating Virtual Directory on IIS for Coldfusion Lucee

I am trying to Move my Website on a local directory from Adobe Coldfusion to Lucee.
I was able to Install Lucee with the Windows Installer.
IIS is working fine.
When i Create a Virtual Directory from IIS to Map a Physical Path (C:/Website) outside the inetpub root folder (FOR IIS) or outside the Tomcat/webapps/ROOT folder (for Lucee), IIS doesn't load that physical folder. Instead it loads the inetpub root folder and i can't access files from the Physical Path Directory.
I am using //localhost/{The Alias} to call the Website but saying file not not found.
Obviously because it's calling from Inetpub file Directory, not the Physical path.
Are there any special configurations i need to make?
I have searched online and no post could help.
Note that i am using different computers.
Kindly Assist.
mod_cfml (the adapter that is used with Lucee/IIS along with the BonCode Connector) does not currently support virtual directories. You will need to configure those manually in the Tomcat context config, like so:
<Host name="lucee.org" appBase="/home/lucee/public_html">
<Context path="/vdir/" docBase="/home/other_user/public_html/some_other_directory/" />
<Alias>www.lucee.org</Alias>
</Host>

Image Path from ubuntu Server

I need some help for referencing the image present in the Ubuntu server. My image path in Ubuntu server "/home/Ubuntu/Chat/public/images/directions-icon.jpg". When i try to open the saved html its not displaying any thing. I thing its referencing my Laptop path. How to excursively mention a Ubuntu Path over here. Please Help Me. Thank you all.
My Code:
<html>
<img src="/home/Ubuntu/Chat-BOT/public/images/directions-icon.jpg">
</html>
Error: Not Displaying any thing
Just check the following things for diplaying the image
Ubuntu is a linux based operating system and its paths are case sensitive make sure you give exact path
Secondly their might be a permission issue for accessing the directory. You must atleast have read permission to show the image. Run "sudo chmod" command to change the permission of your desired directory.
Thirdly, make sure that the path you are giving is in the www or public web directory of your web server. Because if you are running your pages as a localhost the relative paths mostly starts from the folder within www or web directory example if file is in
/www/images/image.png
The relative path will be
src="/images/image.png"
Which means path according to local web address is
http://localhost/images/image.png
Thanks.
Perhaps you should start by checking you path again
/home/Ubuntu/Chat/public/images/directions-icon.jpg
and
/home/Ubuntu/Chat-BOT/public/images/directions-icon.jpg
are not exactly the same.
You seem to be referencing Chat-Bot while you probably meant to reference Chat (or probably vice-versa)

Video.js source not in Apache folder

I have an Apache Server running on linux
The directory used for the website is the default
/var/www
When Using Video.js, setting the video source is easy when the files are in the same directory.
e.g.
/var/www/index.html
/var/www/video/video1.mp4
<source src="video/video1.mp4" type='video/mp4' />
I can't seem to set this source if the files are not in the Apache folder however.
e.g.
/home/user/video/video2.mp4
<source src="/home/user/video/video2.mp4" type='video/mp4' />
If Apache is using /var/www as your root, I don't think it will allow access to anything outside of that directory. Have you tried accessing those files directly in a browser, outside of video.js?
Additionally, by setting the source URL to '/home/user/video/video2.mp4', you're telling the browser to look for the file at "www.mywebsite.com/home/user/video/video2.mp4', which apache will translate to "/var/www/home/user/video/video2.mp4".
I'm far from an expert on how Apache works, but I hope that helps.

Tomcat webapp configuration on linux

I have a webapp (springmvc 3.0.5/java 1.6 based) that I'm deploying to a tomcat (6.0.32) web server on a linux machine. Currently I copy the war file out to the server and let tomcat unpack it for me.
relevant lines in server.xml:
<Host appBase="webapps" autoDeploy="true" name="localhost" unpackWARs="true" xmlNamespaceAware="false" xmlValidation="false">
<Context docBase="fooapp" path="/" reloadable="true" source="org.eclipse.jst.jee.server:Fooapp"/>
</Host>
I want the webapp context path to be "/" so I don't have to add /fooapp/ to every url. http://www.mydomain.com/index.html instead of http://www.mydomain.com/fooapp/index.html
The issue is that in my current configuration the webapp is served from BOTH "/" and from "/fooapp" context paths because tomcat unpacks the war twice. Once to the fooapp directory and another time to the ROOT directory.
I'd like the web application to be unpacked just once to the fooapp directory and still served from the "/" context path. Can this be done on linux and if so how?
Note: This works on windows exactly as I want so I'm hopeful that linux can do the same thing.
The simplest method:
Delete your Context tag from the server.xml,
delete webapp/fooapp and webapp/ROOT directories,
copy your fooapp.war to the webapp directory as ROOT.war.
You can find some other methods in the Tomcat's documentation.

IIS7.5 Application is using web.config in the root directory instead of its own!

Note: I did not setup a virtual directory its a Application!
Here is the structure
Hard drive folders:
-IISRoot
-Webpage
Test.aspx
web.config
-WebService
-Bin
Service.svc
web.config
IIS is setup the following way:
-WebSite (Mapping against ISSRoot\Webpage)
-Service ((Application) mapping against IISRoot\WebService)
Now when i try to run the Service.svc i get a error that a httpHandler was not found ("Could not load type 'Jympa.Nu.FileRequestHandler'")...
Now if i look in the web.config in the root there is a line adding this but the web.config in the webservice is not..
So why is IIS using the wrong web.config?
Edit:
If i remove the web.config in the
Webpage folder the service works but
the webpage stops to work..
I found a solution i changed the pipeline mode on the application pool to Integrated.

Resources