You are on page 1of 3

Ubuntu Server Deployment

0. Update e Upgrade
sudo apt update && apt upgrade

1. Configurando hostname e hosts


Edite o arquivo hosts :

sudo vim /etc/hosts

127.0.0.1 localhost.localdomain localhost


# This line should be changed to the correct servername:
127.0.1.1 server1.example.com server1
# The following lines are desirable for IPv6 capable hosts
::1 localhost ip6-localhost ip6-loopback
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters

Edite o arquivo hostname :

sudo vim /etc/hostname

server1

2. Instalando o ISPConfig
wget -O - https://get.ispconfig.org | sh -s -- --use-nginx --use-ftp-ports=40110-
40210 --unattended-upgrades

3. Configure um site no ISPConfig


4. Modifique as opções para Laravel Apps
location = /robots.txt {
root {DOCROOT}public; access_log off; log_not_found off; allow all;
}
location / {
root {DOCROOT}public;
try_files $uri $uri/ /index.php?q=$uri&$args;
}

location @php {
try_files $uri =404;
root {DOCROOT}public;
include /etc/nginx/fastcgi_params;
fastcgi_pass unix:/var/lib/php8.2-fpm/{user}.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_intercept_errors off;
}

Atenção: a variável {user} deve ser substituída pelo usário do site

5. Instale NodeJS e NPM


sudo apt-get update
sudo apt-get install -y ca-certificates curl gnupg
sudo mkdir -p /etc/apt/keyrings
curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | sudo gpg -
-dearmor -o /etc/apt/keyrings/nodesource.gpg

NODE_MAJOR=18
echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg]
https://deb.nodesource.com/node_$NODE_MAJOR.x nodistro main" | sudo tee
/etc/apt/sources.list.d/nodesource.list

sudo apt-get update


sudo apt-get install nodejs -y

curl -qL https://www.npmjs.com/install.sh | sh

6. Clone o repositório do App


cd /var/www/example.com/web
git init
git remote add origin git@github.com:Kotchergenko-Engenharia/erp.git
git config --global --add safe.directory /var/www/example.com/web

7. Criando usuário no BD para o App


CREATE USER 'new_root_user'@'localhost' IDENTIFIED BY 'new_root_password';
GRANT ALL PRIVILEGES ON *.* TO 'new_root_user'@'localhost' WITH GRANT OPTION;
FLUSH PRIVILEGES;

Referências
https://www.habibza.in/nginx-directives-ispconfig-laravel/
https://aristides.dev/instalando-laravel-no-painel-ispconfig-3/
https://ruben-vilar.medium.com/how-to-deploy-a-laravel-application-in-ispconfig-
ffa42ba24d93
https://github.com/nodesource/distributions

You might also like