I have tried changing the docBase (with the help of several tutorials for serving static images from outside WebApp)of the Apache Tomcat installed by Netbeans, but till now no luck for me and getting 404 error.
<Context path="/WebApp/images" docBase="C:\\Users\Digvijay\Pictures\SAB" />
I am using windows.
I am not sure if there is some other way to configure Apache Tomcat installed by netbeans.
By the way below are the links for the solutions I tried
Simplest way to serve static data from outside the application server in a Java web application
Mapping a directory outside the web-app to URL in TOMCAT
Following steps works for me (NetBeans 7.3) ...
Select "Services" tab in NetBeans (top-lefthand box)
Right-click "Servers :: Apache Tomcat " and select "Edit server.xml" item
Put content as described in links and save file
Right-click "Servers :: Apache Tomcat " and select "Restart"
Related
Hello fellow programmers,
I have to get axis2 (version 1.7.2) working in Tomcat (version 8.0.33) but here I encounter a annoying problem. I have followed the steps in the tutorial (from the axis.apache website) until the point of checking the link mentioned in the topic title.
I have downloaded the Axis2.war file and placed it in the webapps folder in the tomcat home directory (/opt/tomcat).
When I start tomcat using the startup.sh file and visit the homepage it all seems to work. visiting the link http://localhost:8080/ will show me the text:
It works !
If you're seeing this page via a web browser, it means you've setup Tomcat successfully. Congratulations! etc etc
But then when I visit http://localhost:8080/axis2 I get:
HTTP Status 404 - /axis2
type Status report
message /axis2
description The requested resource is not available.
Apache Tomcat/8.0.28 (Ubuntu)
When I run the .startup file and at the same time look at my webapps folder I see that the .war folder is extracted and makes the axis2 folder appear, thus it works until there at least.
Does someone has an idea of what could be wrong here?
PS: I am using Ubuntu.
if your deploy axis2.war, port must be the same at the Apache Tomcat and Axis2 8080, check file tomcat_dir\conf\server.xml
I'm running in a strange problem. I have a project based on MAVEN. When I run the project directly from my computer for testing it, using mvn tomcat7:run, my website display is correct. When I upload it to my distant Tomcat server, that is accessed through the JK Apache Tomcat connector, the JSP page is served as a text file. In response headers, I can see Content-Type:text/plainwhich is almost strange, and I'm suspecting the Apache server is adding it because of some erroneous configuration.
Any idea where to look, to fix this problem ?
We currently have a Glassfish Server 4.0 hosting our webpage, with Apache 2.2 as our Digital Certificate Holder in Ubuntu Server. One of our clients did a Vulnerability testing and discovered that a font (specifically, the glyphicons-halflings-regular.ttf) could be downloaded by using the URL:
http://<URL>/<War>/faces/resources/fonts/glyphicons-halflings-regular.ttf
Is there any way that we can avoid that download and instead redirect that Link to a error page when people try to access any link of that type?
Thanks in advance
Well, the solution I found was this
I opened the Glassfish Console, went to Configurations –> server-config -> virtual servers -> server and then I clicked on the Add Property button
the name was: Redirect1
The code was:
from=/<war>/faces/resources/fonts/glyphicons-halflings-regular.ttf url-prefix=https://<URL>/<war>/
I did it with all of the Cluster and configuration instances of Glassfish Cluster
After a Glassfish and Cluster restart everything was working fine.
Regards!
I've created a web project in Netbeans. When I run it, it starts a glassfish server, and everything works fine (I don't understand why or how, but it works).
I also have XAMPP installed on my mac. I copied my netbeans project folder to my user sites folder, and ran my apache server with XAMPP.
I can access the sites index, but whenever I try to use a servlet, I get a 404, object not found.
Does this have something to do with glassfish web xml file? Servlet Mapping? Is there a new apache web xml file that I must create for it to work on apache server?
I can paste code if you need it.
Thanks!!!
Apache Server is for php based application and for running java based web project you have to install apache tomcat or glassfish as you have done previously where the servlet container is available.
I am trying to include tomcate in apache, following the steps in the below link
http://tomcat.apache.org/tomcat-3.2-doc/uguide/tomcat_ug.html.
In that link they mention after the tomcat starts there will be a file tomcat-apache.conf inside the tomcat\conf directory but am not able to find it. Am using tomcat 6 binary.
Am i using the right tomcat or should get a different one??
if your are on windows , you can easily use XAMPP for windows it supports and included tomcat and it is configured and u can just use it