October 7, 2019 at 11:05 pm #22131
I’m installing here at home to trial before pushing to my business server. My home server doesn’t have a fqdn, but runs on it’s own IP address.
I initially ran into many “forbidden” errors when trying to set Ninja up, and I was pulling out my hair. Finally, I was able to get to the setup screen, but it’s not right.
My server is on <ipaddress>, Invoice Ninja is at <ipaddress>/htdocs/ninja/
Pointing a web page to <ipaddress>/htdocs/ninja gives me the “forbidden” error, however pointing to <ipaddress> gives me the Invoice Ninja setup screen! That’s of course NOT what I want. I want to get the setup screen at <ipaddress>/htdocs/ninja (and maybe /public).
I’ve read a few forum posts where folks want to do what I’m doing, but not succeeding. Has anyone done this successfully, and what do I need to change?
I’m happy to provide logs or whatever else is needed. My business server hosting provider is 1and1. I’m not sure what I’m going to need for this to work there, but I’d like to get it working locally first.
Thanks in advance!October 8, 2019 at 12:00 am #22132
It sounds like your root folder is already set to
/htdocs/ninja, so when you go to
http://addressit works because it’s pointing to
/htdocs/ninja. But when you try to go to
http://address/htdocs/ninja, nginx thinks you’re wanting to go to /htdocs/ninja/htdocs/ninja.
Ideally, you want root (or DocumentRoot if using Apache) to point to
/ninja/public. This is because if you’re pointing anywhere higher up, anyone could simply pull up
http://yourURL/.envand see all of your credentials. Setting the DocumentRoot to /public and having the .env file above that prevents just such things.
It is possible to install Laravel applications in subfolders, but it requires putting certain assets outside of the main folder, and modifying /public/index.php to point to those. And all those changes would be lost when updating.
What you might want to consider instead (if you already have other stuff running on the webserver) is installing Invoice Ninja in a subdomain instead of a subfolder. So instead of
http://address/ninja/, you would have something like
http://ninja.address. That involves customizing DNS entries and other things outside of my expertise, but would be a much better alternative.October 8, 2019 at 8:42 pm #22148
Thank you! Really good thoughts.
I changed my root to
/ninja/public, and…the whole site came down. Even with this, I think you’ve got me on the right track. I have a better idea how things are working.
I’ll look into the subdomain idea; though of course that won’t work on my internal server.October 9, 2019 at 12:47 am #22149
You must be logged in to reply to this topic.