Solved

Problem with .htaccess file

Posted on 2016-07-22
4
86 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 83

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 83

Accepted Solution

by:
Dave Baldwin earned 250 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 79

Assisted Solution

by:arnold
arnold earned 250 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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

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…
It is possible to boost certain documents at query time in Solr. Query time boosting can be a powerful resource for finding the most relevant and "best" content. Of course the more information you index, the more fields you will be able to use for y…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
Suggested Courses

630 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