I am trying to deploy a laravel script on a ubuntu server but have 2 problems.
1-how to remove public from url(from myip/laravel/public/myURL to myip/laravel/myURl)
2-how to protect other file(if a make a get request myip/laravel/.env it show all the content of .env file)
Thank you
1-how to remove public from url(from myip/laravel/public/myURL to myip/laravel/myURl)
2-how to protect other file(if a make a get request myip/laravel/.env it show all the content of .env file)
Thank you
Sep 13, 2018 I would like to run PHPMyAdmin together with Laravel on/phpmyadmin but only the Laravel routes get served to the browser. So any /phpmyadmin would be parsed as a route where it isn't one. I have tried multiple things. Adding my own location /phpmyadmin above the location.php even trying ^ /phpmyadmin to force precedence. I have installed ubuntu16.04 on windows and working just fine, able to access phpmyadmin. I have also installed ubuntu 18.04 because I need to install laravel and it uses php version 7.1. So at the moment doing laravel new my-app on 1804 and using 1604 phpmyadmin and ‘php artisan tinker’ to query the 1604 mysql.
Andi XhafaAndi Xhafa
3 Answers
I suggest you checkout the documentation page on web server configuration.
It gives you suggestion on how to setup Laravel on your server.
Basic steps
![Ubuntu Ubuntu](/uploads/1/2/5/6/125624718/837506283.png)
1) Put your laravel app in a specific folder
2) Point your webserver document root at your_app/public
3) Ensure RWX permissions are correct on the folders.
Especially point 2 will make sure that you cannot call .env file...
KenKen1,28433 gold badges1919 silver badges2828 bronze badges
For the first issue:
If you are using apache2 on your ubuntu server, first, you have to put the laravel files at /var/www/html, to be able change the document root. Then open your /etc/apache2/sites-enabled/000-default.conf (Or whatever file your default site configuration is) look for
and replace it with
DocumentRoot /var/www/html/public
. This points it to the public folder of var/www/html
which should be where your project is.For the second:In your
/etc/apache2/sites-enabled/000-default.conf
file change Options Indexes
under the <Directory>
tag to Options -Indexes
. And finally run sudo a2dismod autoindex
.This should fix your problems for an apache server. Don't forget to restart you apache2 server with
sudo service apache2 restart
.kofoworolakofoworola
You have to put laravel public folder files in www folder and rest are before www folder.
vipinbairagivipinbairagi