Virtual Host directory

Problems with the Mac OS X version of XAMPP, questions, comments, and anything related.

Virtual Host directory

Postby manngo » 02. August 2022 21:43

I have had a lot of trouble setting up my virtual host outside the /Applications/XAMPP/xamppfiles/htdocs directory.

Here is part of the httpd-vhosts file:

Code: Select all
#   XAMPP   australia: australia.example.com
   <VirtualHost *:80>
      ServerName australia.example.com
      ServerAlias australia.example.com
      DocumentRoot "/Volumes/MacintoshData/sites/australia
      ErrorLog logs/australia.log
      CustomLog logs/australia.log combined
      <Directory "/Volumes/MacintoshData/sites/australia">
         Options FollowSymLinks Indexes
         AllowOverride All
         Require all granted
      </Directory>
   </VirtualHost>


When I try, I get the dreaded 403 Access Forbidden! error, with the message to contact the webmaster. That’s me, and I don’t know.

If I set it up for a directory in iCloud, it works. If I set it up in my Documents folder, it doesn’t.

I suspect it has something to do with the User & Group, which I have set to me and various group such as admin, staff and my default group. Nothing helped.

Help!
manngo
 
Posts: 8
Joined: 15. March 2017 05:20
XAMPP version: 7.1.1
Operating System: MacOS 10.12

Re: Virtual Host directory

Postby manngo » 19. August 2022 06:31

Nothing so far … just the sound of crickets …
manngo
 
Posts: 8
Joined: 15. March 2017 05:20
XAMPP version: 7.1.1
Operating System: MacOS 10.12

Re: Virtual Host directory

Postby Nobbie » 19. August 2022 10:14

manngo wrote:I suspect it has something to do with the User & Group, which I have set to me and various group such as admin, staff and my default group. Nothing helped.!


You must set the User and Group of the directory to the same values as the User and Group of the Apache Process. The Apache Process runs with the User and Group as configured in httpd.conf, look for User and Group entry.
Or change the directory permission to 777 with the chmod command (chmod 777 /Volumes/MacintoshData/sites/australia).

And keep in mind, that Apache must also be able to read all parent folders above your australia folder, check all folders /Volumes/MacintoshData/sites and /Volumes/Macintosh and /Volumes if the rights setting is sufficient for Apache to read it.
Nobbie
 
Posts: 13165
Joined: 09. March 2008 13:04

Re: Virtual Host directory

Postby manngo » 20. August 2022 09:54

Nobbie wrote:You must set the User and Group of the directory to the same values as the User and Group of the Apache Process. The Apache Process runs with the User and Group as configured in httpd.conf, look for User and Group entry.
Or change the directory permission to 777 with the chmod command (chmod 777 /Volumes/MacintoshData/sites/australia).

And keep in mind, that Apache must also be able to read all parent folders above your australia folder, check all folders /Volumes/MacintoshData/sites and /Volumes/Macintosh and /Volumes if the rights setting is sufficient for Apache to read it.


I tried chown root:admin to /Volumes/MacintoshData, but it didn’t help.

I noticed that below that the sites and `australia` directories had the same owner and permissions as for the icloud folder, so there’s no difference there.

As for /Volumes, I left it alone, since it’s OK for the icloud directory.
manngo
 
Posts: 8
Joined: 15. March 2017 05:20
XAMPP version: 7.1.1
Operating System: MacOS 10.12

Re: Virtual Host directory

Postby Nobbie » 20. August 2022 17:21

manngo wrote:I tried chown root:admin to /Volumes/MacintoshData, but it didn’t help.


Why did you do that? Thats plain nonsense, i dont think Apache runs as root:admin in Xampp. Thats not what i suggested. Of course that does not help. If you dont do exactly what i told, you wont succeed. Its on you, do what you want.

Why do you ask if you dont want to follow the given advice?
Nobbie
 
Posts: 13165
Joined: 09. March 2008 13:04

Re: Virtual Host directory

Postby manngo » 21. August 2022 23:04

Nobbie wrote:Thats not what i suggested. Of course that does not help.


I have in my httpd.conf file I have User mark, Group admin.

Using Finder, I added RW permissions to admin for MacintoshData, MacintosData/sites and MacintoshData/sites/australia. The user mark already had RW permissions.

Adding permissions to /Volumes via Finder was denied , and I would need to double-check how to do this via Terminal. In any case, as far as I am aware, iCloud is also mounted under /Volumnes, and the default permissions didn’t prevent that from working.

I restarted Apache.

I’m still getting the same error.
manngo
 
Posts: 8
Joined: 15. March 2017 05:20
XAMPP version: 7.1.1
Operating System: MacOS 10.12


Return to XAMPP for macOS

Who is online

Users browsing this forum: No registered users and 34 guests