Virtual host “Forbidden You don't have permission to access / on this server” on debian

5,163

Once you activate virtualhost you need to reconfigure localhost as virtualhost. You can simply copy-paste httpd.conf parameters.

Share:
5,163

Related videos on Youtube

ulduz114
Author by

ulduz114

Updated on September 18, 2022

Comments

  • ulduz114
    ulduz114 over 1 year

    Before I created a virtual host I could see "http://localhost", but when I created a virtual host I could not see "http://localhost" and my virtual host "http://test"

    Here is my virtualhost config file:

    <VirtualHost test:80>
    
            ServerAdmin [email protected]
            ServerName  test
            ServerAlias test
    
      DocumentRoot "/home/javad/Public/test/public"     
    <Directory  "/home/javad/Public/test/public/" >
     Options Indexes FollowSymLinks
     MultiViews ExecCGI     
     DirectoryIndex index.php   
     AllowOverride all 
     Order    allow,deny 
     allow from all
    </Directory>
    
      </VirtualHost>
    

    so I ran a2ensite test

    and added

    127.0.0.1 test to /etc/hosts file and restart apapche2 fine

    But after that I cannot access to http://test or even http://localhost i get

    Forbidden You don't have permission to access / on this server.
    

    When I delete my virtual host setting I can access http://localhost

  • ulduz114
    ulduz114 about 13 years
    i have index file ,and why i could access to localhost when delete setting of test irtual host
  • muffinista
    muffinista about 13 years
    Without the vhost entry you can get to your server because you're accessing it via the default non-vhost setup. Joe is probably right about the permissions issue, can you confirm that you checked that?
  • ulduz114
    ulduz114 about 13 years
    i ran "chmod -R 755 test" command to /home/javad/Public/test/public folder and /etc/www floders but still can not access to test or localhost
  • The Shurrican
    The Shurrican about 13 years
    its not possible to reliably determine the problem here. please your configuration files (server config including all vhosts and other user specific files if any). please paste them to some external service to keep it tidy. also supply the output or your access and error logfile(s).