Skip to content

Instantly share code, notes, and snippets.

@diegobarros0701
Last active December 24, 2021 01:19
Show Gist options
  • Save diegobarros0701/7b1662414841c21abab49da9e7a3cd6e to your computer and use it in GitHub Desktop.
Save diegobarros0701/7b1662414841c21abab49da9e7a3cd6e to your computer and use it in GitHub Desktop.
Instalar PHP + Apache + Configurações

Configurações para Ubuntu

Atualizar pacotes

sudo apt-get update && sudo apt-get upgrade

Instalar Apache

sudo apt install apache2

Instalar PHP 7.2

sudo add-apt-repository -y ppa:ondrej/php
sudo apt update -y
sudo apt-get install php7.2 php7.2-curl php7.2-pgsql php7.2-common php7.2-cli php7.2-fpm php7.2-gd php7.2-json php7.2-mbstring php7.2-mcrypt php7.2-soap php7.2-xml libapache2-mod-php7.2

Habilitar módulo do PHP

sudo a2enmod php7.2

Habilitar módulo rewrite

sudo a2enmod rewrite

Atualizar permissões das pasta dos sites do Apache

sudo chmod 755 /var/www/html
sudo chown $USER:www-data /var/www/html

Atualizar permissões do projeto

sudo chmod 755 -R /var/www/html/nome-do-projeto
sudo chown $USER:www-data -R /var/www/html/nome-do-projeto

Configurar virtual host

sudo nano /etc/apache2/sites-available/e-estado.conf

Adicionar o seguinte conteúdo no arquivo:

<Directory /var/www/html/novo-e-estado>
    Options Indexes FollowSymLinks MultiViews
    AllowOverride All
    Require all granted
</Directory>

Habilitar a configuração do site e reiniciar o Apache

sudo a2ensite e-estado
sudo service apache2 restart
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment