Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Problem with .htaccess file

Posted on 2016-07-22
4
Medium Priority
?
97 Views
Last Modified: 2016-09-07
Guys, can you please help me with it ?
I have an .htaccess file where I have:

Require all denied
require ip xxx.xxx.xxx.xxx

I would like to deny access for all and white list specific IPs.

Problem is, that I get that error:

Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator, xxxxxx and inform them of the time the error occurred, and anything you might have done that may have caused the error.

More information about this error may be available in the server error log.
Apache Server at www.xxxxx.com Port 80

Please help
0
Comment
Question by:tp-it-team
  • 2
4 Comments
 
LVL 84

Expert Comment

by:Dave Baldwin
ID: 41724555
This page talks about using IP addresses in .htaccess http://www.htaccess-guide.com/deny-visitors-by-ip-address/   This page will generate some code for you.  http://www.htaccesstools.com/block-ips/   And this page covers a lot of things about .htaccess:  http://www.askapache.com/htaccess/htaccess.html
0
 
LVL 1

Author Comment

by:tp-it-team
ID: 41724564
Sorry, I should mention I'm talking about the recent version of Apache.
AFAIK, these articles are outdated now as these commands are depreciate now.
0
 
LVL 84

Accepted Solution

by:
Dave Baldwin earned 1000 total points
ID: 41725122
It appears that you are correct.  Info is shown on these pages.  Like much of Apache documentation, it is a little vague.  One of the examples at the bottom of the second page shows how it must be formatted using <RequireAll>.  Note that one or more modules must be enabled to use these directives.

https://httpd.apache.org/docs/2.4/howto/access.html
https://httpd.apache.org/docs/2.4/mod/mod_authz_host.html

https://httpd.apache.org/docs/2.4/mod/mod_authz_core.html#require
0
 
LVL 80

Assisted Solution

by:arnold
arnold earned 1000 total points
ID: 41725529
Require is the wrong terminology.Require only applies to users/groups that are included in the htpasswd .


The setting is deny,allow
Deny all
Allow ip
0

Featured Post

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction We as admins face situation where we need to redirect websites to another. This may be required as a part of an upgrade keeping the old URL but website should be served from new URL. This document would brief you on different ways ca…
Introduction This article is intended for those who are new to PHP error handling (https://www.experts-exchange.com/articles/11769/And-by-the-way-I-am-New-to-PHP.html).  It addresses one of the most common problems that plague beginning PHP develop…
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial
Suggested Courses
Course of the Month11 days, 4 hours left to enroll

886 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question