403 Error When Running Catalina (Several Sites)
After upgrading your system to Catalina, you might experience an issue where visiting your websites result in a 403 error. This is because Apple has locked down the Documents folder, and by default, DesktopServer stores your site files in Documents\Websites. The solution for this is to move your files to another directory. There are two methods to do this. If you have a few sites, the easiest way to do this is simply using the "Move" Option within DesktopServer as outlined in this Help Document.
Part I - Moving Your Website Files
- To begin, please be sure that DesktopServer or any of its services are running. If DesktopServer is running, click on the "Stop or restart the web and database services." radio button and then click "Next"
- Click on "Stop the web and database services." --> Next
- Once services are stopped, click "Close
- Check to be sure that all DesktopServer services are stopped as follows:
- Open Applications --> Utilities --> Activity Monitor
- In the search pane, type, "httpd"
- If there are any httpd services listed, select them, click on the "x" in the left-hand corner of the window and then select, "Force Quit"
- The window should show no results for httpd when done
- In the search pane, type, "mysqld"
- If there are any mysqld services listed, select them, click on the "x" in the left-hand corner of the window and then select, "Force Quit"
- Now that you have successfully shut down all DesktopServer services, you will want to move the files for your sites to a new directory.
- Open a new Finder window and navigate to your Documents/Websites Directory
- Select all of your website folders and then press command+c to copy these files
- In Catalina, Apple has created a new default directory for Sites. You can choose to use this directory or you can choose your own, but be sure to take note of where you placed these files.
- To move the files to the new directory, navigate to Users/YourUserName/Sites
- Click Option+Command+v to move the website files to the new directory
Part II - Editing The DesktopServer Preferences File
- In your Finder Window, navigate to /Users/Shared
- Be sure that you can see hidden files. If you do not see a .com.serverpress.desktopserver.json file, press Command+Shift+Dot to show hidden files.
- Open the file .com.serverpress.desktopserver.json in your favorite text editor
- Scroll down until you find the line that says,"documents":"\/private\/var\/root\/Documents\/Websites",
- Change this to read, "documents":"\/Users\/YourUserName\/Sites" (Or you can change this to reflect the directory in which you saved your website files)
- You will find an entry for each site file in your Preferences File. Change the line for each site definition from "\/private\/var\/root\/Documents\/Websites\/YourSiteName" to "\/Users\/YourUserName\/Sites\/YourSiteName"
- Save your Preferences File and close it
- Start up DesktopServer. Your sites should now be available to you.