aspose file tools*
The moose likes General Computing and the fly likes Deploy a servlet project on Apache HTTP 2.0 server Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Engineering » General Computing
Bookmark "Deploy a servlet project on Apache HTTP 2.0 server" Watch "Deploy a servlet project on Apache HTTP 2.0 server" New topic
Author

Deploy a servlet project on Apache HTTP 2.0 server

sudipto shekhar
Ranch Hand

Joined: Apr 02, 2008
Posts: 823

How to deploy a servlet project on Apache HTTP 2.0 server?
What are the things needed that i have to do for the same?
I tried searching on the topic but did not come up with something relevent. So please help me.
Thank you.
[ November 06, 2008: Message edited by: Sudipto Shekhar ]

Regards, Sud.
SCJP 5 ScjpFAQ JLS
sudipto shekhar
Ranch Hand

Joined: Apr 02, 2008
Posts: 823

I have deployed a project on the server. in the wel-come page i have a button which calls the controller servlet. The welcome page works fine.When the button is clicked it says "404 error.file not found. the link appears to be broken." the project when deployed on tomcat 5.0 it works fine,but not when deployed on Apache HTTP 2.0 server.
I have configured the Apache httpd.conf file and set it as follows:

DocumentRoot "C:\Program Files\Apache Group\Apache2\MyWebPage"

and

<Directory "C:\Program Files\Apache Group\Apache2\MyWebPage">

where MyWebPage is the root dir of my project.

I have my servlet in MyWebPage\WEB-INF\classes\com\example\web

The index.html(welcome file) is under MyWebPage (context root)folder.]

what are rest of the settings i require?
Please help.

Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42919
    
  68
Apache httpd doesn't support Java web apps. You need to hook it up to Tomcat or some other servlet container. See http://tomcat.apache.org/connectors-doc/webserver_howto/apache.html for more information.
[ November 06, 2008: Message edited by: Ulf Dittmer ]
sudipto shekhar
Ranch Hand

Joined: Apr 02, 2008
Posts: 823

Yes i too was thinking the same.Ok i'll try out what you said. Thank you very much.


sudipto shekhar
Ranch Hand

Joined: Apr 02, 2008
Posts: 823

Using the Apache httpd 2.0 server i have set-up my own server at my work place and am hosting a site. I have got a domain name,bound to my ip from one of the service provider. But now that i know that that apache httpd 2.0 does not support JAVA, do you have some alternative ideas of a server which can serve my purpose?
[ November 06, 2008: Message edited by: Sudipto Shekhar ]
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42919
    
  68
There are any number of servlet containers - Tomcat, Resin, JBoss, ...

Most standard hosting plans do not support those, though - you'll need a Java hosting plan which will likely be more expensive. (Unless your plan gives you root access, of course, in which case you can install any of these.)
sudipto shekhar
Ranch Hand

Joined: Apr 02, 2008
Posts: 823

Originally posted by Ulf Dittmer:
(Unless your plan gives you root access, of course, in which case you can install any of these.)


Sorry as i am very new to all these please can you explain a little more of this to me?

Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42919
    
  68
Many inexpensive hosting plans will not give you root access, meaning you can only use whatever software is preinstalled by the provider. In that case, if no servlet container is installed, you can't add one later.

So you should check the feature list of your hosting company to see whether they provide Java web app support and/or root access.
sudipto shekhar
Ranch Hand

Joined: Apr 02, 2008
Posts: 823

ok i get it. Let me explain to you what i want to do.
I have an embedded server.I want a web-site through which i can access the embedded server.What my embedded server does is it takes the request from the user and do the processing. To provide this input i want a web-server through which the client can send requests to my embedded server. now my web-server would be using a .dll file which will be the driver for the embedded server,and no service provider will allow me to make system calls om their system.This is for what i require a web-server running at my place.So what do you think should be the probable choice?

Please help.
[ November 06, 2008: Message edited by: Sudipto Shekhar ]
sudipto shekhar
Ranch Hand

Joined: Apr 02, 2008
Posts: 823

Ulf please check your private messages.
sudipto shekhar
Ranch Hand

Joined: Apr 02, 2008
Posts: 823

Which server will help me hosting as well as support servlet-api? I am trying to figure it out, any help will be great.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42919
    
  68
What do you mean by "at my place" - your home machine? That's under your control, so you can do anything you want. If you're talking about a hosting setup that allows DLLs to be deployed, I have no idea if those exist. You may have to go for a dedicated machine for that.

The http://faq.javaranch.com/java/ServletsFaq#hosting has a list of Java hosting providers.
sudipto shekhar
Ranch Hand

Joined: Apr 02, 2008
Posts: 823

Yes, my own machine. That's exactly what i tried to say! I want my own server. So what should i do? Which software will i require to set-up my own server and that too which supports JAVA api. By using the apache http server set-up i was able to host my own web-site and it worked fine. When the domain name www.mylane.com was typed, it worked over the internet and the well-come page was displayed.But on click of a particular button,which called a servlet,it showed 404 error(because as you, said it does not support JAVA api). Now i want to replace this server with another which would fulfill the requirement and also support servlet api. I hope now you might have understood what i am trying to say and do.
[ November 06, 2008: Message edited by: Sudipto Shekhar ]
sudipto shekhar
Ranch Hand

Joined: Apr 02, 2008
Posts: 823

So can i use TOMCAT for my purpose? Will it help me create a server to host my website?


Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

Originally posted by Sudipto Shekhar:
So can i use TOMCAT for my purpose? Will it help me create a server to host my website?




Tomcat works as a standalone webserver and as a servlet container.
If you use it, you won't need Apache HTTPD.


Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
sudipto shekhar
Ranch Hand

Joined: Apr 02, 2008
Posts: 823

ok i installed tomcat on my machine.But i am unable to configure it.I can not bind it to my domain name! How do i configure tomcat now?
sudipto shekhar
Ranch Hand

Joined: Apr 02, 2008
Posts: 823

wait i found it, i hope so
sudipto shekhar
Ranch Hand

Joined: Apr 02, 2008
Posts: 823

no it did not work.the host name could not be resolved.
Any help how do i configure Tomcat 5.0..please
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42919
    
  68
I'm not sure what the "it" is that you tried and which didn't work, but getting a domain name to resolve to your machine has nothing to with Tomcat (or Apache httpd). It's a feature of DNS. You need to register your IP address (which must be static, not dynamic) with the registrar you're using for your domain name. The registrar will make sure it gets into the DNS system (which might take a few hours or even days).
sudipto shekhar
Ranch Hand

Joined: Apr 02, 2008
Posts: 823

Yes i do have a domain name.My ip is registered and the service provider has provided me with the domain name. After configuring tomcat when i typed www.mydomainname.com, the message was "host could not be resolved", which i think, was because i could not configure tomcat properly. So i asked a help regarding configuring tomcat, as a web host,any help....
[ November 06, 2008: Message edited by: Sudipto Shekhar ]
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42919
    
  68
That message has nothing to do with Tomcat; it occurs before the request is even sent. What happens when you do "nslookup www.mydomainname.com" - does it report the correct IP address? Can you ping the address?
sudipto shekhar
Ranch Hand

Joined: Apr 02, 2008
Posts: 823

ok how do i do "nslookup www.mydomainname.com"!

i did that! it says this web page is not availabe.
[ November 06, 2008: Message edited by: Sudipto Shekhar ]
sudipto shekhar
Ranch Hand

Joined: Apr 02, 2008
Posts: 823

Please tell me if at any point i am not able to explain any point to you...
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Deploy a servlet project on Apache HTTP 2.0 server