Solved

Problem with .htaccess file

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

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 78

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

Visualize your virtual and backup environments

Create well-organized and polished visualizations of your virtual and backup environments when planning VMware vSphere, Microsoft Hyper-V or Veeam deployments. It helps you to gain better visibility and valuable business insights.

Question has a verified solution.

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

If you have a server on collocation with the super-fast CPU, that doesn't mean that you get it running at full power. Here is a preamble. When doing inventory of Linux servers, that I'm administering, I've found that some of them are running on l…
Google Drive is extremely cheap offsite storage, and it's even possible to get extra storage for free for two years.  You can use the free account 15GB, and if you have an Android device..when you install Google Drive for the first time it will give…
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.:
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.

730 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