Access forbidden - 403 error - VirtualHost

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

Access forbidden - 403 error - VirtualHost

Postby utqi » 19. May 2023 18:43

Good afternoon,
I am trying to set up virtual hosts as instructed

http://localhost/dashboard/docs/configure-vhosts.html

I later used https://community.apachefriends.org/f/viewtopic.php?f=29&t=82712 to set up, but nothing happens.
I get an error Access denied.
https://shottr.cc/s/OPHo/SCR-20230519-k2r.png

Here is data:

/Applications/XAMPP/xamppfiles/etc/extra/httpd-vhosts.conf
Code: Select all
# Virtual Hosts
#
# Required modules: mod_log_config

# If you want to maintain multiple domains/hostnames on your
# machine you can setup VirtualHost containers for them. Most configurations
# use only name-based virtual hosts so the server doesn't need to worry about
# IP addresses. This is indicated by the asterisks in the directives below.
#
# Please see the documentation at
# <URL:http://httpd.apache.org/docs/2.4/vhosts/>
# for further details before you try to setup virtual hosts.
#
# You may use the command line option '-S' to verify your virtual host
# configuration.

#
# VirtualHost example:
# Almost any Apache directive may go into a VirtualHost container.
# The first VirtualHost section is used for all requests that do not
# match a ServerName or ServerAlias in any <VirtualHost> block.
#

<VirtualHost *:80>
    ServerAdmin webmaster@dummy-host2.example.com
    DocumentRoot "/Applications/XAMPP/xamppfiles/docs/dummy-host2.example.com"
    ServerName dummy-host2.example.com
    ErrorLog "logs/dummy-host2.example.com-error_log"
    CustomLog "logs/dummy-host2.example.com-access_log" common
</VirtualHost>

<VirtualHost *:80>
    ServerName jurgau.local
    DocumentRoot /Users/narzan/web/jurgau
    <Directory /Users/narzan/web/jurgau>
        Options Indexes FollowSymLinks
        AllowOverride All
        Require all granted
    </Directory>
</VirtualHost>

<VirtualHost *:80>
    ServerName narzan.net
    DocumentRoot /Users/narzan/web/narzan.net
    <Directory /Users/narzan/web/narzan.net>
        Options Indexes FollowSymLinks
        AllowOverride All
        Require all granted
    </Directory>
</VirtualHost>


/etc/hosts/
Code: Select all
##
# Host Database
#
# localhost is used to configure the loopback interface
# when the system is booting.  Do not change this entry.
##
127.0.0.1   localhost
255.255.255.255   broadcasthost
::1   localhost
127.0.0.1   dummy-host2.example.com
127.0.0.1   jurgau.local
127.0.0.1   narzan.net


What am I doing wrong?
utqi
 
Posts: 2
Joined: 19. May 2023 18:28
XAMPP version: 8.2.4
Operating System: 13.3.1 (a) (22E772610a)

Re: Access forbidden - 403 error - VirtualHost

Postby Nobbie » 20. May 2023 11:31

Error 403 means, that Apache cannot access the requested file or path. Probably the DocumentRoot. Your DocumentRoot seems to be your home folder, Apache is running with a different UserId and Group than yours and probably cannot access your files. You have to grant at least read access to the Apache User (or Group) for the DocumentRoot. See httpd.conf and lookup the setting of "User" and "Group", these are the User and Group for the Apache Process.
Nobbie
 
Posts: 13176
Joined: 09. March 2008 13:04

Re: Access forbidden - 403 error - VirtualHost

Postby utqi » 20. May 2023 16:29

Thank you for help!
utqi
 
Posts: 2
Joined: 19. May 2023 18:28
XAMPP version: 8.2.4
Operating System: 13.3.1 (a) (22E772610a)

Re: Access forbidden - 403 error - VirtualHost

Postby dckchk » 11. September 2023 22:57

I have this same problem after a straightforward install of xampp 8.1.17. on Mac OS Ventura with Joomla 4
I installed xampp with no problem and created my database "ccorch" in phpMyAdmin.
I then downloaded Joomla 4, unzipped and copied the Joomla_4.3.4-Stable-Full_Package.zip file to the htdocs directory
I then renamed "Joomla_4.3.4-Stable-Full_Package" to "ccorch".
I then expected to be able to open the web page "localhost/ccorch/" but I find the local server returning the 403 error.
I thought I was doing all this as the root user and special authorization should not be necessary.
Nevertheless I have investigated the permissions and not found them incorrect.
None of the responses to other posters have been helpful to me and none of the posted tutorials or videos have indicated the need for special user creation
It seems to me that I should not be having so much trouble making a plain vanilla installation of a joomla site on xampp.
dckchk
 
Posts: 5
Joined: 11. September 2023 22:12
Location: MA
XAMPP version: 8.2.4
Operating System: Mac OS Ventura 13.5.2


Return to XAMPP for macOS

Who is online

Users browsing this forum: No registered users and 41 guests