Geodroplet: Difference between revisions
From charlesreid1
No edit summary |
No edit summary |
||
| (22 intermediate revisions by the same user not shown) | |||
| Line 1: | Line 1: | ||
My Geodroplet adventure: | |||
* Part 1 - this page | |||
* Part 2 - [[Geoserver]] | |||
* Part 3 - [[Geoserver OilGas]] | |||
=Procedure= | =Procedure= | ||
==Initial Setup of Droplet== | |||
Add non-root user account | Create droplet via Digital Ocean page | ||
Follow instructions to log into droplet as root | |||
Add non-root user account: | |||
<pre> | |||
useradd -m charles | |||
</pre> | |||
Give non-root user account sudo abilities | Give non-root user account sudo abilities | ||
* add to root group: <code>usermod -G root charles</code> | * add to root group: <code>usermod -a -G root charles</code> | ||
* make sudoer: <code>sudo adduser charles sudo</code> | * make sudoer: <code>sudo adduser charles sudo</code> | ||
| Line 15: | Line 30: | ||
* <code>sudo vim /etc/ssh/sshd_config</code> | * <code>sudo vim /etc/ssh/sshd_config</code> | ||
* change <code>PermitRootLogin yes</code> to <code>PermitRootLogin no</code> | * change <code>PermitRootLogin yes</code> to <code>PermitRootLogin no</code> | ||
Log in from another window (just in case) | |||
Restart ssh: <code>/etc/init.d/sshd restart</code> | |||
Change user shell using <code>sudo usermod -s /bin/bash charles</code> | |||
==MySQL Setup== | |||
Based on the startup message, ran <code>mysql_secure_installation</code>. | |||
==Prep Aptitude== | |||
<source lang="bash"> | |||
sudo apt-get -y update | |||
sudo apt-get install -y build-essential | |||
sudo apt-get install -y python | |||
sudo apt-get install -y wget | |||
sudo apt-get install -y unzip | |||
sudo apt-get -y autoremove | |||
</source> | |||
==Tomcat== | |||
A nice guide to installing Tomcat by Digital Ocean: https://www.digitalocean.com/community/tutorials/how-to-install-apache-tomcat-7-on-ubuntu-14-04-via-apt-get | |||
<source lang="bash"> | |||
sudo apt-get install openjdk-7-source | |||
sudo apt-get install tomcat7 | |||
</source> | |||
Now visit http://localhost:8080. You should see something like this: | |||
[[Image:TomcatInit.png|400px]] | |||
Next, edit your tomcat configuration file to point to your JDK: | |||
<source lang="bash"> | |||
vim /etc/default/tomcat7 | |||
</source> | |||
and change the line with <code>JAVA_HOME</code> defined to: | |||
<pre> | |||
JAVA_HOME="/usr/lib/jvm/java-7-openjdk-amd64" | |||
</pre> | |||
==Tomcat Goodies== | |||
Install Tomcat goodies (listed on the default Tomcat page pictured above): | |||
<source lang="bash"> | |||
sudo apt-get install tomcat7-docs tomcat7-admin tomcat7-examples | |||
</source> | |||
When you do that, the links listed on localhost:8080 (to documentation, examples, etc) will now work. | |||
==Showing Tomcat Where Java Is== | |||
instructions modified from http://hongru.hou.io/blog/2013/01/07/How-to-install-GeoServer-on-Ubuntu-12.04/ | |||
We will need to edit the Tomcat config file: | |||
<pre> | |||
sudo vim /etc/default/tomcat7 | |||
</pre> | |||
Insert the line that tells Tomcat where Java is: | |||
<pre> | |||
JAVA_HOME=/usr/lib/jvm/openjdk-7-jdk | |||
</pre> | |||
And then we restart Tomcat with the new configuration: | |||
<pre> | |||
sudo /etc/init.d/tomcat7 restart | |||
</pre> | |||
==Java Goodies== | |||
<source lang="bash"> | |||
sudo apt-get install default-jdk ant git | |||
</source> | |||
=Geoserver= | |||
==Download== | |||
Download the Geoserver WAR file (this is the web applet that will be run by Tomcat). | |||
==Install the Webapp== | |||
Webapp files go in <code>/var/lib/tomcat7/webapps</code> | |||
Now we can put our Geoserver war file into <code>/var/lib/tomcat7/webapps/</code> and we should be ready to go. | |||
I start by downloading the war file to my home directory with <code>wget</code>. | |||
Unzip the zip file. The war file is the important one. | |||
Copy the war file to the Tomcat webapps directory, ''as the user tomcat7'': | |||
<source lang="bash"> | |||
sudo -u tomcat7 cp geoserver.war /var/lib/tomcat7/webapps/. | |||
</source> | |||
==That's It!== | |||
Give the server a few minutes to pick up the files. Once it does, you should be able to navigate to http://localhost:8080/geoserver and see something like the page below: | |||
[[Image:GeoserverInitial.png|400px]] | |||
[[Category:GIS]] | |||
[[Category:Deployment]] | |||
[[Category:Unix]] | |||
[[Category:Droplet]] | |||
[[Category:Tomcat]] | |||
[[Category:Server]] | |||
Latest revision as of 21:47, 25 March 2017
My Geodroplet adventure:
- Part 1 - this page
- Part 2 - Geoserver
- Part 3 - Geoserver OilGas
Procedure
Initial Setup of Droplet
Create droplet via Digital Ocean page
Follow instructions to log into droplet as root
Add non-root user account:
useradd -m charles
Give non-root user account sudo abilities
- add to root group:
usermod -a -G root charles - make sudoer:
sudo adduser charles sudo
Test sudo abilities
sudo -; whoami
Disable non-root login
sudo vim /etc/ssh/sshd_config- change
PermitRootLogin yestoPermitRootLogin no
Log in from another window (just in case)
Restart ssh: /etc/init.d/sshd restart
Change user shell using sudo usermod -s /bin/bash charles
MySQL Setup
Based on the startup message, ran mysql_secure_installation.
Prep Aptitude
sudo apt-get -y update
sudo apt-get install -y build-essential
sudo apt-get install -y python
sudo apt-get install -y wget
sudo apt-get install -y unzip
sudo apt-get -y autoremove
Tomcat
A nice guide to installing Tomcat by Digital Ocean: https://www.digitalocean.com/community/tutorials/how-to-install-apache-tomcat-7-on-ubuntu-14-04-via-apt-get
sudo apt-get install openjdk-7-source
sudo apt-get install tomcat7
Now visit http://localhost:8080. You should see something like this:
Next, edit your tomcat configuration file to point to your JDK:
vim /etc/default/tomcat7
and change the line with JAVA_HOME defined to:
JAVA_HOME="/usr/lib/jvm/java-7-openjdk-amd64"
Tomcat Goodies
Install Tomcat goodies (listed on the default Tomcat page pictured above):
sudo apt-get install tomcat7-docs tomcat7-admin tomcat7-examples
When you do that, the links listed on localhost:8080 (to documentation, examples, etc) will now work.
Showing Tomcat Where Java Is
instructions modified from http://hongru.hou.io/blog/2013/01/07/How-to-install-GeoServer-on-Ubuntu-12.04/
We will need to edit the Tomcat config file:
sudo vim /etc/default/tomcat7
Insert the line that tells Tomcat where Java is:
JAVA_HOME=/usr/lib/jvm/openjdk-7-jdk
And then we restart Tomcat with the new configuration:
sudo /etc/init.d/tomcat7 restart
Java Goodies
sudo apt-get install default-jdk ant git
Geoserver
Download
Download the Geoserver WAR file (this is the web applet that will be run by Tomcat).
Install the Webapp
Webapp files go in /var/lib/tomcat7/webapps
Now we can put our Geoserver war file into /var/lib/tomcat7/webapps/ and we should be ready to go.
I start by downloading the war file to my home directory with wget.
Unzip the zip file. The war file is the important one.
Copy the war file to the Tomcat webapps directory, as the user tomcat7:
sudo -u tomcat7 cp geoserver.war /var/lib/tomcat7/webapps/.
That's It!
Give the server a few minutes to pick up the files. Once it does, you should be able to navigate to http://localhost:8080/geoserver and see something like the page below: