Changed my domain,Created a new config file and now I get a HTTP 500 error

I change my domain name a while ago and I am just now getting around to updating my Invoice Ninja server. I created a new config file to reflect the domain name change and point it to my existing site folder and now I get the “This page isn’t working is currently unable to handle this request. HTTP error 500.”
The new config file has a link in sites-enabled, I double checked the site folder permissions were set to 755.
I’m not sure where to go from here.

are there any errors in storage/logs/


chris@server1:/var/www/html/ininja/storage/logs$ cat laravel-error.log
[2020-04-04 08:03:55] production.ERROR: Symfony\Component\Debug\Exception\FatalErrorException [64] : /var/www/html/ininja/app/Providers/RouteServiceProvider.php [Line 76] => App\Providers\RouteServiceProvider::App\Providers{closure}(): Failed opening required ‘/var/www/html/ininja/routes/api.php’ (include_path=’.:/usr/share/php’) {“context”:“PHP”,“user_id”:0,“account_id”:0,“user_name”:"",“method”:“GET”,“user_agent”:“Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.162 Safari/537.36 Edg/80.0.361.109”,“locale”:“en”,“ip”:“”,“count”:1,“is_console”:“no”,“is_api”:“no”,“db_server”:“mysql”,“url”:“login”} []

chris@server1:/var/www/html/ininja/storage/logs$ cat stacktrace.log
2020-04-04 08:03:55 App\Providers\RouteServiceProvider::App\Providers{closure}(): Failed opening required ‘/var/www/html/ininja/routes/api.php’ (include_path=’.:/usr/share/php’): #0 {main}

So the path for the file it can’t open does not exist. I left some info out last night. Before I started messing with it. I made a copy of the html/invoiceninja folder and named in ininja. The new config file points to that instead of the origianl one. Apparently all the folders did not copy to the newly named ininja folder. I went through and made sure all the sub-folders were copied over. I still get the same error though.

Might be a dumb question, but did you change the APP_URL line in your .env file to match the new domain?

Also might be a good idea to change the permissions to 775, and double check that the owner is the user created by the webserver. For apache, that’s usually www-data, which is in the www-data group.

755 means the owner is allowed full access, but everyone else only gets read and execute permissions. 775 allows full access to both the owner and the group they belong to, while the rest of the system only gets read/execute.

As Titanfail mentions, make sure the new location is read/writable by the webserver users, try again and check your logs.

Not a dumb question. I had not changed the URL in .env file, I have since; and I tried changing the permissions to 775. Still no luck.

I discovered a bigger problem. The file count does not match. ~/invoiceninja = 35095 and ~/ininja = 34832… So when I copied the files over, I did not get everything. I am only mediocre with regards to my Linux skills. When I copied the file I used the following command: sudo cp -R ~/olddir/ ~/newdir/. It apparently did not copy all the files over. In hind sight maybe I should have just pointed the new config file to the old directory. I tried it and that did not work either.

So I pointed my config file back to the original html directory. Now I get “404 Not Found
nginx/1.14.0 (Ubuntu)”.

Well that’ll teach to stop working on stuff in the middle of the night half asleep. Thanks to everyone that contributed. Although I still don’t know why I was unable to copy the original html directory in it’s entirety using the recursive switch -R; I was able to get the site back up by pointing my config file back to the original html directory. The 404 error in my last post was the result of a typo in the html directory path.

Thanks again everybody…