Virtualhost always redirect to localhost root directory on Mac

Viewed 109

When I am trying to access watheeq.local it returns me to localhost root directory "/Users/abdelrahmanmuntaser/Sites" here exactly, i want to access my website which is located at "/Users/abdelrahmanmuntaser/Sites/watheeq/web", sorry I am newbie at macOS, do I missing something ?

This is my httpd-vhosts.conf

<VirtualHost *:80>
        ServerAdmin webmaster@dummy-host.example.com
        DocumentRoot "/usr/docs/dummy-host.example.com"
        ServerName dummy-host.example.com
        ServerAlias www.dummy-host.example.com
        ErrorLog "/private/var/log/apache2/dummy-host.example.com-error_log"
        CustomLog "/private/var/log/apache2/dummy-host.example.com-access_log" common
    </VirtualHost>
    
    <VirtualHost *:80>
        ServerAdmin webmaster@localhost
        ServerName watheeq.local
        ServerAlias watheeq.local
        DocumentRoot "/Users/abdelrahmanmuntaser/Sites/watheeq/web">
        <Directory "/Users/abdelrahmanmuntaser/Sites/watheeq/web/">
        Options Indexes FollowSymLinks MultiViews
        AllowOverride all
        Require all granted
         </Directory>
        ErrorLog "/private/var/log/apache2/watheeq.local-error_log"
        CustomLog "/private/var/log/apache2/watheeq.local-access_log" com$
    </VirtualHost>
    
    <VirtualHost *:80>
    ServerName localhost
    DocumentRoot /Users/abdelrahmanmuntaser/Sites/
    </VirtualHost>

This is my hosts file

##
# 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   watheeq.local

127.0.0.1  wath.local
::1  wath.local


enter code here
0 Answers
Related