Está en la página 1de 12

MANUAL DE INSTALACION

DOCUMENTO PR-050-21-DOC-001

REVISIÓN No. 1

Revisión Modificaciones Fecha

0 Emitido para comentarios del cliente 19/07/2021


1 Comandos detallados 02/08/2021

Elaboración – Revisión – Aprobación

Revisión Elaborado por: Revisado por: Aprobado por:


Nombre Firma Nombre Firma Nombre Firma
0 SM JM LB
INSTALACION DE DRUPAL 9 EN Doc.: PR-050-21-DOC-010
UBUNTU 18.04
Rev. No.: 1 02/08/2021

ALCANCE

El presente documento, detalla la instalación del entorno de pruebas para el Micrositio,


desarrollado en Drupal 9, sobre servidor Ubuntu 18.04

PASOS A SEGUIR

1. INSTALAR PHP 7.4 EN UBUNTU 18.04

Agregar repositorio PHP PPA

Agregaremos el repositorio ppa: ondrej / php PPA que tiene los últimos
paquetes de compilación de PHP.

sudo apt-get update

sudo apt -y install software-properties-common

sudo add-apt-repository ppa:ondrej/php

sudo apt-get update

Instale PHP 7.4 en Ubuntu 18.04

Instale PHP 7.4 en Ubuntu 18.04 / 19.04 / 16.04 usando el comando:

sudo apt -y install php7.4

Utilice el siguiente comando para instalar paquetes adicionales:

sudo apt-get install -y php7.4-{cli,json,bcmath,bz2,intl,gd,mbstring,mysql,zip,common,xml,curl,pdo}

Archivo: INSTALACION DE DRUPAL 9 EN UBUNTU 18.04 2 de 12


INSTALACION DE DRUPAL 9 EN Doc.: PR-050-21-DOC-010
UBUNTU 18.04
Rev. No.: 1 02/08/2021

Ahora debemos habilitar cada uno de ellos:

sudo phpenmod json


sudo phpenmod bcmath
sudo phpenmod bz2
sudo phpenmod intl
sudo phpenmod gd
sudo phpenmod mbstring
sudo phpenmod mysqli
sudo phpenmod zip
sudo phpenmod xml
sudo phpenmod curl
sudo phpenmod pdo

Las configuraciones de PHP relacionadas con Apache se almacenan


en /etc/php/7.4/apache2/php.ini

Usando PHP 7.4 con Apache en Ubuntu:

La instalación de php en Ubuntu configura por defecto Apache.

2. CLONAR PROYECTO EN LA RUTA DE GIT

cd /var/www/html/
sudo git clone http://gitlab.softmanagement.com.co/CSJ/INTRANET_GPE

Ahora introduzca username y password de la cuenta de git.

Luego nos ubicamos en la carpeta del home para continuar la instalación.

cd /home/ubuntu

Archivo: INSTALACION DE DRUPAL 9 EN UBUNTU 18.04 3 de 12


INSTALACION DE DRUPAL 9 EN Doc.: PR-050-21-DOC-010
UBUNTU 18.04
Rev. No.: 1 02/08/2021

3. INSTALAR DRUPAL CON COMPOSER 9.1 EN UBUNTU 18.04

Para instalar composer localmente, ejecute

php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"

php -r "if (hash_file('sha384', 'composer-setup.php') ===


'756890a4488ce9024fc62c56153228907f1545c228516cbf63f885e036d37e9a59d27d63f46
af1d4d07ee0f76181c7d3') { echo 'Installer verified'; } else { echo 'Installer corrupt';
unlink('composer-setup.php'); } echo PHP_EOL;"

php composer-setup.php

php -r "unlink('composer-setup.php');"

sudo mv composer.phar /usr/local/bin/composer

luego
composer

Nos ubicamos en esta ruta


cd /var/www/html/INTRANET_GPE

Instalamos
sudo composer install

Luego confirmar.

Cambiar ubuntu por el nombre de


Cambiamos el propietario de la carpeta INTRANET_GPE usuario

cd ..
sudo chown -R www-data:ubuntu ./

Archivo: INSTALACION DE DRUPAL 9 EN UBUNTU 18.04 4 de 12


INSTALACION DE DRUPAL 9 EN Doc.: PR-050-21-DOC-010
UBUNTU 18.04
Rev. No.: 1 02/08/2021

Realicemos los siguientes ajustes en apache

Creamos un archivo de configuración virtual host Apache para Drupal.


Puedes crearlo con el siguiente comandonano

sudo nano /etc/apache2/sites-available/intranet.conf


Añade las siguientes líneas:

<VirtualHost *:80>
# The ServerName directive sets the request scheme, hostname and port
that
# the server uses to identify itself. This is used when creating
# redirection URLs. In the context of virtual hosts, the ServerName
# specifies what hostname must appear in the request's Host: header to
# match this virtual host. For the default virtual host (this file) this
# value is not decisive as it is used as a last resort host regardless.
# However, you must set it for any further virtual host explicitly.
#ServerName www.example.com

ServerAdmin webmaster@localhost
DocumentRoot /var/www/html/INTRANET_GET/web/

# Rewrite current-style URLs of the form 'index.php?q=x'.


RewriteCond %{DOCUMENT_ROOT}%{REQUEST_FILENAME} !-f
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php?q=$1 [L,QSA]

# Available loglevels: trace8, ..., trace1, debug, info, notice, warn,


# error, crit, alert, emerg.
# It is also possible to configure the loglevel for particular
# modules, e.g.
#LogLevel info ssl:warn

ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined

# For most configuration files from conf-available/, which are


# enabled or disabled at a global level, it is possible to
# include a line for only one particular virtual host. For example the
# following line enables the CGI configuration for this host only
Archivo: INSTALACION DE DRUPAL 9 EN UBUNTU 18.04 5 de 12
INSTALACION DE DRUPAL 9 EN Doc.: PR-050-21-DOC-010
UBUNTU 18.04
Rev. No.: 1 02/08/2021

# after it has been globally disabled with "a2disconf".


#Include conf-available/serve-cgi-bin.conf
</VirtualHost>

# vim: syntax=apache ts=4 sw=4 sts=4 sr noet

Guarda y cierra el archivo. Después, habilita el host y reescribe Apache con los siguientes
comandos:

sudo a2ensite intranet

sudo a2enmod rewrite

Después, reinicia el servicio de Apache para aplicar los cambios:


sudo systemctl restart apache2

4. INSTALAR MARIADB 10.5 EN UBUNTU 18.04

instale software-properties-common si falta:

Instale el paquete software-properties-common que proporciona


el comando add-apt-repository :

sudo apt-get install software-properties-common

Importar la clave gpg de MariaDB:

Ejecute el siguiente comando para agregar la clave de repositorio al sistema

sudo apt-get install software-properties-common

Archivo: INSTALACION DE DRUPAL 9 EN UBUNTU 18.04 6 de 12


INSTALACION DE DRUPAL 9 EN Doc.: PR-050-21-DOC-010
UBUNTU 18.04
Rev. No.: 1 02/08/2021

sudo apt-key adv --fetch-keys


'https://mariadb.org/mariadb_release_signing_key.asc'

Agregue el repositorio de apt

Una vez que se importa la clave PGP, proceda a agregar la URL del
repositorio a su servidor Ubuntu 18.04:

sudo add-apt-repository 'deb [arch=amd64,arm64,ppc64el]


https://mariadb.mirror.liquidtelecom.com/repo/10.5/ubuntu bionic main'

Instale MariaDB

El último paso es la instalación de MariaDB Server:

sudo apt update

sudo apt install mariadb-server mariadb-client

Se le pedirá que proporcione la contraseña de root de MariaDB. Ingrese una


contraseña para establecer.

Confirmar Contraseña:

Presione <Aceptar> para confirmar la nueva contraseña e instalar


MariaDB. Asegúrese de anotar la contraseña proporcionada.

Archivo: INSTALACION DE DRUPAL 9 EN UBUNTU 18.04 7 de 12


INSTALACION DE DRUPAL 9 EN Doc.: PR-050-21-DOC-010
UBUNTU 18.04
Rev. No.: 1 02/08/2021

Si no se le solicitó que establezca la contraseña de root, ejecute:

sudo mysql_secure_installation

NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR


ALL MariaDB

SERVERS IN PRODUCTION USE! PLEASE READ EACH STEP


CAREFULLY!

In order to log into MariaDB to secure it, we'll need the current

password for the root user. If you've just installed MariaDB, and

you haven't set the root password yet, the password will be blank,

so you should just press enter here.

Enter current password for root (enter for none):

OK, successfully used password, moving on...

Setting the root password ensures that nobody can log into the MariaDB

root user without the proper authorisation.

Set root password? [Y/n] y

Archivo: INSTALACION DE DRUPAL 9 EN UBUNTU 18.04 8 de 12


INSTALACION DE DRUPAL 9 EN Doc.: PR-050-21-DOC-010
UBUNTU 18.04
Rev. No.: 1 02/08/2021

New password:

Re-enter new password:

Password updated successfully!

Reloading privilege tables..

... Success!

By default, a MariaDB installation has an anonymous user, allowing anyone

to log into MariaDB without having to have a user account created for

them. This is intended only for testing, and to make the installation

go a bit smoother. You should remove them before moving into a

production environment.

Remove anonymous users? [Y/n] y

... Success!

Normally, root should only be allowed to connect from 'localhost'. This

ensures that someone cannot guess at the root password from the network.

Archivo: INSTALACION DE DRUPAL 9 EN UBUNTU 18.04 9 de 12


INSTALACION DE DRUPAL 9 EN Doc.: PR-050-21-DOC-010
UBUNTU 18.04
Rev. No.: 1 02/08/2021

Disallow root login remotely? [Y/n] y

... Success!

By default, MariaDB comes with a database named 'test' that anyone can

access. This is also intended only for testing, and should be removed

before moving into a production environment.

Remove test database and access to it? [Y/n] y

- Dropping test database...

... Success!

- Removing privileges on test database...

... Success!

Reloading the privilege tables will ensure that all changes made so far

will take effect immediately.

Reload privilege tables now? [Y/n] y

... Success!

Archivo: INSTALACION DE DRUPAL 9 EN UBUNTU 18.04 10 de 12


INSTALACION DE DRUPAL 9 EN Doc.: PR-050-21-DOC-010
UBUNTU 18.04
Rev. No.: 1 02/08/2021

Cleaning up...

All done! If you've completed all of the above steps, your MariaDB

installation should now be secure.

Thanks for using MariaDB!

Confirme la versión de MariaDB:

$ mysql -u root -p

Enter password:

Welcome to the MariaDB monitor. Commands end with ; or \g.

Your MariaDB connection id is 49

Server version: 10.4.6-MariaDB-1:10.4.6+maria~bionic-log mariadb.org binary


distribution

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]>

Verifique la versión usando el comando:

Archivo: INSTALACION DE DRUPAL 9 EN UBUNTU 18.04 11 de 12


INSTALACION DE DRUPAL 9 EN Doc.: PR-050-21-DOC-010
UBUNTU 18.04
Rev. No.: 1 02/08/2021

MariaDB [(none)]> SELECT VERSION();

+------------------------------------------+

| version() |

+------------------------------------------+

| 10.4.6-MariaDB-1:10.4.6+maria~bionic-log |

+------------------------------------------+

1 row in set (0.000 sec)

Archivo: INSTALACION DE DRUPAL 9 EN UBUNTU 18.04 12 de 12

También podría gustarte