sábado, agosto 20, 2016

Instalar Centos 7 + LAMP, Cinnamon y Postgres

Seguir las siguentes secuencias:

Actualizar repositorio:
rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY*
yum -y install epel-release


Instalar Mysql
yum install http://dev.mysql.com/get/mysql-community-release-el7-5.noarch.rpm
 
Revisar si ya tiene instalado: 
yum repolist enabled | grep "mysql.*-community.*"
 
Instalar Mysql 
yum install mysql-community-server 
 
 Activar Mysql
systemctl start mysqld
 systemctl enable mysqld   // Auto Arranque

Revsar estado
systemctl status mysqld

Referencia: Referencia

Deshabilitar el Firewall
systemctl stop  firewalld
systemctl disable  firewalld

 Inicializar MYSQL

mysql_secure_installation


Responder las preguntas:

Activar para que puedan acceder remotamente con el usurioa ROOT
mysql -u root
password.

mysql> use mysql;
mysql> update user set password=PASSWORD("NuevoPass") where User='root';
mysql> flush privileges;
mysql> GRANT ALL ON *.* TO root@'%.%.%.%' IDENTIFIED BY 'password';
mysql> FLUSH PRIVILEGES;

mysql> quit


Instala Apache2
yum -y install httpd

Iniciar Http.
systemctl start httpd.service

systemctl enable httpd.service

Revisar en el navegador.
http://localhost

Instalar Php5
yum -y install php

 systemctl restart httpd.service

 Crear script de prueba de PHP
vi /var/www/html/info.php
Digitar lo siguiente:
<?php
phpinfo();
?>

En el navegador  http://localhost/info.php



Instalamos PHP para Mysql
yum -y install php-mysql
yum -y install php-gd php-ldap php-odbc php-pear php-xml php-xmlrpc php-mbstring php-snmp php-soap curl curl-devel
Reiniciamos Apache2:
 systemctl restart httpd.service

En el navegador  http://localhost/info.php , desplegaran mas modulos.
 
Instalamos PHPMYAdmin
yum install phpMyAdmin

Editar el siguiente archivo:
vi /etc/httpd/conf.d/phpMyAdmin.conf 

Reemplazar por lo siguente:
[...]
Alias /phpMyAdmin /usr/share/phpMyAdmin
Alias /phpmyadmin /usr/share/phpMyAdmin

#<Directory /usr/share/phpMyAdmin/>
#   <IfModule mod_authz_core.c>
#     # Apache 2.4
#     <RequireAny>
#       Require ip 127.0.0.1
#       Require ip ::1
#     </RequireAny>
#   </IfModule>
#   <IfModule !mod_authz_core.c>
#     # Apache 2.2
#     Order Deny,Allow
#     Deny from All
#     Allow from 127.0.0.1
#     Allow from ::1
#   </IfModule>
#</Directory>


<Directory /usr/share/phpMyAdmin/>
        Options none
        AllowOverride Limit
        Require all granted
</Directory>

[...] 
 
Shift-ZZ, para grabar.
 
 
Debe quedar asi:
# phpMyAdmin - Web based MySQL browser written in php
# 
# Allows only localhost by default
#
# But allowing phpMyAdmin to anyone other than localhost should be considered
# dangerous unless properly secured by SSL

Alias /phpMyAdmin /usr/share/phpMyAdmin
Alias /phpmyadmin /usr/share/phpMyAdmin

#<Directory /usr/share/phpMyAdmin/>
#   <IfModule mod_authz_core.c>
#     # Apache 2.4
#     <RequireAny>
#       Require ip 127.0.0.1
#       Require ip ::1
#     </RequireAny>
#   </IfModule>
#   <IfModule !mod_authz_core.c>
#     # Apache 2.2
#     Order Deny,Allow
#     Deny from All
#     Allow from 127.0.0.1
#     Allow from ::1
#   </IfModule>
#</Directory>

<Directory /usr/share/phpMyAdmin/>
        Options none
        AllowOverride Limit
        Require all granted
</Directory>

<Directory /usr/share/phpMyAdmin/setup/>
   <IfModule mod_authz_core.c>
     # Apache 2.4
     <RequireAny>
       Require ip 127.0.0.1
       Require ip ::1
     </RequireAny>
   </IfModule>
   <IfModule !mod_authz_core.c>
     # Apache 2.2
     Order Deny,Allow
     Deny from All
     Allow from 127.0.0.1
     Allow from ::1
   </IfModule>
</Directory>

# These directories do not require access over HTTP - taken from the original
# phpMyAdmin upstream tarball
#
<Directory /usr/share/phpMyAdmin/libraries/>
    Order Deny,Allow
    Deny from All
    Allow from None
</Directory>

<Directory /usr/share/phpMyAdmin/setup/lib/>
    Order Deny,Allow
    Deny from All
    Allow from None
</Directory>

<Directory /usr/share/phpMyAdmin/setup/frames/>
    Order Deny,Allow
    Deny from All
    Allow from None
</Directory>

# This configuration prevents mod_security at phpMyAdmin directories from
# filtering SQL etc.  This may break your mod_security implementation.
#
#<IfModule mod_security.c>
#    <Directory /usr/share/phpMyAdmin/>
#        SecRuleInheritance Off
#    </Directory>
#</IfModule>
 
 
Reiniciamos Apache2:
 systemctl restart httpd.service

En el navegador:  http://localhost/phpmyadmin nos desplega el acceso a Mysql

 
 
Inicio de sesión sin contraseña está prohibido por la configuración (consulte AllowNoPassword)

Fuente: http://www.enmimaquinafunciona.com/pregunta/8332/phpmyadmin-en-ubuntu-lampara-inicio-de-sesion-sin-contrasena-esta-prohibido-por-la-configuracion-consulte-allownopassword

Si reporta el siguiente error:
Inicio de sesión sin contraseña está prohibido por la configuración (consulte AllowNoPassword)

Editar el siguiente archivo
/etc/phpmyadmin/config.inc.php.

Fuente: http://www.enmimaquinafunciona.com/pregunta/8332/phpmyadmin-en-ubuntu-lampara-inicio-de-sesion-sin-contrasena-esta-prohibido-por-la-configuracion-consulte-allownopassword

vi /etc/phpMyAdmin/config.inc.php











$cfg['Servers'][$i]['user']          = 'root';   // Asignar Usuario de MYSQL

$cfg['Servers'][$i]['AllowNoPassword'] = TRUE;
$cfg['Servers'][$i]['password']      = '';  // Puedes asignar un Password

Reiniciamos Apache2:
 systemctl restart httpd.service

Instalar CINNAMON.
yum -y groups install "Server with GUI"  
yum --enablerepo=epel -y install cinnamon*
echo "exec /usr/bin/cinnamon-session" >> ~/.xinitrc
startx

Otra Forma:
yum -y install epel-release
yum -y groupinstall "X Window system"
yum -y install lightdm
yum -y install cinnamon
systemctl isolate graphical.target

Que Arranque siempre con en modo grafico
systemctl set-default graphical.target
rm '/etc/systemd/system/default.target'
ln -s '/usr/lib/systemd/system/graphical.target' '/etc/systemd/system/default.target'


Instalar PostgreSql.
yum install http://yum.postgresql.org/9.4/redhat/rhel-7-x86_64/pgdg-redhat94-9.4-1.noarch.rpm
 
Luego:
 yum -y update

Instalamos la BD.
yum groupinstall "PostgreSQL Database Server 9.4 PGDG"
 
Inicializamos la Base de datos
/usr/pgsql-9.4/bin/postgresql94-setup initdb
 
Iniciamos el servicio.
systemctl start postgresql-9.4.service
 
Autoarranque:
systemctl enable postgresql-9.4.service
 
Reiniciamos
systemctl restart postgresql-9.4.service

Verificar la intalacion:
su - postgres
$ psql
 
Debe desplegar:
psql (9.4.1)
Type "help" for help.

postgres=# 

Cambiamos el Password:
password postgres
 
Editamos el Archivo: 
vi /var/lib/pgsql/9.4/data/postgresql.conf 
 
Adicionamos lo siguiente, para que se conecten cualquier usuario. 
listen_addresses = '*'
port = 5432
 
 Asignamos permisos:
vi /var/lib/pgsql/9.4/data/pg_hba.conf
 
 Todos puede accesar a la todas las bases de datos.
host    all             all             0.0.0.0/0               trust 
# "local" is for Unix domain socket connections only
local   all             all                                     trust
 
Reiniciamos el servicio
systemctl start postgresql-9.4.service
 
 
Instalamos PhpPgAdmin
yum install phpPgAdmin
 
Editamos:
vi /etc/httpd/conf.d/phpPgAdmin.conf

Copiamos lo siguiente:
#
# This configuration file maps the phpPgAdmin directory into the URL space. 
# By default this application is only accessible from the local host.
#

Alias /phpPgAdmin /usr/share/phpPgAdmin

<Location /phpPgAdmin>
    <IfModule mod_authz_core.c>
        # Apache 2.4
        Require all granted
        #Require host example.com
    </IfModule>
    <IfModule !mod_authz_core.c>
        # Apache 2.2
        Order deny,allow
#        Deny from all
        Allow from all
#       Allow from ::1
        # Allow from .example.com
    </IfModule>
</Location> 
 
Reiniciamos Postgres 
systemctl start postgresql-9.4.service

Reiniciamos Apache:
systemctl restart httpd.service
 
En el navegador:  
http://IP/phpPgAdmin/
 
Usuario: postgres
Password: postgres 


Instalar Tomcat Via YUM:

yum install tomcat
 
Se ubicara en: /usr/share/tomcat
Las aplicaciones estan en: /usr/share/tomcat/webapps  
 
Editar opciones del Tomcat:
vi /usr/share/tomcat/conf/tomcat.conf
 
Asignar memoria:
 
JAVA_OPTS="-Djava.security.egd=file:/dev/./urandom -Djava.awt.headless=true -Xmx512m -XX:MaxPermSize=256m -XX:+UseConcMarkSweepGC"  

Instalar aplicaciones adicionales:
yum install tomcat-webapps tomcat-admin-webapps 
 
Se adicionan: ROOT, examples, sample, manager, and host-manager web apps a la carpeta: tomcat/webapps 

Instala Documentacion:
yum install tomcat-docs-webapp tomcat-javadoc
.
Crear usuarios:
vi /usr/share/tomcat/conf/tomcat-users.xml

 <tomcat-users> 
<user username="admin" password="password" roles="manager-gui,admin-gui"/> </tomcat-users>

Reiniciar el Tomcat
systemctl start tomcat
 
Si registra un error intentamos de esta forma:
systemctl restart tomcat
 
Que inicie al momento de iniciar el servidor: 
systemctl enable tomcat  

Descargar para monitorear al Tomcat:

https://github.com/psi-probe/psi-probe/releases

Descargar el WAR
https://github.com/psi-probe/psi-probe/releases/download/2.4.0.SP1/probe.war

Mover a
/usr/share/tomcat/webapps  

Reiniciar el Tomcat
systemctl restart tomcat
 
En el Navegador:
http://localhost:8080/probe
 
Nos pide un usuario y clave registrados anteriormente, 
luego nos presentara la siguiente pantalla.
 
 


 
Luego todas las aplicaciones: 
 
Podemos desplgar el WAR desde esta pantalla:










Inicio de sesión sin contraseña está prohibido por la configuración (consulte AllowNoPassword)

Fuente: http://www.enmimaquinafunciona.com/pregunta/8332/phpmyadmin-en-ubuntu-lampara-inicio-de-sesion-sin-contrasena-esta-prohibido-por-la-configuracion-consulte-allownopassword

No hay comentarios: