martes, 15 de mayo de 2018

AWS LINUX 2 | Configurar LAMP - PHPAMYDMIN

1.- actualizar el SO
# yum update -y

2-. verificar la instalaccion de la apache
# yum install httpd

3.- iniciar el servicio
# service httpd start

4.- instalar LAMP
# amazon-linux-extras install lamp-mariadb10.2-php7.2 php7.2

5.- instalar mariadb-server
# yum install -y httpd mariadb-server

6.- iniciar apache
# systemctl start httpd

7.- ponerlo para que inicie en automatico (verificacion si esta activo )
# systemctl enable httpd
# systemctl is-enabled httpd

8- agregar usuario ec2-user a grupo apache
# usermod -a -G apache ec2-user

9.- cambiar el propietario del grupo de apache
# chown -R ec2-user:apache /var/www

10.- agregar los permisos a futuros directorios
# chmod 2775 /var/www && find /var/www -type d -exec chmod 2775 {} \;

11.- agregar permisos a las carpetas y subcarpetas
# find /var/www -type f -exec chmod 0664 {} \;

12.- create archivo phpinfo.php con el siguiemte contenido
#

13.- reiniciar los servicios de httpd

14.- iniciar la bd mariadb
# systemctl start mariadb

15.- iniciar en modo seguro
# mysql_secure_installation

To install phpMyAdmin
1.- instalar dependencias
# yum install php-mbstring -y

2.- reiniciar el apache
# systemctl restart httpd

3.- reiniciar php fpm
# systemctl restart php-fpm

4.- ubicarte en la carpeta en donde se instalar
# cd /var/www/phpmyadmin
# wget https://www.phpmyadmin.net/downloads/phpMyAdmin-latest-all-languages.tar.gz

5.- descomprimir los archivos en la carpeta "phpmyadmin"
# tar -xvzf phpMyAdmin-latest-all-languages.tar.gz -C phpmyadmin --strip-components 1

6.- reiniciar la base de datos
# systemctl start mariadb

7.- navegar en el phpmyadmin
# http://my.public.dns.amazonaws.com/phpmyadmin

Configurar PhpAdmyn
1.- copiar el archivo de configuracion
# cp config.sample.inc.php config.inc.php

2.- agregar los siguientes campos en config.inc.php
$i++;
$cfg['Servers'][$i]['verbose'] = 'Database Server 2';
$cfg['Servers'][$i]['host'] = '192.168.1.102';
$cfg['Servers'][$i]['port'] = '';
$cfg['Servers'][$i]['socket'] = '';
$cfg['Servers'][$i]['connect_type'] = 'tcp';
$cfg['Servers'][$i]['extension'] = 'mysqli';
$cfg['Servers'][$i]['auth_type'] = 'cookie';
$cfg['Servers'][$i]['AllowNoPassword'] = false;

No hay comentarios:

Publicar un comentario