Alow from "domain" or "ip range"
Posted by: Sebastian B. (---.impt.uni-hannover.de)
Date: December 17, 2015 09:02AM

Dear Community,

I transfered the wamp server from a collegues on my pc. Now I have to change the allow permission. My company work in a domain so i want create a permission for this domain or for an exactly ip range.

I m using Windows 8.1 64 bit, Apache 2.4.9, PHP 5.5.12, mySQL 5.6.17.
Server is still working. Green Button

At the moment the code look like this:

<Directory "d:/wamp/www/">
#
# Possible values for the Options directive are "None", "All",
# or any combination of:
# Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
#
# Note that "MultiViews" must be named *explicitly* --- "Options All"
# doesn't give it to you.
#
# The Options directive is both complicated and important. Please see
# [httpd.apache.org]
# for more information.
#
Options Indexes FollowSymLinks

#
# AllowOverride controls what directives may be placed in .htaccess files.
# It can be "All", "None", or any combination of the keywords:
# AllowOverride FileInfo AuthConfig Limit
#
AllowOverride all

#
# Controls who can get stuff from this server.
#

#PT
Order Deny,Allow
Deny from all
#PT-Computer
Allow from xxx.xx.110.46
#SB-Computer
Allow from xxx.xx.110.47
#AK-Computer
Allow from xxx.xx.110.66
#DK-Computer-1
#Allow from xxx.xx.110.62
#DK-Computer-2
#Allow from xxx.xx.110.1
#IMPT Domain
#Allow from xxx.xx.110.
#End PT


# onlineoffline tag - don't remove
Require all granted

</Directory>

Allow from xxx.xx.110. works but I dont like this solution. Cause I think that we are just have the ip´s 1 to 250 and maybe another group have the rest in this ip section.

I try to find an answer in the internet but i can´t find a solution. I´m trying some combination of xxx.xx.110.1/250 and 1-250. I also try dthe combination with ".domain" but it still not work. sad smiley

Greetings from Germany winking smiley



Edited 1 time(s). Last edit at 12/17/2015 09:06AM by Sebastian B..

Options: ReplyQuote
Re: Alow from "domain" or "ip range"
Posted by: Otomatic (Moderator)
Date: December 17, 2015 10:17AM

Hi,

> Apache 2.4.9
It is not Allow from .... but Require ip
See [httpd.apache.org]

---------------------------------------------------------------
Documentation Apache - Documentation PHP - Documentation MySQL - Wampserver install files & addons

Options: ReplyQuote
Re: Alow from "domain" or "ip range"
Posted by: Sebastian B. (---.impt.uni-hannover.de)
Date: December 17, 2015 10:52AM

Hey,

i´m working in the httpd.conf the allow command will work.
i checked the require command it doenst work. I have to handle it without specific experience in programming.
It´s just a favor for this company not my major part here...

Options: ReplyQuote
Re: Alow from "domain" or "ip range"
Posted by: RiggsFolly (---.as43234.net)
Date: December 17, 2015 12:04PM

Ok take this section of your code and remove it

#PT
Order Deny,Allow
Deny from all
#PT-Computer
Allow from xxx.xx.110.46
#SB-Computer
Allow from xxx.xx.110.47
#AK-Computer
Allow from xxx.xx.110.66
#DK-Computer-1
#Allow from xxx.xx.110.62
#DK-Computer-2
#Allow from xxx.xx.110.1
#IMPT Domain
#Allow from xxx.xx.110.
#End PT

Now lets do it properly, you are using Apache 2.4.x so we will use the new Apache 2.4.x syntax and not the old APache 2.2 syntax



Now find these 2 lines in your httpd.conf file

# onlineoffline tag - don't remove
Require all granted

And replace with this

# onlineoffline tag - don't remove
#Require all granted

Require ip xxx.xx.110

This will alllow any ip in the xxx.xx.110 range access to thsi server.

This range goes from xxx.xx.110.1 to xxx.xx.110.255 there are only 255 ip addresses in a IPV4 subnet


Alternatively you can be specific if you feel you need to be and use specific ip addresses one for each of your group.

# onlineoffline tag - don't remove
#Require all granted

Require ip xxx.xx.110.46
Require ip xxx.xx.110.47
Require ip xxx.xx.110.62



Final Note:

If you leave the Require all granted line in then Anyone in the universe can access your apache server.

---------------------------------------------------------------------------------------------
(Windows 10 Pro 64bit) (Wampserver 3.3.4 64bit) Aestan Tray Menu 3.2.5.4
<Apache versions MULTIPE> <PHP versions MULTIPLE> <MySQL Versions MULTIPLE>
<MariaDB versions MULTIPLE> <phpMyAdmin versions MULTIPLE> <MySQL Workbench 8.0.23>

Read The Manuals Apache -- MySQL -- PHP -- phpMyAdmin
Get your Apache/MySQL/mariaDB/PHP ADDONs here from the WAMPServer alternate Repo
-X-X-X- Backup your databases regularly Here is How dont regret it later! Yes even when developing -X-X-X-

Options: ReplyQuote
Re: Alow from "domain" or "ip range"
Posted by: Sebastian B. (---.impt.uni-hannover.de)
Date: December 17, 2015 04:51PM

Okay,thanks guys.

The "allow from" command will work like the "require" command. "Require host" domain works just on my own pc=server and not on the rest. First i will let it so. I will try it later. At the moment it looks so that isn´t possible to set the permission on an ip-range.

Options: ReplyQuote
Re: Alow from "domain" or "ip range"
Posted by: Otomatic (Moderator)
Date: December 17, 2015 06:09PM

Hi,

> The "allow from" command will work like the "require" command.

ONLY if access_compat_module is loaded by Apache.

---------------------------------------------------------------
Documentation Apache - Documentation PHP - Documentation MySQL - Wampserver install files & addons

Options: ReplyQuote


Sorry, only registered users may post in this forum.