简体   繁体   中英

Deploying Laravel 5 on a server

I am trying to deploy a larval project on my Sinology NAS so it could be available externally. Locally everything is working fine. However when i copy my project in my NAS, I simply get a 404 error.

Here is what I have checked: 1. Database connection. 2. Settings in config/app.php . 3. php artisan route:list is also working fine.

Yet, I am unable to get this to work. Any suggestions?

Update:

By changing my public/.htaccess from: Options -MultiViews to Options +Indexes gives the home page, but no other re-direction works.

Don't forget to add "/public" after your address site, so like this: "www.example.com/public/...". Is it your problem?

Or you can change your laravel project to debug mode by change debug variable in config/app.php to true , so your laravel project can show the error message.

After a few trials, finally got it to run on DS215j.

edit /etc/httpd/sites-enabled-user/httpd-vhost.conf-user

<VirtualHost *:80>
  ServerName laravel.iw.com
  DocumentRoot "/var/services/web/laravel/public"
  ErrorDocument 403 "/webdefault/error.html"
  ErrorDocument 404 "/webdefault/error.html"
  ErrorDocument 500 "/webdefault/error.html"
</VirtualHost>

restart synology!

edit your local host 192.168.1.xxx laravel.iw.com

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM