How to configure laravel project on Ubuntu VPS Server?

0

I currently have a laravel project hosted on a vps server in the following path "/ var / www / html" but I have the disadvantage that only when I enter the IP address is it: link shows me the index of apache2 which is the one that comes by default when having the server configuration done.

So to access my laravel project, I must do it in the following way: link to the project.

my query is: How do I enter the ip only link by default and enter the laravel project that I have configured?.

As I understand it, I must enter the link file, but in my case only the apache2.conf file appears

Please, if someone could help me to make this configuration, I would be grateful in advance.

    
asked by JG_GJ 18.03.2018 в 04:06
source

1 answer

3

You have to edit the file 000-default.conf located in /etc/apache2/sites-available , search DocumentRoot and change the address that appears next.

Example: DocumentRoot /La/Ubicacion/Del/Proyecto

Then you will need to restart apache: sudo service apache2 restart

In case you get an error, you should edit apache2.conf located in /etc/apache2 and look something similar to this

<Directory />
    Options Indexes FollowSymLinks
    AllowOverride All
    Require all denied
</Directory>

And within modifying the line of Options adding Includes ExecCGI , said should be like this.

<Directory />
    Options Indexes FollowSymLinks Includes ExecCGI
    AllowOverride All
    Require all denied
</Directory>


A bit off topic, but do you really need to change the default directory? because you can temporarily move or copy your folder, with the commands mv to move or cp to copy, delete the contents of var / www / html with the command rm

Example

$ mv var/www/html/proyecto_lavarel ~/Desktop
$ sudo rm -rf /var/www/html/*
    
answered by 18.03.2018 / 04:34
source