martes, 22 de mayo de 2018

AWS - GODADDY | Configurar Dominio

AWS
Hosted Zones >
[Create Hosted Zone]
Domain Name : midominio.com
[Create]
[Create Record Set]
Name :
Type : A - IPv4 address
Alias : No
Value : 89.89.21.23
[Create]
[Create Record Set]
Name : www
Type : A - IPv4 address
Alias : Yes
Alias Target : midominio.com
[Create]

GODADY
Servidores de nombres
[Cambiar]
Agregar los 4DNS de AWS
[Guardar]

miércoles, 16 de mayo de 2018

AWS LINUX | INSTALAR LAMP - PHPMYADMIN

1.- INSTALAR LAMP / PHPMYADMIN
# yum remove httpd-tools
# yum install -y httpd24 php70 mysql56-server php70-mysqlnd
# service httpd start
# chkconfig httpd on
# chkconfig --list httpd

agregar usuario :
# usermod -a -G apache ec2-user
# chmod 2775 /var/www
# find /var/www -type d -exec chmod 2775 {} \;
# find /var/www -type f -exec chmod 0664 {} \;

verificar php
# echo "" > /var/www/html/phpinfo.php
http://my.public.dns.amazonaws.com/phpinfo.php
# yum list installed httpd24 php70 mysql56-server php70-mysqlnd

verificar base de datos y cambio de la base de datos
# service mysqld start
# mysql_secure_installation
# service mysqld stop
# chkconfig mysqld on

instalar php myadmin
# yum install php70-mbstring.x86_64 php70-zip.x86_64 -y
# service httpd restart
# wget https://files.phpmyadmin.net/phpMyAdmin/4.8.0.1/phpMyAdmin-4.8.0.1-all-languages.zip
# unzip phpMyAdmin-4.8.0.1-all-languages.zip -d phpmyadmin
# service mysqld start
http://my.public.dns.amazonaws.com/phpmyadmin


Configurar PhpAdmyn para tener 2 conexiones en un mismo servidor
# cp config.sample.inc.php config.inc.php

editar 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;

AWS LINUX | INSTALAR TOMCAT 8

4. INSTALACION DE TOMCAT 8.5
yum install tomcat8-webapps
yum install tomcat8-admin-webapps
service tomcat8 start

AWS LINUX | Instalar JAVA 8

1. INSTALACION DE JAVA
# java -version
# yum remove java
# yum install java-1.8.0-openjdk

AWS LINUX | Verificar aplicaciones ya instaladas

1.- VERIFICAR LAS APLICACIONES YA INSTALADAS
yum grouplist
yum groupinfo "Group Name"
yum list installed

AWS LINUX | Memoria

1.- VERIFICACION/USO DE MEMORIA
# yum install htop

# free -m
# cat /proc/meminfo
# vmstat -s
# top
# htop

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;

miércoles, 9 de mayo de 2018

AWS LINUX 2 | uninstall nginx

[root@server]# service nginx stop

[root@server]# chkconfig nginx off

[root@server]# yum remove nginx

martes, 8 de mayo de 2018

MySql | Restaurar información desde un txt

1.- editar my.ini para que pueda leer archivos de cualquier lugar
secure-file-priv=""

2.- reiniciar servicios de MySql

3.- linea de comandos de S.O.
c:\cd C:\Program Files\MySQL\MySQL Server 5.7\bin

4.- conectarse
c:\ mysql --user={aqui va el usuario} --password {aqui la base de datos}
# pide clave

5.- comando para restaurar la base de datos
LOAD DATA INFILE 'D:\\tmp\\bd.txt'
INTO TABLE usuario
FIELDS TERMINATED BY '|' IGNORE 1 LINES ;

Otros
* mysql> SHOW VARIABLES LIKE "secure_file_priv";