Hi,
I developed a Laravel-application (a basic website) and everything is working like a charm on both my Windows 8 PC (running Apache etc.) and on my Ubuntu 14.04-machnine (with the regular LAMP installed). No issues at all.
But now I have installed the exact same application on my Synology-server running Linux 2.6.32.12. I can visit the webserver of Synology by going to http://server from my local machine connected to the Synology-server. I have put the Laravel-files in a folder within the root of webserver (and run composer update and all that). No problems.
If I now visit http://server/myapp/public/ the home-page of my website opens up perfectly. But when I click one of the links I get a 404-error (from the Apache server, not from Laravel). At first I thought it would be an issue with mod-rewrite not being enabled and/or a wrong setting of AllowOverride but both are perfectly all right. I tried a few other solutions (found here or on StackOverflow) but to no avail.
Strange thing is that if I for instance want to visit the index-action of my CockpitController based on the following route:
Route::get('Cockpit/index', 'CockpitController@index');
the following path entered in the web browser results in an 404-error on my Synology server
http://server/myapp/Conckpit/index
but this path works fine:
http://server/myapp/public/Cockpit/index
It must be caused by some configuration-mistake of the Apache-server, of the htaccess-file or anything but after spending a lot of time on getting it resolved I am really hoping somebody else can point me in the right direction. I am close to giving it up altogether.
Thanks for your patience,
Edwin
The url you are trying isn't working because the index file is inside the "public" directory. So if you just manualy remove it from the URL it's expected to fail.
To remove the "public" part from the url you will have to create a Virtual host, which will point to the public directory.
If you are doing this locally, it's easy as:
open terminal
Edit host file
sudo gedit /etc/hosts
127.0.0.1 app.dev
then save and close.
sudo gedit /etc/apache2/sites-available/000-default.conf
And add something like
<VirtualHost *:80>
ServerName app.dev
DocumentRoot /path/to/laravel/public
</VirtualHost>
sudo service apache2 restart
Thanks for your trouble but unfortunately it is not that simple. Synology implemented quite a few changes to the Linux install and not all of them are clear or well documented (if you want to do something out of the ordinary). I have searched long and hard and still haven't found a complete and bullet proof explanation on how to get a VirtualHost up and running on a Synology NAS (at least not for DSM 5).
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community