Last active
February 4, 2022 18:46
-
-
Save wisusdev/7c59a49faf134da1c57147af3fd6bfc8 to your computer and use it in GitHub Desktop.
Guia para instalar Laravel en Ubuntu Server
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Guía de instalación de laravel en Linux (Ubuntu) con Apache, MariaDB y PHP (LAMP) | |
/***** Actualizamos e instalamos algunos paquetes *****/ | |
sudo apt update | |
sudo apt install git zip | |
/***** Instalamos Apache2 *****/ | |
sudo apt install apache2 | |
sudo ufw app list | |
sudo ufw allow in "Apache" | |
/***** Instalamos MariaDB y configuramos nuevo usuario, contrasenia y privilegios *****/ | |
sudo apt install mariadb-server | |
sudo mysql_secure_installation | |
sudo mysql | |
CREATE USER '_nuevo_usuario_'@'localhost' IDENTIFIED BY '_contrasenia_de_nuevo_usuario_'; | |
GRANT ALL PRIVILEGES ON * . * TO '_nuevo_usuario_'@'localhost'; | |
FLUSH PRIVILEGES; | |
/**** Instalamos la ultima version disponible de PHP y algunas extenciones necesarias *****/ | |
sudo apt install php libapache2-mod-php | |
sudo apt install php-mysql php-xml php-mbstring php-gd php-zip php-curl php-gmp php-imagick | |
sudo systemctl restart apache2 | |
/***** Configure Apache with PHP-FPM *****/ | |
sudo apt update | |
sudo apt install php-fpm libapache2-mod-fcgid | |
sudo a2enmod proxy_fcgi setenvif | |
sudo a2enconf php-fpm | |
systemctl restart apache2 | |
/***** Instalamos COMPOSER *****/ | |
cd ~ | |
curl -sS https://getcomposer.org/installer -o composer-setup.php | |
sudo php composer-setup.php --install-dir=/usr/local/bin --filename=composer | |
/***** Clonacion de tu proyecto *****/ | |
cd /var/www/html | |
git clone https://github.com/usuario/nombre_de_tu_proyecto.git | |
/***** Permisos necesarios para tu proyecto *****/ | |
cd nombre_de_tu_proyecto | |
composer install | |
cp .env.example .env | |
/***** Permisos a directorios *****/ | |
sudo chown -R www-data: storage | |
sudo chmod -R 755 storage | |
sudo chown -R www-data: bootstrap/cache | |
sudo chmod -R 755 bootstrap/cache | |
/***** Creamos nuestro VirtualHost *****/ | |
sudo nano /etc/apache2/sites-available/nombre_de_tu_vh.conf | |
<VirtualHost *:80> | |
ServerAdmin webmaster@localhost | |
ServerName appname.com | |
ServerAlias www.appname.com | |
DocumentRoot /var/www/html/nombre_de_tu_proyecto/public | |
<Directory "/var/www/html/nombre_de_tu_proyecto/public"> | |
Options -Indexes +FollowSymLinks +MultiViews | |
AllowOverride All | |
Require all granted | |
</Directory> | |
ErrorLog ${APACHE_LOG_DIR}/error.log | |
CustomLog ${APACHE_LOG_DIR}/access.log combined | |
</VirtualHost> | |
sudo a2enmod rewrite | |
sudo a2ensite nombre_de_tu_vh | |
sudo a2dissite 000-default | |
sudo apache2ctl configtest | |
sudo service apache2 reload | |
/**** Instalar Certbot para Apache *****/ | |
sudo apt-get install certbot python3-certbot-apache | |
sudo ufw status | |
sudo ufw allow 'Apache Full' | |
sudo certbot --apache | |
sudo certbot renew --dry-run |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment