[Geoserver-users] Advice regarding HTTP Servers & GeoServer

Dear All

Please could somebody help with my query, either some advice on where to go
to get the information or the information itself!

I have my spatial data loaded in a PostGIS database and I want to install
MapServer, GeoServer, Deegree and MapGuide Open Source on the same windows
computer which would allow me to compare and contrast the products.

I thought that I would therefore install the latest version of Apache HTTP
server and run all of the products from the same Apache HTTP server.

What I am not sure about is:

1. I have gathered that GeoServer can be run using Apache Tomcat. How do I
configure GeoServer so that it is running from Apache Tomcat and not from
Jetty?

2. I have looked the Apache site, and the Apache Tomcat 6.0 contains its own
HTTP server internally. Therefore if I have already installed Apache HTTP
server, I will be have 2 HTTP servers installed. Can I link the Tomcat to
the independent installation of Apache HTTP server or can I use the HTTP
server bundled with the Tomcat as a HTTP server in its own right?

3. If I do install Apache and get GeoServer to run from it, how do I stop
Jetty starting up when I start Geoserver going?

Any help would be very much appreciated!

Kind Regards

John
Manchester, UK

Hi John,

Responses inline. I have pointed you at some docs that should help as
well. Let us know if anything is still unclear or if you have any
problems setting it up.

I couldn't find anything in the GeoServer docs on how to set this up.
Perhaps if all goes well you would be willing to help us out with a
quick how to? Perhaps I am getting ahead of myself :).

-Justin

John Roberts wrote:

Dear All

Please could somebody help with my query, either some advice on where to go
to get the information or the information itself!

I have my spatial data loaded in a PostGIS database and I want to install
MapServer, GeoServer, Deegree and MapGuide Open Source on the same windows
computer which would allow me to compare and contrast the products.

I thought that I would therefore install the latest version of Apache HTTP
server and run all of the products from the same Apache HTTP server.

What I am not sure about is:

1. I have gathered that GeoServer can be run using Apache Tomcat. How do I
configure GeoServer so that it is running from Apache Tomcat and not from
Jetty

Download the war install instead of the binary install. It should be
available in the place your found the binary install.

Assuming you already have tomcat installed you can just drop the
geoserver.war into your tomcat webapps folder and it should start.

2. I have looked the Apache site, and the Apache Tomcat 6.0 contains its own
HTTP server internally. Therefore if I have already installed Apache HTTP
server, I will be have 2 HTTP servers installed. Can I link the Tomcat to
the independent installation of Apache HTTP server or can I use the HTTP
server bundled with the Tomcat as a HTTP server in its own right?

You can install mod_jk in your apache httpd installation, and the
connector into tomcat. Then apache will forward requests to tomcat and
the two will talk to each other. Information on how to do this can be
found here:

http://tomcat.apache.org/connectors-doc/

3. If I do install Apache and get GeoServer to run from it, how do I stop
Jetty starting up when I start Geoserver going?

With the war download you wont have to worry about jetty.

Any help would be very much appreciated!

Kind Regards

John
Manchester, UK

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

!DSPAM:1004,45e836bd316491971556521!

--
Justin Deoliveira
The Open Planning Project
http://topp.openplans.org

Dear Justin

I am again hoping that I will be able to impose on your good nature (or
anybody else who might be able to help). I am afraid that I have got stuck
with trying to link Apache and Tomcat.

I have installed Apache 2.2.4 on my PC (I have Windows XP). This was easy, I
followed the installation wizard and installed Apache without problems. I
can start and stop the service and can access the index.html via
http://localhost. This is on Port 80.

I then installed Tomcat 5.5.20. Again this was straight forward. I followed
the installation wizard. I can start and stop the service and can access its
own index.jsp via http:locahost:8080. (on Port 8080 this time!).

I then follow the following instructions on linking Tomcat to Apache.
http://tomcat.apache.org/connectors-doc/generic_howto/quick.html

1. I put mod_jk.so in C:\Program Files\Apache Software
Foundation\Apache2.2\modules
2. I update httpd.conf as detailed on the web page.
3. I create the worker.properties file on put it in C:\Program Files\Apache
Software Foundation\Apache2.2\conf

However, when I then restart the Apache2 service, I get the following error
message:
'Windows could not start the Apache2 on Local Computer. For more
information, review the System Event Log. If this is a non-Microsoft
service, contact the service vendor, and refer to service-specific error
code 1.'

I had a look at C:\windows\EventSystem.log but couldn't find a entry that
corresponded to this.

If I comment out all the new entries in the httpd.conf file, the Apache2
service will restart. As soon as I put in the first line:
LoadModule jk_module modules/mod_jk.so

The Apache2 service refuses to restart and ends up being stopped.

If you have any comments or suggestions, I would be very grateful to receive
them.

Thank you very much.

Kind Regards

John
Manchester, UK

-----Original Message-----
From: Justin Deoliveira [mailto:jdeolive@anonymised.com]
Sent: 02 March 2007 15:57
To: John Roberts
Cc: geoserver-users@lists.sourceforge.net
Subject: Re: [Geoserver-users] Advice regarding HTTP Servers & GeoServer

Hi John,

Responses inline. I have pointed you at some docs that should help as
well. Let us know if anything is still unclear or if you have any
problems setting it up.

I couldn't find anything in the GeoServer docs on how to set this up.
Perhaps if all goes well you would be willing to help us out with a
quick how to? Perhaps I am getting ahead of myself :).

-Justin

John Roberts wrote:

Dear All

Please could somebody help with my query, either some advice on where to

go

to get the information or the information itself!

I have my spatial data loaded in a PostGIS database and I want to install
MapServer, GeoServer, Deegree and MapGuide Open Source on the same windows
computer which would allow me to compare and contrast the products.

I thought that I would therefore install the latest version of Apache HTTP
server and run all of the products from the same Apache HTTP server.

What I am not sure about is:

1. I have gathered that GeoServer can be run using Apache Tomcat. How do I
configure GeoServer so that it is running from Apache Tomcat and not from
Jetty

Download the war install instead of the binary install. It should be
available in the place your found the binary install.

Assuming you already have tomcat installed you can just drop the
geoserver.war into your tomcat webapps folder and it should start.

2. I have looked the Apache site, and the Apache Tomcat 6.0 contains its

own

HTTP server internally. Therefore if I have already installed Apache HTTP
server, I will be have 2 HTTP servers installed. Can I link the Tomcat to
the independent installation of Apache HTTP server or can I use the HTTP
server bundled with the Tomcat as a HTTP server in its own right?

You can install mod_jk in your apache httpd installation, and the
connector into tomcat. Then apache will forward requests to tomcat and
the two will talk to each other. Information on how to do this can be
found here:

http://tomcat.apache.org/connectors-doc/

3. If I do install Apache and get GeoServer to run from it, how do I stop
Jetty starting up when I start Geoserver going?

With the war download you wont have to worry about jetty.

Any help would be very much appreciated!

Kind Regards

John
Manchester, UK

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share

your

opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

!DSPAM:1004,45e836bd316491971556521!

--
Justin Deoliveira
The Open Planning Project
http://topp.openplans.org

Hi John,

You are running on windows correct? I think the problem is that you are
using the shared object file ( mod_jk.so ), when you should be using the
dll (mod_jk.so). The former being for unix systems, the latter being for
windows.

Let me know if that does the trick for you.

-Justin

John Roberts wrote:

Dear Justin

I am again hoping that I will be able to impose on your good nature (or
anybody else who might be able to help). I am afraid that I have got stuck
with trying to link Apache and Tomcat.

I have installed Apache 2.2.4 on my PC (I have Windows XP). This was easy, I
followed the installation wizard and installed Apache without problems. I
can start and stop the service and can access the index.html via
http://localhost. This is on Port 80.

I then installed Tomcat 5.5.20. Again this was straight forward. I followed
the installation wizard. I can start and stop the service and can access its
own index.jsp via http:locahost:8080. (on Port 8080 this time!).

I then follow the following instructions on linking Tomcat to Apache.
http://tomcat.apache.org/connectors-doc/generic_howto/quick.html

1. I put mod_jk.so in C:\Program Files\Apache Software
Foundation\Apache2.2\modules
2. I update httpd.conf as detailed on the web page.
3. I create the worker.properties file on put it in C:\Program Files\Apache
Software Foundation\Apache2.2\conf

However, when I then restart the Apache2 service, I get the following error
message:
'Windows could not start the Apache2 on Local Computer. For more
information, review the System Event Log. If this is a non-Microsoft
service, contact the service vendor, and refer to service-specific error
code 1.'

I had a look at C:\windows\EventSystem.log but couldn't find a entry that
corresponded to this.

If I comment out all the new entries in the httpd.conf file, the Apache2
service will restart. As soon as I put in the first line:
LoadModule jk_module modules/mod_jk.so

The Apache2 service refuses to restart and ends up being stopped.

If you have any comments or suggestions, I would be very grateful to receive
them.

Thank you very much.

Kind Regards

John
Manchester, UK

-----Original Message-----
From: Justin Deoliveira [mailto:jdeolive@anonymised.com]
Sent: 02 March 2007 15:57
To: John Roberts
Cc: geoserver-users@lists.sourceforge.net
Subject: Re: [Geoserver-users] Advice regarding HTTP Servers & GeoServer

Hi John,

Responses inline. I have pointed you at some docs that should help as
well. Let us know if anything is still unclear or if you have any
problems setting it up.

I couldn't find anything in the GeoServer docs on how to set this up.
Perhaps if all goes well you would be willing to help us out with a
quick how to? Perhaps I am getting ahead of myself :).

-Justin

John Roberts wrote:

Dear All

Please could somebody help with my query, either some advice on where to

go

to get the information or the information itself!

I have my spatial data loaded in a PostGIS database and I want to install
MapServer, GeoServer, Deegree and MapGuide Open Source on the same windows
computer which would allow me to compare and contrast the products.

I thought that I would therefore install the latest version of Apache HTTP
server and run all of the products from the same Apache HTTP server.

What I am not sure about is:

1. I have gathered that GeoServer can be run using Apache Tomcat. How do I
configure GeoServer so that it is running from Apache Tomcat and not from
Jetty

Download the war install instead of the binary install. It should be
available in the place your found the binary install.

Assuming you already have tomcat installed you can just drop the
geoserver.war into your tomcat webapps folder and it should start.

2. I have looked the Apache site, and the Apache Tomcat 6.0 contains its

own

HTTP server internally. Therefore if I have already installed Apache HTTP
server, I will be have 2 HTTP servers installed. Can I link the Tomcat to
the independent installation of Apache HTTP server or can I use the HTTP
server bundled with the Tomcat as a HTTP server in its own right?

You can install mod_jk in your apache httpd installation, and the
connector into tomcat. Then apache will forward requests to tomcat and
the two will talk to each other. Information on how to do this can be
found here:

http://tomcat.apache.org/connectors-doc/

3. If I do install Apache and get GeoServer to run from it, how do I stop
Jetty starting up when I start Geoserver going?

With the war download you wont have to worry about jetty.

Any help would be very much appreciated!

Kind Regards

John
Manchester, UK

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share

your

opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

--
Justin Deoliveira
The Open Planning Project
http://topp.openplans.org

!DSPAM:1004,45e9f100219831804284693!

--
Justin Deoliveira
The Open Planning Project
http://topp.openplans.org

John Roberts ha scritto:

Dear Justin

I am again hoping that I will be able to impose on your good nature (or
anybody else who might be able to help). I am afraid that I have got stuck
with trying to link Apache and Tomcat.

John, if you've having troubles with linking Tomcat and Apache, believe you're not the only one. In the place I worked before we simply gave up
trying to link them using mod_jk, and suggested customers to run Tomcat directly.
If for some reason they refused and wanted to have Apache on the front end, we simply installed mod_proxy that allows to proxy another web
server. This way Apache acted as a reverse proxy for Tomcat.

I'd say you'd probably want to do the same, use Tomcat directly if
you don't have any specific reason for not doing so, and use mod_proxy
if you really need to have Apache around and hide Tomcat.

Cheers
Andrea

Dear Justin

You hit the nail on the head. I was using the wrong mod_jk.so file though it
was the previous win32 version that I had downloaded and hence was causing
the error. I believe that I have now installed GeoServer with Tomcat and I
am using the GeoServer via Apache! The method I have used is below and I
still have a couple of queries which hopefully you might be able to help
with.

1. I installed Apache version 2.2.4 from a windows installer file (.msi)
which I installed to work for all users off Port 80. I am assuming
everything is correct as http://localhost and http://localhost:80 are both
returning the 'It works!' index.html file.

2. I installed Tomcat 5.5.20 using the windows .exe file
apache-tomcat-5.5.20.exe. This runs via port 8080. I am assuming that
everything is correct as http://localhost:8080 returns the index.jsp page in
C:\Program Files\Apache Software Foundation\Tomcat 5.5\webapps\ROOT.

3. I turned off the Apache Tomcat service and I installed GeoServer with
Tomcat by downloading the geoserver.war file and placing it in the
C:\Program Files\Apache Software Foundation\Tomcat 5.5\webapps folder. When
I started the Tomcat service, the geoserver.war file unpacked itself as a
geoserver folder within the webapps folder. I am assuming that everything is
correct as http://localhost:8080/geoserver returns the 'Welcome to
Geoserver' page.

4. I linked Apache Tomcat to Apache by:
a. downloading the mod_jk-apache-2.2.3.so file from the Apache Tomcat site.
This I renamed mod_jk.so and put in the Apache module folder (C:\Program
Files\Apache Software Foundation\Apache2.2\modules)
b. I updated the Apache httpd.conf file (C:\Program Files\Apache Software
Foundation\Apache2.2\conf\) by putting in the code detailed below at the end
of the file.
C. I created a text file 'worker.properties' which I placed in C:\Program
Files\Apache Software Foundation\Apache2.2\conf\. I attach a copy of the
workers.properties file below.
d. I restarted the Apache service.

I am assuming that everything is correct as http://localhost/geoserver
returns the 'Welcome to Geoserver' page. I think that this means that I am
now going through apache to get to geoserver. Is this correct?

The queries I have are as follows:

1. The Worker1 in the worker.properties file is redirecting the /geoserver
url's to the webapps folder which works fine for geoserver. However, the
redirection of the *.jsp file is to the webapps folder. However the
index.jsp file for tomcat is held in webapps\ROOT. Therefore it is not
picking up the index.jsp file. It will pick up an index.jsp file if I create
a copy in the webapps folder. Is there a setting which can be changed to
redirect the *.jsp files to webapps\ROOT?

2. I still have two services running and I suspect that running geoserver
through apache probably slows things down. Therefore is there any advantage
of having all requests coming in via apache? Does port 8080 still have to be
external facing? I am afraid that my knowledge of networking is limited and
hence I don't have a good understanding of the finer implications of port
use.

3. I have detailed notes of what I have done. What would be the best way to
get them to other interested parties?

4. What is a .war file? (very simple this one!)

5. My computer seems to be slowing down sometimes with the two services
running (it is a desktop PC). Is this normal?

Kind Regards & Many Thanks

John

TEXT TO ADD TO httpd.conf file
----------------------------------------------------------------------------
-------------------------
# Load mod_jk module
LoadModule jk_module modules/mod_jk.so
  # Where to find workers.properties
JkWorkersFile conf/workers.properties
  # Where to put jk shared memory
JkShmFile logs/mod_jk.shm
  # Where to put jk logs
JkLogFile logs/mod_jk.log
  # Set the jk log level [debug/error/info]
JkLogLevel info
  # Select the timestamp log format
JkLogStampFormat "[%a %b %d %H:%M:%S %Y] "
  # Send everything for context /geoserver to worker named worker1 (ajp13)
JkMount /geoserver* worker1
  # Send all .jsp files to worker1
JkMount /*jsp worker1
----------------------------------------------------------------------------
---------------------------

workers.properties file
----------------------------------------------------------------------------
----------------------------
# Define 1 real worker using ajp13
  worker.list=worker1
  # Set properties for worker1 (ajp13)
  worker.worker1.type=ajp13
  worker.worker1.host=localhost
  worker.worker1.port=8009
----------------------------------------------------------------------------
--------------------------

Hi John,

Sure sounds like you are making great progress!! Comments inline.

I am assuming that everything is correct as http://localhost/geoserver
returns the 'Welcome to Geoserver' page. I think that this means that I am
now going through apache to get to geoserver. Is this correct?

The queries I have are as follows:

1. The Worker1 in the worker.properties file is redirecting the /geoserver
url's to the webapps folder which works fine for geoserver. However, the
redirection of the *.jsp file is to the webapps folder. However the
index.jsp file for tomcat is held in webapps\ROOT. Therefore it is not
picking up the index.jsp file. It will pick up an index.jsp file if I create
a copy in the webapps folder. Is there a setting which can be changed to
redirect the *.jsp files to webapps\ROOT?

Hmm, interesting. When I get some time to try out your instructions I
will take a crack at this one, no idea off the top of my head though...

2. I still have two services running and I suspect that running geoserver
through apache probably slows things down. Therefore is there any advantage
of having all requests coming in via apache? Does port 8080 still have to be
external facing? I am afraid that my knowledge of networking is limited and
hence I don't have a good understanding of the finer implications of port
use.

As Andrea stated, the only real advantage to running the connector is if
you already have apache serving some other apps, and you can not run
tomcat standalone, the most common reason being that you can only have
web traffic running over 8080.

3. I have detailed notes of what I have done. What would be the best way to
get them to other interested parties?

Why don't you file a jira task for this.

And attach your notes to it. Go ahead and schedule it to me and I will
take care of it. If you don't want to set yourself up a jira account and
all that you can just email the materials to me.

We much appreciate the contribution!!

4. What is a .war file? (very simple this one!)

It stands for "web archive". Is the standard way to ship java based web
applications. It is really just a jar ( java archive ) with a special
file (web.xml) called the web application descriptor.

What you can do with tomcat is just copy the war into the webapps
folder, and tomcat will automatically unarchive it for you and deploy
the application.

5. My computer seems to be slowing down sometimes with the two services
running (it is a desktop PC). Is this normal?

Hmm, this could be dependent on a lot of things... Do you have lots of
users that are hitting these services? I would say generally yes, any
service that you run is going to take up resources on your machine. And
depending how active the services are, the more resources they will
require... However if they are not all that active but are completely
hogging resources then it may be another problem.

Kind Regards & Many Thanks

John

TEXT TO ADD TO httpd.conf file
----------------------------------------------------------------------------
-------------------------
# Load mod_jk module
LoadModule jk_module modules/mod_jk.so
  # Where to find workers.properties
JkWorkersFile conf/workers.properties
  # Where to put jk shared memory
JkShmFile logs/mod_jk.shm
  # Where to put jk logs
JkLogFile logs/mod_jk.log
  # Set the jk log level [debug/error/info]
JkLogLevel info
  # Select the timestamp log format
JkLogStampFormat "[%a %b %d %H:%M:%S %Y] "
  # Send everything for context /geoserver to worker named worker1 (ajp13)
JkMount /geoserver* worker1
  # Send all .jsp files to worker1
JkMount /*jsp worker1
----------------------------------------------------------------------------
---------------------------

workers.properties file
----------------------------------------------------------------------------
----------------------------
# Define 1 real worker using ajp13
  worker.list=worker1
  # Set properties for worker1 (ajp13)
  worker.worker1.type=ajp13
  worker.worker1.host=localhost
  worker.worker1.port=8009
----------------------------------------------------------------------------
--------------------------

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

!DSPAM:1004,45eb28ad8141460912952!

--
Justin Deoliveira
The Open Planning Project
http://topp.openplans.org

John,

You've hit the specific knowledge gap that separates sysadmins from the rest of the world. If you have a consistent way of teaching people not just *how* to deploy tomcat, but actually communicating to relative networking novices *WHAT* it is that they've done (the significance of ports, 'localhost' vs. local vs. public-facing IPs, tomcat+mod_jk+ajp+JkMount paths) then you have my vote for president. Good job picking up what you've picked up so far.

1. The Worker1 in the worker.properties file is redirecting the /geoserver
url's to the webapps folder which works fine for geoserver. However, the
redirection of the *.jsp file is to the webapps folder. However the
index.jsp file for tomcat is held in webapps\ROOT. Therefore it is not
picking up the index.jsp file. It will pick up an index.jsp file if I create
a copy in the webapps folder. Is there a setting which can be changed to
redirect the *.jsp files to webapps\ROOT?

The problem is that you're catching ALL '*.jsp' patterns and treating them all identically. You don't want to do this. Simple use the "/geoserver" JkMount line, and remove the "*.jsp" one. Or at the least, put the "*.jsp" one last, so it doesn't interfere with your earlier ones.

...

4. What is a .war file? (very simple this one!)

A .war file is a special kind of .zip file. You can open it with winzip/pkzip or any other archive program. It includes a special directory "META-INF" and a special directory "WEB-INF". Inside those directories are special files that tell any standards-compliant J2EE application container (tomcat is one, but so is Weblogic, Websphere, iPlanet, resin, jetty, etc.) exactly how to take the program contained in the .war file and deploy it into a servlet container, linking an actual program to a specific web URL (like '/geoserver').

The .war file format is defined in a specification put out by Sun Microsystems, and by now it's probably designed by a committee as a "Java Specification Request" (JSR) with a number. I think the latest revision of the spec that includes the .war file standard is JSR-154.

5. My computer seems to be slowing down sometimes with the two services
running (it is a desktop PC). Is this normal?

Yep. It's probably not so much geoserver as it is Apache, Tomcat and all the libraries that they depend on. I run geoserver on linux with a dual-processor Xeon 2.6 Ghz box, and when I'm running tomcat+geoserver it's slightly less snappy. I have a co-worker who runs tomcat+geoserver on a single-processor P4 3Ghz windows XP machine and you can really feel it on that machine when it's starting up or handling a big request.

--saul