Solved

Problem with .htaccess file

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

Expert Comment

by:Dave Baldwin
Comment Utility
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
Comment Utility
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 82

Accepted Solution

by:
Dave Baldwin earned 250 total points
Comment Utility
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 76

Assisted Solution

by:arnold
arnold earned 250 total points
Comment Utility
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

Backup Your Microsoft Windows Server®

Backup all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Join & Write a Comment

Setting up Secure Ubuntu server on VMware 1.      Insert the Ubuntu Server distribution CD or attach the ISO of the CD which is in the “Datastore”. Note that it is important to install the x64 edition on servers, not the X86 editions. 2.      Power on th…
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 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…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

762 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now