mkarakaya's avatar

Should i upload env file to server?

Hi, i'm deploying new project to centos server. Should i upload env file too? Sometimes google indexes env files and secret informations will be appear in description. What we need to do? (like add Deny from all to httpd.conf etc...)

0 likes
14 replies
Sinnbeck's avatar
Sinnbeck
Best Answer
Level 102

As the .env resides outside of the public folder, there is no way for google to reach it. :)

mkarakaya's avatar

I uploaded public folder to html directory and added inside storage sym link for project/storage/app/public folder. Is that right? main project folder in /var/www folder not /var/www/html And i have another problem. I will create another thread for it. Thanks :)

Sinnbeck's avatar

are you on shared hosting? (laravel can be a bit of a pain to get running there but it is possible)

Sinnbeck's avatar

I put my files in /var/www/projectname (well i let git do that for me)

I then just run php artisan storage:link inside the folder, to make the symlink for me :)

mkarakaya's avatar

I run php artisan storage:link in main project folder or var/www/html folder?

Sinnbeck's avatar

Project folder. Ignore the html directory. You don't need to use it for anything. It is just there to show that the webserver works

mkarakaya's avatar

What about httpd cofig? What settings should I use for directory or Allow from? Directory should at /var/www/project/public or?

mkarakaya's avatar

i changed directories to /var/www/project/public on httpd config. Main page is working but /login routes etc returns 403 error.

Sinnbeck's avatar

Directory is correct search for laravel virtual host and you will get multiple examples (I use nginx myself)

mkarakaya's avatar

Actually login not a folder. Just route in web.php.

mkarakaya's avatar

I't worked. Thanks. But i have login folder in public folder and i have /login route too. When i enter login it's tries to redirect me login folder and getting 403 error normally. I changed login folder name to loginAsset It's that true way?

Sinnbeck's avatar

Yes never have a route with the same name as a route. Move your assets to sub folders (gfx, js, css, images etc)

1 like

Please or to participate in this conversation.