0% found this document useful (0 votes)
277 views6 pages

Instalar Postgres, Postgis, Mysql, Phpmyadmin en CentOS 7

The document provides instructions for installing and configuring several technologies on a Linux server including: 1. PostgreSQL, PostGIS, and creating a spatial database. 2. Java, Tomcat 8, and configuring Java alternatives to run Tomcat. 3. MySQL 5.6 and phpMyAdmin for database management. 4. Integrating Tomcat with Apache by configuring a proxy pass to route requests. 5. GDAL is also installed but instructions are not provided.

Uploaded by

fabisant
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
277 views6 pages

Instalar Postgres, Postgis, Mysql, Phpmyadmin en CentOS 7

The document provides instructions for installing and configuring several technologies on a Linux server including: 1. PostgreSQL, PostGIS, and creating a spatial database. 2. Java, Tomcat 8, and configuring Java alternatives to run Tomcat. 3. MySQL 5.6 and phpMyAdmin for database management. 4. Integrating Tomcat with Apache by configuring a proxy pass to route requests. 5. GDAL is also installed but instructions are not provided.

Uploaded by

fabisant
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 6

Instalar PostgreSQL

Tutorial -> http://www.postgresql.org/download/linux/redhat/#yum


yum install http://yum.postgresql.org/9.4/redhat/rhel-6-x86_64/pgdg-redhat949.4-1.noarch.rpm
yum install postgresql94-server postgresql94-contrib
systemctl enable postgresql-9.4.service
/usr/pgsql-9.4/bin/postgresql94-setup initdb
systemctl start postgresql-9.4

Instalar postgis
sudo rpm -ivh http://dl.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-78.noarch.rpm
yum install postgis2_94

Crear base de datos espacial

Instalar tomcat 8 y java


Tutorial -> https://www.rosehosting.com/blog/installing-tomcat-8-on-acentos-7-linux-vps/

Instalar JAVA
for 32-bit (x86) systems:
## yum install /opt/jdk-8-linux-i586.rpm

for 64-bit (x86_64) systems:


## yum install /opt/jdk-8-linux-x64.rpm

CONFIGURAR JAVA
configure the JAVA package using the alternatives command:

JDK_DIRS=($(ls -d /usr/java/jdk*))
JDK_VER=${JDK_DIRS[@]:(-1)}

alternatives --install /usr/bin/java java /usr/java/"${JDK_VER##*/}"/jre/bin/java 20000


alternatives --install /usr/bin/jar jar /usr/java/"${JDK_VER##*/}"/bin/jar 20000
alternatives --install /usr/bin/javac javac /usr/java/"${JDK_VER##*/}"/bin/javac 20000
alternatives --install /usr/bin/javaws javaws /usr/java/"${JDK_VER##*/}"/jre/bin/javaws
20000
alternatives --set java /usr/java/"${JDK_VER##*/}"/jre/bin/java
alternatives --set javaws /usr/java/"${JDK_VER##*/}"/jre/bin/javaws
alternatives --set javac /usr/java/"${JDK_VER##*/}"/bin/javac
alternatives --set jar /usr/java/"${JDK_VER##*/}"/bin/jar

VERIFICAR JAVA
You may want to check if JAVA has been properly setup on your CentOS
Linux VPS using:
java -version

SETUP TOMCAT
TOMCAT USER
Before proceeding with the Tomcat installation, lets first create a
separate system user which will run the Tomcat server:
useradd -r tomcat8 --shell /bin/false

DOWNLOAD TOMCAT
Next, download the latest version of Tomcat 8 available
at http://tomcat.apache.org/download-80.cgi . You can use wget to
download it in /tmp, for example:

wget http://mirrors.ibiblio.org/apache/tomcat/tomcat-8/v8.0.22/bin/apache-tomcat8.0.22.tar.gz -P /tmp

Instalar Tomcat
Extract the contents of the Tomcat archive you just downloaded to /opt,
create a symbolic link of tomcat directory to /opt/tomcat-latest and setup
proper ownership using the following commands:
tar -zxf /tmp/apache-tomcat-8.0.22.tar.gz -C /opt
ln -s /opt/apache-tomcat-8.0.22 /opt/tomcat-latest
chown -hR tomcat8: /opt/tomcat-latest /opt/apache-tomcat-8.0.22

START TOMCAT
Create the following systemd unit file
in /etc/systemd/system/tomcat8.service
[Unit]
Description=Tomcat8
After=network.target

[Service]
Type=forking
User=tomcat8
Group=tomcat8

Environment=CATALINA_PID=/opt/tomcat-latest/tomcat8.pid
Environment=TOMCAT_JAVA_HOME=/usr/java/default
Environment=CATALINA_HOME=/opt/tomcat-latest
Environment=CATALINA_BASE=/opt/tomcat-latest
Environment=CATALINA_OPTS=
Environment="JAVA_OPTS=-Dfile.encoding=UTF-8
-Dnet.sf.ehcache.skipUpdateCheck=true -XX:+UseConcMarkSweepGC -XX:
+CMSClassUnloadingEnabled -XX:+UseParNewGC -XX:MaxPermSize=128m -Xms512m
-Xmx512m"

ExecStart=/opt/tomcat-latest/bin/startup.sh
ExecStop=/bin/kill -15 $MAINPID

[Install]
WantedBy=multi-user.target

With the unit file in place, run the following commands to start the
Tomcat servce:
systemctl daemon-reload
systemctl restart tomcat
systemctl enable tomcat
NOTA IMPORTANTE: al momento de ingresar proyectos web es necesario cambiar el
nombre de usuario a todo el directorio y sus archivos, caso contrario tendr
inconvenientes al momento de guardar informacin en ese directorio.
chown -hR tomcat8:tomcat8 directory

Abrir Puerto en firewall


firewall-cmd --zone=public --add-port=8080/tcp --permanent
ACCESS TOMCAT
Access your newly installed Tomcat at http://localhost:8080

Instalar MySQL 5.6


Tutorial -> http://planet.mysql.com/entry/?id=1862012
sudo yum install http://dev.mysql.com/get/mysql-community-release-el7-5.noarch.rpm
sudo yum repolist enabled | grep "mysql.*-community.*"
sudo yum install mysql-community-server
sudo systemctl start mysqld
sudo systemctl status mysqld

sudo systemctl enable mysqld.service

instalar phpmyadmin

Tutorial -> http://www.liquidweb.com/kb/how-to-install-and-configurephpmyadmin-on-centos-7/


rpm -iUvh http://dl.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-75.noarch.rpm
yum -y update
yum -y install phpmyadmin

configurar
vim /etc/httpd/conf.d/phpMyAdmin.conf
Require ip 127.0.0.1
Allow from 127.0.0.1
Require ip 127.0.0.1
Allow from 127.0.0.1

# Apache 2.4
<RequireAny>
Require ip 127.0.0.1
Require ip ::1
</RequireAny>

Replace with
# Apache 2.4
<RequireAny>
# Require ip 127.0.0.1
# Require ip ::1
Require all granted
</RequireAny>

systemctl restart httpd

Integrar tomcat en apache


Editar el archivo /etc/httpd/conf/httpd.conf
Agregar modulo
LoadModule proxy_ajp_module modules/mod_proxy_ajp.so
Agregar o modificar VirtualHost
<VirtualHost *:80>
DocumentRoot /var/www/ideucuenca
ServerName ide.ucuenca.edu.ec
ProxyRequests Of
ProxyPreserveHost On
<Proxy *>
Order deny,allow
Allow from all
</Proxy>
#directorios Plataforma IDE
ProxyPass /web ajp://localhost:8009/web
ProxyPass /geoserver ajp://localhost:8009/geoserver
ProxyPass /geonetwork ajp://localhost:8009/geonetwork
#Servidor WEB Tomcat
ProxyPassReverse / ajp://localhost:8009
ErrorLog /var/log/httpd/tomcat.error.log
CustomLog /var/log/httpd/tomcat.log combined
</VirtualHost>
Nota: El puerto 8009 es el puerto que est configurado en
tomcat en el archivo de configuracin servers.xml

Instalar GDAL

You might also like