Solved

Problem with .htaccess file

Posted on 2016-07-22
4
69 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 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
 

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 77

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

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

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

Suggested Solutions

The purpose of this article is to demonstrate how we can use conditional statements using Python.
If you are a web developer, you would be aware of the <iframe> tag in HTML. The <iframe> stands for inline frame and is used to embed another document within the current HTML document. The embedded document could be even another website.
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 find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:

808 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