Jump to content


Photo

Permission Denied To Access Root On This Server 403

httpd-vhosts.conf VirtualHost apache

  • Please log in to reply
1 reply to this topic

#1 Whole9Yards

Whole9Yards

    Newbie

  • Member
  • Pip
  • 9 posts
  • Main OS: Windows 7

Posted 30 July 2015 - 09:55 AM

This sould be easy to correct but since I am not handy with the Apache httpd-vhosts.conf commands I would be super happy about some quick help.

 

My original httpd-vhosts.conf file from a previous development environment looks like this.

<VirtualHost *:80>
    DocumentRoot "D:/WEB PROJECTS/WWW"
    ServerName work.webdev
    ServerAlias www.work.webdev

    <Directory "D:/WEB PROJECTS/WWW">
	AllowOverride all
        Options Indexes FollowSymLinks

    	<IfDefine APACHE24>
    		Require local
    		Require ip 192.168.188
	</IfDefine>

	<IfDefine !APACHE24>
		Order Deny,Allow
    		Deny from all
    		Allow from 127.0.0.0/8 localhost ::1 192.168.188
    	</IfDefine>

    </Directory>
</VirtualHost>

When I, instead of using

    	<IfDefine APACHE24>
    		Require local
    		Require ip 192.168.188
	</IfDefine>

	<IfDefine !APACHE24>
		Order Deny,Allow
    		Deny from all
    		Allow from 127.0.0.0/8 localhost ::1 192.168.188
    	</IfDefine>

simply use

	AllowOverride all
        Options Indexes FollowSymLinks
			Require all granted

I can access the root and all my projects fine.

 

However I would like to restrict access to these projects to IP localhost "127.0.0.1" as well as to IPs on the local network starting with "192.168.188....".

 

How would I have to write this for Uniform Server ZeroXI to accept this please?

 

I assume this line is the culprit.

<IfDefine APACHE24>

Any help with this is much appreciated.

 

Thank you.



#2 Whole9Yards

Whole9Yards

    Newbie

  • Member
  • Pip
  • 9 posts
  • Main OS: Windows 7

Posted 30 July 2015 - 10:04 AM

Ok I fixed the permission error by simply deleting the conditional APACHE24 command.

 

Now the httpd-vhosts.conf file looks like this.

<VirtualHost *:80>
    DocumentRoot "D:/WEB PROJECTS/WWW"
    ServerName work.webdev
    ServerAlias www.work.webdev

    <Directory "D:/WEB PROJECTS/WWW">
	AllowOverride all
        Options Indexes FollowSymLinks
			
    	Require local
    	Require ip 192.168.188
		
		Order Deny,Allow
    		Deny from all
    		Allow from 127.0.0.0/8 localhost ::1 192.168.188    	

    </Directory>
</VirtualHost>

However, does this really make sure that only IP 127.0.0.1 as well as all IPs on the local network starting with 192.168.188... are allowed to access root?

 

Are my commands for the httpd-vhosts.conf file correct like this or are these access permission settings wrong?

 

Thank you for confirming this.







Also tagged with one or more of these keywords: httpd-vhosts.conf, VirtualHost, apache

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users