We will do an installation from scratch of your project, (I believe it is the best way):
Access your project from the terminal ssh
, navigate to the directory www (usually stays within /var/www/
)
Inside the clone directory your project with the following command:
$ git clone https://github.com/thiagomrvieira/pinheiro.git
After completion access the project directory (pinheiro
)
$ cd pinheiro
Create the file .env
(I saw that did not commit the .env.example
(click on the link to see the template))
After creation edit to add database settings and etc.
Or you can define this information from .env
also inside the directory config/database.php
or config/app.php
and etc..
Install packages with the following command from commiserate:
composer install
Wait for it to finish we will create the project key for this run the following command below, to generate the new key:
php artisan key:generate
Ready now we have the project configured and ready to start importing the tables with the migrate
:
php artisan migrate
Wait for command to complete if no error occurs the database has already been imported.
You can test with the command:
php artisan serve --host 127.0.0.1
The --host 127.0.0.1
is an optional parameter for you to determine the server ip (necessary in external connections).
Okay, with the functional application, now let’s go to the Linux, and for that we will work with virtual hosts. I believe this is the best way to do this.
Access the directory /etc/apache2/sites-enabled/
create a file with your domain name finished by .conf
except: abcd.com.br.conf
, I usually already have a model ready here and I will use it as an example.
<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 [email protected]
DocumentRoot /var/www/AdmMedico/public
ServerName pinheiro.com.br
ServerAlias www.pinheiro.com.br
# 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
# after it has been globally disabled with "a2disconf".
#Include conf-available/serve-cgi-bin.conf
<Directory "/var/www/pinheiro/public">
AllowOverride All
</Directory>
</VirtualHost>
# vim: syntax=apache ts=4 sw=4 sts=4 sr noet
I’ve already kind of set it up for your case, assuming you use the domain name pine.com.br, if it is not change for its use.
Creating just restart the apache service and it’s ready,
service apache2 restart
Now just access by pinheiro.com.br
that will load the page as it should.
For more information on Virtual Host
hosting and shared or is a VPS ?
– Bulfaitelo
It is on an own company server, available for this application.
– Thiago Maciel
Which operating system ? and has git in it ?
– Bulfaitelo
Debian 9 Com git
– Thiago Maciel
the project has been uploaded to some git ?
– Bulfaitelo
Yes. Ta here: [email protected]:thiagomrvieira/pinheiro.git
– Thiago Maciel
I will answer with a step by step for you to raise this project
– Bulfaitelo