Skip to content

Instalação do Debian 9

Quijaua edited this page Dec 12, 2019 · 13 revisions

Instalando PHP 7.2

apt install apt-transport-https lsb-release ca-certificates
wget -O /etc/apt/trusted.gpg.d/php.gpg https://packages.sury.org/php/apt.gpg
echo "deb https://packages.sury.org/php/ $(lsb_release -sc) main" > /etc/apt/sources.list.d/php.list
apt update
apt upgrade

Instalando o Composer

apt install wget php7.2-cli php7.2-zip unzip curl
curl -sS https://getcomposer.org/installer |php
mv composer.phar /usr/local/bin/composer

Setup

apt-get install apache2 mysql-server php7.2-mysql libapache2-mod-php7.2 git-core php7.2-mbstring php7.2-xml php7.2-gd

Configuração no Apache2

Em /etc/apache2/sites-enabled/biko.edu.conf insira os dados abaixo:

<VirtualHost *:80>
  ServerName biko.edu
  DocumentRoot /var/www/html/biko/public/

    <Directory /var/www/html/biko/public/>
        Options Indexes FollowSymLinks MultiViews
        AllowOverride All
        Require all granted
    </Directory>
</VirtualHost>

Configuração no PHP

Em /etc/php/7.2/apache2/php.ini altere os campos:

post_max_size = 22M
upload_max_filesize = 22M

Criando banco de dados

create database biko;
grant all on biko.* to biko@localhost identified by 'secret';
flush privileges;

Instalando biko

cd /var/www/html/
git clone https://github.com/Quijaua/biko.git
cd biko
cp .env.example .env

Insira as informações do banco de dados no arquivo .env, em DB_DATABASE, DB_USERNAME, DB_PASSWORD.

composer install
php artisan key:generate
composer require doctrine/dbal
php artisan migrate
php artisan storage:link
chown -R www-data: ../biko
php artisan config:cache
a2enmod rewrite
a2dissite 000-default.conf
/etc/init.d/apache2 restart

Criando usuário administrativo

INSERT INTO `users` (`id`, `name`, `email`, `email_verified_at`, `password`, `role`, `remember_token`, `created_at`, `updated_at`) VALUES ('1', 'Admin', '[email protected]', '2019-10-23 00:57:23', ENCRYPT('suasenha'), 'administrador', NULL, '2019-10-23 00:57:23', '2019-10-23 00:57:23');

Referência