Last post Mar 28, 2018 10:36 PM by robinwilson16
Mar 25, 2018 07:59 PM|robinwilson16|LINK
I have been experimenting with setting up ASP .NET Core websites in Ubuntu and they load correctly with Kestrel if located at:
However they do not work if located here:
In both cases I set the owner of the folder and everything below to the www-data account and assigned 755 permissions:
sudo chown -R www-data:www-data aspnetcore
sudo chmod -R 755 aspnetcore
When checking the status of the error it is:
Is it possible to run an .NET Core website from the home folder? Is it something to do with permissions of the home folder itself?
Mar 27, 2018 06:19 AM|Edward Z|LINK
How did you configure Home and var folder?
After checking the
Host ASP.NET Core on Linux with Nginx, it did not indicate it could not be published to home folder.
If you follow above link, will you receive any error by setting WorkingDirectory with Home Folder?
Mar 28, 2018 10:23 PM|robinwilson16|LINK
My server uses Apache2 rather than Nginx.
Whilst both are supported Microsoft only provide a guide for Nginx.
However I figured it out and got it all running but only from the /var folder.
The issue I am experiencing is with starting the Kestral web server service and not with Apache2 so I don't think it is anything to do with Apache2 but I could be wrong?
If the Kestrel service file points to the var/aspnetcore/SITE folder everything works but if it points to the home/SITE/aspnetcore folder then Kestrel errors with status=200/CHDIR which indicates that it is unable to change to the required folder.
In both cases I have ensured correct permissions have been applied:
The web server hosts different people's websites and I need it to work from their home directories as it does for PHP websites.
Is this a limitation of the current version of .NET Core or is there a way around this?
Mar 28, 2018 10:36 PM|robinwilson16|LINK
I have now found a way to make it work.
So the issue is:
However I have found if I add a symbolic link so that files are stored in 1 and also seen in 2 then Kestrel still works:
sudo ln -s /home/SITE/aspnetcore /var/aspnetcore/SITE
So that way users can upload their files to their home directories but Kestrel also sees them in the var folder and works.
Is this a bug?