?
Solved

Tomcat+apache

Posted on 2003-03-26
13
Medium Priority
?
169 Views
Last Modified: 2013-11-24
Hello everyone. Please help me out here. When I access a servlet "HelloWorld.class" from httpd its by default run on /servlet/HelloWorld. Please I want to make it /servlets/HelloWorld. I want to change from /servlet to /servlets and make it my configuration. is there any change in web.xml right me complete configuration
0
Comment
Question by:tomcat_linux
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
13 Comments
 

Author Comment

by:tomcat_linux
ID: 8210181
It is possible but not sure that weather change in web.xml  or redirect it from apache.
0
 
LVL 35

Expert Comment

by:girionis
ID: 8210263
 Yuo have to use the <url-pattern> tag to define the URL pattern for your Servlet.
0
 

Author Comment

by:tomcat_linux
ID: 8210552
Is there any example that how to add this URl-Pattern to make /servelt to /servlets and which file i will make chages please. right me complete.
0
Basic Security of Your VPC

So, you’ve got this shiny new VPC and a fancy new application configured on your EC2 servers ready to go. This application is only accessible from your computer, which is great for security, but you need your users to be able to access it! So, what’s the easiest way to do this?

 
LVL 35

Expert Comment

by:girionis
ID: 8210722
 You should add it inside your <servlet-mapping> tag. Lets say that you have defined a servlet with the name "hello" like the following:

<servlet>
  <servlet-name>Hello</servlet-name>
  <servlet-class>mypackage.hellopackage.Hello</servlet-class>
  <display-name></display-name>
  <description></description>
 </servlet>

  then you can map the "Hello" Servlet to the /servlets URL pattern by doing:

<servlet-mapping>
  <servlet-name>Hello</servlet-name>
  <url-pattern>/servlets/Hello</url-pattern>
 </servlet-mapping>

  Now all the requests to http://www.mysomething.com/servlets/Hello will go to the "Hello" Servlets. Note that I am nto entirely sure if this:   <url-pattern>/servlets/Hello</url-pattern> is th eexact syntax. If that does not work experiment a bit around, try to add a * after the pattern, play around with the forward slashes etc.
0
 

Author Comment

by:tomcat_linux
ID: 8216349
Thanks that working fine one thing please tell me that how can i connect my database as well because in my servlets i define dirsconf.conf file that contain all information of database that i put in /etc/ because that was working fine with apachejserv but how can i connect with that and my document Root is /apache/htdocs. I will thankful for you this kind of help
0
 
LVL 35

Expert Comment

by:girionis
ID: 8216638
 How do you read this dirsconf.conf file? The only thing you have to do is to change the path to the file and the system should pick it up automatically.
0
 

Author Comment

by:tomcat_linux
ID: 8225533
I have made DocumentRoot /usr/local/apache/htdocs and in server.xml i have amde changes so my servlets are running fine but i am confued what should i do for running jsp pages please.
0
 
LVL 35

Expert Comment

by:girionis
ID: 8234583
 If you want to run JSP pages just put the, under your web applicaiton folder. If your web application is called for example "tomcat_linux" the nput your JSp pages under the "WEB-INF/tomcat_linux" folder and then run them.
0
 

Author Comment

by:tomcat_linux
ID: 8247005
Now my jsp has start working but for running that i should frist run it on port 8080 then it will start run on port 80 otherwise if i try to start this on direct port 80 before running on port 8080 it gives the Internal Server Error.


0
 
LVL 35

Accepted Solution

by:
girionis earned 200 total points
ID: 8247503
 What do you mean by that? Do you mean that you have to put the port at the end of the URL, something like: http://www.myserver.com:8080/myjsp.jsp or that there are conflicts on the port 80?
0
 

Expert Comment

by:CleanupPing
ID: 9058476
tomcat_linux:
This old question needs to be finalized -- accept an answer, split points, or get a refund.  For information on your options, please click here-> http:/help/closing.jsp#1 
EXPERTS:
Post your closing recommendations!  No comment means you don't care.
0
 
LVL 15

Expert Comment

by:jimmack
ID: 9732778
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:

Accept girionis' comment as answer.

Please leave any comments here within the next seven days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

jimmack
EE Cleanup Volunteer
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Introduction Java can be integrated with native programs using an interface called JNI(Java Native Interface). Native programs are programs which can directly run on the processor. JNI is simply a naming and calling convention so that the JVM (Java…
In this post we will learn how to make Android Gesture Tutorial and give different functionality whenever a user Touch or Scroll android screen.
Viewers learn how to read error messages and identify possible mistakes that could cause hours of frustration. Coding is as much about debugging your code as it is about writing it. Define Error Message: Line Numbers: Type of Error: Break Down…
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
Suggested Courses
Course of the Month15 days, 2 hours left to enroll

770 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