Вы находитесь на странице: 1из 5

1

Referencia: http://kll.engineering-news.org/kllfusion01/articles.php?article_id=138

1. INSTALACIÓN DE APACHE
sudo su
apt -y install apache2

nano /etc/apache2/conf-enabled/security.conf
cambiar línea #25:
ServerTokens Prod

nano /etc/apache2/mods-enabled/dir.conf
cambiar línea #2:
DirectoryIndex index.html index.htm

systemctl restart apache2

En un navegador: 10.0.0.77

2. INSTALACIÓN DE PHP
apt -y install php php-cgi libapache2-mod-php php-common php-pear php-mbstring
a2enconf php7.0-cgi
service apache2 reload (PROBAR: systemctl reload apache2)

nano /etc/php/7.0/apache2/php.ini
cambiar línea #924:
date.timezone = "America/La_Paz"

systemctl restart apache2


exit
Crear una página PHP de prueba:
nano /var/www/html/index.php

Insertar en el archivo:
<html>
<body>
<div style="width: 100%; font-size: 40px; font-weight: bold; text-align:center;">
<?php
print Date("d/m/Y");
?>
</div>
</body>
</html>

En un navegador: 10.0.0.77/index.php
2

3. INSTALACIÓN DE FAST PHP


sudo su
apt -y install php-fpm

configurar Apache httpd:


nano /etc/php/7.0/fpm/pool.d/www.conf

cambiar línea #36:


listen=127.0.0.1:9000

nano /etc/apache2/sites-enabled/000-default.conf

adicionar dentro de <VirtualHost> - </VirtualHost>

<FilesMatch "\.php$">
SetHandler "proxy:fcgi://127.0.0.1:9000/"
</FilesMatch>

a2enmod proxy_fcgi

reiniciar Apache:
systemctl restart php7.0-fpm apache2

crear info.php:
echo '<?php phpinfo(); ?>' > /var/www/html/info.php

En un navegador: 10.0.0.77/info.php

4. INSTALACIÓN DE MariaDB
apt -y install mariadb-server
nano /etc/mysql/mariadb.conf.d/50-server.cnf

cambiar línea #111 y #112:


character-set-server = utf8
#collation-server = utf8mb4_general_ci

systemctl restart mariadb


mysql_secure_installation  ENTER

Set root password? [Y/n] y


Remove anonymous users? [Y/n] y
Disallow root login remotely? [Y/n] y
Remove test database and access to it? [Y/n] y
Reload privilege tables now? [Y/n] y

mysql -u root -p

mostrar lista de usuarios:


select user,host,password from mysql.user;

mostrar lista de base de datos:


show databases;
3

exit

5. INSTALACIÓN DE PHPMYADMIN
sudo su
apt -y install phpmyadmin php-mbstring php-gettext

Seleccionar:

[*] apache2

Configure database for phpmyadmin with dbconfig-common?

<Yes> <No>

mysql -u root -p mysql

MariaDB[mysql]> update user set plugin='' where user='root';


MariaDB[mysql]> flush privileges;
MariaDB[mysql]> exit

NOTA.- Hasta este punto funciona phpmyadmin con usuario: root y password: cascabel

systemctl restart apache2

sudo mysql -u root -p

MariaDB[mysql]> create user 'test'@'localhost' identified by 'cascabel';


MariaDB[mysql]> grant all privileges on *.* to 'test'@'localhost';
MariaDB[mysql]> exit
4

Una vez iniciado phpmyadmin, usar:

Username: test
Password: cascabel

OTRA OPCIÓN PARA LA INSTALACIÓN DE APACHE, PHP, MariaDB Y PHPMYADMIN


(libapache2-mod-php proporciona el soporte de php para apache)

sudo apt-get update


sudo apt-get install apache2 php libapache2-mod-php mysql-client mysql-server phpmyadmin

[*] apache2
[ ] lighttpd

Configure database for phpmyadmin with dbconfig-common?

<Yes> <No>

MySQL application password for phpmyadmin: cascabel


Password confirmation: cascabel

Se verifica si el Sistema se está ejecutando correctamente:

sudo systemctl status apache2


sudo systemctl status mysqld
sudo systemctl status mysql
sudo mysql_secure_installation

Enter current password for root (enter for none): ENTER


Set root password? [Y/n] y
New password: cascabel
Re-enter new password: cascabel
Remove anonymous users? [Y/n] y
Disallow root logon remotely? [Y/n] y
Remove test database and access to it? [Y/n] y
Reload privilege tables now? [Y/n] y

Se observa que una vez iniciado 10.0.0.77/phpmyadmin, se puede acceder como usuario
phpmyadmin, pero no como usuario root

sudo mysql -u root -p

MariaDB[mysql]> create user 'test'@'localhost' identified by 'cascabel';


MariaDB[mysql]> grant all privileges on *.* to 'test'@'localhost';
MariaDB[mysql]> flush privileges;
MariaDB[mysql]> exit

Una vez iniciado phpmyadmin, usar:

Username: test
Password: cascabel

PRUEBA DE ARCHIVO index.php


sudo nano /var/www/html/index.php

MENSAJE DE ERROR: La configuración de PHP limita el número de campos para enviar en un


formulario a max_input_vars = 1000.

Solución:
5

sudo nano /etc/php/7.0/apache2/php.ini

Cambiar: max_input_vars = 10000

Вам также может понравиться