top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

What is the difference between Apache server and Tomcat server ?

+3 votes
403 views
What is the difference between Apache server and Tomcat server ?
posted Apr 10, 2014 by Prasad

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

0 votes

Apache is a web server written in portable C (when people say "Apache", they usually mean Apache HTTPD.) It mostly serves static content by itself, but there are many add-on modules (some of which come with Apache itself) that let it modify the content and also serve dynamic content written in Perl, PHP, Python, Ruby, or other languages.

Tomcat is primarily a servlet/JSP container. It's written in Java. It can serve static content, too, but its main purpose is to host servlets and JSPs. Although it's possible to get Tomcat to run Perl scripts and the like, you wouldn't use Tomcat unless most of your content was Java.

So in summary Apache is an HTTP Server, serving HTTP. Tomcat is a Servlet and JSP Server serving Java technologies.

answer Apr 10, 2014 by Salil Agrawal
Similar Questions
+1 vote

I am using tomcat 7.0.42 and deployed in CentOs . When i start the server i am geting below log in my console .....

Aug 31, 2013 10:37:59 PM org.apache.catalina.core.AprLifecycleListener init
INFO: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path:
/xtd/ser/installation/jdk1.7.0_25/jre/lib/amd64/server:/xtd/ser/installation/jdk1.7.0_25/jre/lib/amd64:/xtd/ser/installation/jdk1.7.0_25/jre/../lib/amd64:/usr/java/jdk1.6.0_45/jre/lib/amd64/server:/usr/java/jdk1.6.0_45/jre/lib/amd64:/usr/java/jdk1.6.0_45/jre/../lib/amd64:/usr/java/packages/lib/amd64:/usr/lib64:/lib64:/lib:/usr/lib
Aug 31, 2013 10:37:59 PM org.apache.coyote.AbstractProtocol init INFO: Initializing ProtocolHandler ["http-bio-8080"]
Aug 31, 2013 10:37:59 PM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["ajp-bio-8009"]
Aug 31, 2013 10:37:59 PM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 730 ms
Aug 31, 2013 10:37:59 PM org.apache.catalina.core.StandardService startInternal
INFO: Starting service Catalina
Aug 31, 2013 10:37:59 PM org.apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet Engine: Apache Tomcat/7.0.42
Aug 31, 2013 10:38:00 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["http-bio-8080"]
Aug 31, 2013 10:38:00 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["ajp-bio-8009"]
Aug 31, 2013 10:38:00 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 370 ms

BUT WHEN I AM OPEING THE BROWSER i am getting Unable to connect. I am not sure my server is started or not ? Please suggest what could be the problem?

+1 vote

We have a set up like Apahce (80,443) redirects the request to Tomcat (8080) using mod_jk.

The new requirement is to route the request from the same apache to another tomcat (8090). Hence I made the different config file for apache with different ports (86,4444) and different worker for mod_jk which routes the request to tomcat.

Now the issue is when I hit the url http://:86 and after providing the credentials, it is redirecting to https://:86 and throwing the below error.

Error in browser:

Secure Connection Failed

An error occurred during a connection to x.x.x.x:86. SSL received a record that exceeded the maximum permissible length. (Error code: ssl_error_rx_record_too_long)

Error in logs:

"x16x03x01" 501

[Thu Jan 08 08:22:46 2015] [debug] ssl_engine_io.c(1523): OpenSSL: I/O error, 11 bytes expected to read on BIO#1bf568 [mem: 1f3930]
[Thu Jan 08 08:22:46 2015] [debug] ssl_engine_kernel.c(1806): OpenSSL: Exit: error in SSLv2/v3 read client hello A
[Thu Jan 08 08:22:46 2015] [info] (70014)End of file found: SSL handshake interrupted by system [Hint: Stop button pressed in browser?!]
[Thu Jan 08 08:22:46 2015] [info] Connection to child 3 closed with abortive shutdown(server pritoolvca1.sw.ericsson.se:443 [2], client 153.88.164.216)
[Thu Jan 08 08:23:53 2015] [error] [client 172.17.136.153] Invalid method in request x16x03x01

Could you please suggest where it might went wrong and the way forward..

+3 votes

I have a requirement where the tomcat load has to be managed by tuning the following parameters.

--> Limit the number of user requests at Apache level that are routed to Tomcat server.
--> Track the number of processed requests and the requests that are queued at Apache level.

Any suggestions?

0 votes

I am trying to find out through registry checking whether or not Apache Tomcat 9.0.8 is already installed or not. If the below registry is not there, then my program installs Apache Tomcat 9.0.8 installer otherwise it moves on to other installation and completes. It's kind of prerequisite check program.

HKEY_LOCAL_MACHINESOFTWAREApache Software FoundationTomcat9.0Tomcat9

However, everytime program just proceeds to install Tomcat despite it is already installed? Am I checking wrong registry?

+2 votes

I have a domain domain.com that points to a server. Now I have a subdomain sub.domain.com that points to another server that has Apache running and Tomcat. I want this subdomain to point to a application deployed on the Tomcat instance through ajp.

I have configured the following in httpd.conf:

   ServerName sub.domain.com 
   ProxyRequests Off
   ProxyPreserveHost On  
   Order deny,allow Allow from all  
   ProxyPass / ajp://localhost:8009/ 
   ProxyPassReverse / ajp://localhost:8009/   

and in Tomcats server.xml:

But when I go to sub.domain.com the url changes to otherdomain.com and shows me a php website running in Apache and declared as following in httpd.conf:

 DocumentRoot /var/www/html/otherdomain.com 
 ServerName otherdomain.com 
 ServerAlias www.otherdomain.com 

I only get it to work when I change the port in the sub.domain.com virtual host declaration to for example 8001. Then when I go to sub.domain.com:8001 it shows my tomcat application (ROOT.war) as expected.

So my question is: what could be going wrong that it doesn't work with the default port 80? I can't find any configuration that is causing this, but I'm probably missing something or is my virtual host configuration wrong?

...