Re: [Geoserver-users] Quick installation script for GeoServer

2020-07-21 Thread Jody Garnett
I can try, the web.xml is the driving directions for geoserver, indicating
parameters that can be used to control how it functions.

Each application server, tomcat in this case, has different ways for
administrators to set these parameters. Some like websphere using a GUI,
tomcat uses a file called *conf/catalina/localhost/geoserver.xml *
The advantage of doing it this way is that you can update the war at
anypoint without losing your configuration.

The actual details are:
- three parameters, as documented in

different

places 
- Tomcat let's you define parameters, the override="false" prevents web.xml
from changing this value (which I found an odd way of thinking about it)

GeoServer does its best to let you define these kind of settings three
different ways
 (so
you will find lots of different examples with a web search)
1. As environment variables (handy if you are running a docker environment
and that is all you can control)
2. As startup parameters (useful if you want to use tomcat setenv.sh to
manage startup options)
3. Using these web parameters (either in your application server as above)
or by directly editing web.xml


--
Jody Garnett


On Mon, 20 Jul 2020 at 12:10, Russ Hore  wrote:

> Thanks Jody.
>
> Can you clarify the first bit about geoserver.xml
>
> I am not well versed in Tomcat
>
> On 20 Jul 2020, at 19:05, Jody Garnett  wrote:
>
> Small feedback for this step:
>
> #
> ## Make Geoserver point to /data/
> #
> # Uncomment DATA_DIR and point it to /data/
> #
> vi /var/lib/tomcat9/webapps/geoserver/WEB-INF/web.xml
>
>
> Provide a conf/catalina/localhost/geoserver.xml file to control context
> variables (rather than adjust web.xml defaults):
>
> 
>   
>override="false"/>
>override="false"/>
> 
>
>
> I usually separate out the tilecache (no need to backup), but you can do
> what you like :)
> --
> Jody Garnett
>
>
> On Mon, 20 Jul 2020 at 01:28, Russ Hore  wrote:
>
>> Whilst investigating performance improvements to my GeoServer
>> installation I have been installing it quite a few times. To make things
>> faster, I developed a script to automate most of the basic stuff I needed
>> from a clean install of Ubuntu 20
>> Just in case it is of any use to others I post it here.
>> It might not be the tidies scripting and I run it as root (I know thats
>> not ideal and feel free to change it, but it is a local test server)
>>
>> I always create a folder /data/ and usually run Apache as the front end
>> to terminate SSL and provide authentication.
>>
>> Russ
>>
>> #!/bin/bash
>> #
>> #build_geoserver - Automates most of the tasks of installing
>> Geoserver and PostgreSQL
>> #
>> #Copyright Russ Hore, 2010, All Rights Reserved
>> #
>> #This script is free for use: you can redistribute it and/or modify
>> #it under the terms of the GNU General Public License as published by
>> #the Free Software Foundation, either version 3 of the License, or
>> #(at your option) any later version.
>> #
>> #This program is distributed in the hope that it will be useful,
>> #but WITHOUT ANY WARRANTY; without even the implied warranty of
>> #MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
>> #GNU General Public License for more details.
>> #
>> #
>> #
>> # Do an update and clean up before continuing
>> apt-get update --assume-yes
>> apt-get upgrade --assume-yes
>> apt-get dist-upgrade --assume-yes
>> apt autoremove --assume-yes
>>
>>
>> #
>> # Install Tomcat 9
>> apt-get install tomcat9 --assume-yes
>> apt-get install tomcat9-admin --assume-yes
>> apt-get install tomcat9-common --assume-yes
>> apt-get install tomcat9-user --assume-yes
>>
>> #
>> # Install GDAL utilities
>> apt-get install gdal-bin --assume-yes
>> apt-get install gdal-data --assume-yes
>> apt-get install python-gdal --assume-yes
>>
>> #
>> # Install Apache2
>> apt-get install apache2 --assume-yes
>>
>> #
>> # Install PHP
>> apt-get install php7.4 --assume-yes
>> apt-get install php7.4-common --assume-yes
>> apt-get install php7.4-curl --assume-yes
>> apt-get install php7.4-gd --assume-yes
>> apt-get install php7.4-json --assume-yes
>> apt-get install php7.4-pgsql --assume-yes
>> apt-get install php7.4-xml --assume-yes
>>
>> #
>> # Install CertBot to 

Re: [Geoserver-users] Quick installation script for GeoServer

2020-07-20 Thread Russ Hore
Thanks Jody.

Can you clarify the first bit about geoserver.xml

I am not well versed in Tomcat

> On 20 Jul 2020, at 19:05, Jody Garnett  wrote:
> 
> Small feedback for this step:
> 
> #
> ## Make Geoserver point to /data/
> #
> # Uncomment DATA_DIR and point it to /data/
> #
> vi /var/lib/tomcat9/webapps/geoserver/WEB-INF/web.xml
> 
> Provide a conf/catalina/localhost/geoserver.xml file to control context 
> variables (rather than adjust web.xml defaults):
> 
> 
>   
>override="false"/>
>override="false"/>
> 
> 
> I usually separate out the tilecache (no need to backup), but you can do what 
> you like :)
> --
> Jody Garnett
> 
> 
> On Mon, 20 Jul 2020 at 01:28, Russ Hore  > wrote:
> Whilst investigating performance improvements to my GeoServer installation I 
> have been installing it quite a few times. To make things faster, I developed 
> a script to automate most of the basic stuff I needed from a clean install of 
> Ubuntu 20
> Just in case it is of any use to others I post it here.
> It might not be the tidies scripting and I run it as root (I know thats not 
> ideal and feel free to change it, but it is a local test server)
> 
> I always create a folder /data/ and usually run Apache as the front end to 
> terminate SSL and provide authentication.
> 
> Russ
> 
> #!/bin/bash
> #
> #build_geoserver - Automates most of the tasks of installing Geoserver 
> and PostgreSQL
> #
> #Copyright Russ Hore, 2010, All Rights Reserved
> #
> #This script is free for use: you can redistribute it and/or modify
> #it under the terms of the GNU General Public License as published by
> #the Free Software Foundation, either version 3 of the License, or
> #(at your option) any later version.
> #
> #This program is distributed in the hope that it will be useful,
> #but WITHOUT ANY WARRANTY; without even the implied warranty of
> #MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> #GNU General Public License for more details.
> #
> #
> #
> # Do an update and clean up before continuing
> apt-get update --assume-yes
> apt-get upgrade --assume-yes
> apt-get dist-upgrade --assume-yes
> apt autoremove --assume-yes
> 
> 
> #
> # Install Tomcat 9
> apt-get install tomcat9 --assume-yes
> apt-get install tomcat9-admin --assume-yes
> apt-get install tomcat9-common --assume-yes
> apt-get install tomcat9-user --assume-yes
> 
> #
> # Install GDAL utilities
> apt-get install gdal-bin --assume-yes
> apt-get install gdal-data --assume-yes
> apt-get install python-gdal --assume-yes
> 
> #
> # Install Apache2
> apt-get install apache2 --assume-yes
> 
> #
> # Install PHP
> apt-get install php7.4 --assume-yes
> apt-get install php7.4-common --assume-yes
> apt-get install php7.4-curl --assume-yes
> apt-get install php7.4-gd --assume-yes
> apt-get install php7.4-json --assume-yes
> apt-get install php7.4-pgsql --assume-yes
> apt-get install php7.4-xml --assume-yes
> 
> #
> # Install CertBot to use LetsEncrypt certificates for SSL
> apt-get install certbot --assume-yes
> 
> #
> # Unzip is always useful
> apt-get install unzip --assume-yes
> 
> #
> # Install Geoserver
> # NB Need to check for the latest version
> #
> ## Now install Geoserver 2.17.1
> #
> # 1) Get the WAR file
> wget 
> "http://sourceforge.net/projects/geoserver/files/GeoServer/2.17.1/geoserver-2.17.1-war.zip
>  
> "
> # 2) Create a directory to hold the zip file
> mkdir GS2.17.1
> # 3) Cop yhte zip file to the directory
> mv geoserver-2.17.1-war.zip GS2.17.1
> # 4) Change into the directory and unzxip the file
> cd GS2.17.1
> unzip geoserver-2.17.1-war.zip
> # 5) Stop tomcat whilst we copy the war file in (I know you don't need to but 
> why not?)
> service tomcat9 stop
> # 6) Copy the war file to the Tomcat web apps directory
> cp geoserver.war /var/lib/tomcat9/webapps/
> # 7) Re-start Tomcat
> service tomcat9 start
> 
> #
> ## Now configure Geoserver 2.17.1
> #
> # I always create a data folder at / to hold all the GeoServer stuff
> mkdir /data/
> chown tomcat:tomcat /data/
> 
> #
> ## Need to make 

Re: [Geoserver-users] Quick installation script for GeoServer

2020-07-20 Thread Jody Garnett
Small feedback for this step:

#
## Make Geoserver point to /data/
#
# Uncomment DATA_DIR and point it to /data/
#
vi /var/lib/tomcat9/webapps/geoserver/WEB-INF/web.xml


Provide a conf/catalina/localhost/geoserver.xml file to control context
variables (rather than adjust web.xml defaults):


  
  
  



I usually separate out the tilecache (no need to backup), but you can do
what you like :)
--
Jody Garnett


On Mon, 20 Jul 2020 at 01:28, Russ Hore  wrote:

> Whilst investigating performance improvements to my GeoServer installation
> I have been installing it quite a few times. To make things faster, I
> developed a script to automate most of the basic stuff I needed from a
> clean install of Ubuntu 20
> Just in case it is of any use to others I post it here.
> It might not be the tidies scripting and I run it as root (I know thats
> not ideal and feel free to change it, but it is a local test server)
>
> I always create a folder /data/ and usually run Apache as the front end to
> terminate SSL and provide authentication.
>
> Russ
>
> #!/bin/bash
> #
> #build_geoserver - Automates most of the tasks of installing Geoserver
> and PostgreSQL
> #
> #Copyright Russ Hore, 2010, All Rights Reserved
> #
> #This script is free for use: you can redistribute it and/or modify
> #it under the terms of the GNU General Public License as published by
> #the Free Software Foundation, either version 3 of the License, or
> #(at your option) any later version.
> #
> #This program is distributed in the hope that it will be useful,
> #but WITHOUT ANY WARRANTY; without even the implied warranty of
> #MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> #GNU General Public License for more details.
> #
> #
> #
> # Do an update and clean up before continuing
> apt-get update --assume-yes
> apt-get upgrade --assume-yes
> apt-get dist-upgrade --assume-yes
> apt autoremove --assume-yes
>
>
> #
> # Install Tomcat 9
> apt-get install tomcat9 --assume-yes
> apt-get install tomcat9-admin --assume-yes
> apt-get install tomcat9-common --assume-yes
> apt-get install tomcat9-user --assume-yes
>
> #
> # Install GDAL utilities
> apt-get install gdal-bin --assume-yes
> apt-get install gdal-data --assume-yes
> apt-get install python-gdal --assume-yes
>
> #
> # Install Apache2
> apt-get install apache2 --assume-yes
>
> #
> # Install PHP
> apt-get install php7.4 --assume-yes
> apt-get install php7.4-common --assume-yes
> apt-get install php7.4-curl --assume-yes
> apt-get install php7.4-gd --assume-yes
> apt-get install php7.4-json --assume-yes
> apt-get install php7.4-pgsql --assume-yes
> apt-get install php7.4-xml --assume-yes
>
> #
> # Install CertBot to use LetsEncrypt certificates for SSL
> apt-get install certbot --assume-yes
>
> #
> # Unzip is always useful
> apt-get install unzip --assume-yes
>
> #
> # Install Geoserver
> # NB Need to check for the latest version
> #
> ## Now install Geoserver 2.17.1
> #
> # 1) Get the WAR file
> wget "
> http://sourceforge.net/projects/geoserver/files/GeoServer/2.17.1/geoserver-2.17.1-war.zip
> "
> # 2) Create a directory to hold the zip file
> mkdir GS2.17.1
> # 3) Cop yhte zip file to the directory
> mv geoserver-2.17.1-war.zip GS2.17.1
> # 4) Change into the directory and unzxip the file
> cd GS2.17.1
> unzip geoserver-2.17.1-war.zip
> # 5) Stop tomcat whilst we copy the war file in (I know you don't need to
> but why not?)
> service tomcat9 stop
> # 6) Copy the war file to the Tomcat web apps directory
> cp geoserver.war /var/lib/tomcat9/webapps/
> # 7) Re-start Tomcat
> service tomcat9 start
>
> #
> ## Now configure Geoserver 2.17.1
> #
> # I always create a data folder at / to hold all the GeoServer stuff
> mkdir /data/
> chown tomcat:tomcat /data/
>
> #
> ## Need to make /data/ readable by Tomcat9
> #
> # Edit the following file and add  the follwoing line unere the #
> Secunrity section
> # ReadWritePaths=/data/
> #
> #
> vi /lib/systemd/system/tomcat9.service
>
> #
> ## Make Geoserver point to /data/
> #
> # Uncomment DATA_DIR and point it to /data/

[Geoserver-users] Quick installation script for GeoServer

2020-07-20 Thread Russ Hore
Whilst investigating performance improvements to my GeoServer installation I 
have been installing it quite a few times. To make things faster, I developed a 
script to automate most of the basic stuff I needed from a clean install of 
Ubuntu 20
Just in case it is of any use to others I post it here.
It might not be the tidies scripting and I run it as root (I know thats not 
ideal and feel free to change it, but it is a local test server)

I always create a folder /data/ and usually run Apache as the front end to 
terminate SSL and provide authentication.

Russ

#!/bin/bash
#
#build_geoserver - Automates most of the tasks of installing Geoserver and 
PostgreSQL
#
#Copyright Russ Hore, 2010, All Rights Reserved
#
#This script is free for use: you can redistribute it and/or modify
#it under the terms of the GNU General Public License as published by
#the Free Software Foundation, either version 3 of the License, or
#(at your option) any later version.
#
#This program is distributed in the hope that it will be useful,
#but WITHOUT ANY WARRANTY; without even the implied warranty of
#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#GNU General Public License for more details.
#
#
#
# Do an update and clean up before continuing
apt-get update --assume-yes
apt-get upgrade --assume-yes
apt-get dist-upgrade --assume-yes
apt autoremove --assume-yes


#
# Install Tomcat 9
apt-get install tomcat9 --assume-yes
apt-get install tomcat9-admin --assume-yes
apt-get install tomcat9-common --assume-yes
apt-get install tomcat9-user --assume-yes

#
# Install GDAL utilities
apt-get install gdal-bin --assume-yes
apt-get install gdal-data --assume-yes
apt-get install python-gdal --assume-yes

#
# Install Apache2
apt-get install apache2 --assume-yes

#
# Install PHP
apt-get install php7.4 --assume-yes
apt-get install php7.4-common --assume-yes
apt-get install php7.4-curl --assume-yes
apt-get install php7.4-gd --assume-yes
apt-get install php7.4-json --assume-yes
apt-get install php7.4-pgsql --assume-yes
apt-get install php7.4-xml --assume-yes

#
# Install CertBot to use LetsEncrypt certificates for SSL
apt-get install certbot --assume-yes

#
# Unzip is always useful
apt-get install unzip --assume-yes

#
# Install Geoserver
# NB Need to check for the latest version
#
## Now install Geoserver 2.17.1
#
# 1) Get the WAR file
wget 
"http://sourceforge.net/projects/geoserver/files/GeoServer/2.17.1/geoserver-2.17.1-war.zip;
# 2) Create a directory to hold the zip file
mkdir GS2.17.1
# 3) Cop yhte zip file to the directory
mv geoserver-2.17.1-war.zip GS2.17.1
# 4) Change into the directory and unzxip the file
cd GS2.17.1
unzip geoserver-2.17.1-war.zip
# 5) Stop tomcat whilst we copy the war file in (I know you don't need to but 
why not?)
service tomcat9 stop
# 6) Copy the war file to the Tomcat web apps directory
cp geoserver.war /var/lib/tomcat9/webapps/
# 7) Re-start Tomcat
service tomcat9 start

#
## Now configure Geoserver 2.17.1
#
# I always create a data folder at / to hold all the GeoServer stuff
mkdir /data/
chown tomcat:tomcat /data/

#
## Need to make /data/ readable by Tomcat9
#
# Edit the following file and add  the follwoing line unere the # Secunrity 
section
# ReadWritePaths=/data/
#
#
vi /lib/systemd/system/tomcat9.service 

#
## Make Geoserver point to /data/
#
# Uncomment DATA_DIR and point it to /data/
#
vi /var/lib/tomcat9/webapps/geoserver/WEB-INF/web.xml

# Re-start Tomcat
systemctl restart tomcat9
systemctl daemon-reload

#
#
## Install PostgreSQL with PostGIS
# CHECK the latest version fo PostgreSQLL and PostGIS
#
apt-get install postgresql-12-pgrouting --assume-yes
apt-get install postgresql-12-postgis-3 --assume-yes
apt-get install postgresql-12-postgis-3-scripts --assume-yes

# Install the OpenStreetMap to PostgreSQL utilities
apt-get install osm2pgsql --assume-yes

#