LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices



Reply
 
Search this Thread
Old 01-08-2013, 07:03 PM   #1
lovesuicide
LQ Newbie
 
Registered: Dec 2012
Posts: 7

Rep: Reputation: Disabled
setting up ACL for first time on Apache


Hi all,

I'm an Apache2 newbie and I was wanting to set up an ACL on my webserver that blocks out all connections, except for those pass a specific phrase in the host header.

I've never set up an ACL before, let alone one with the host requirement. If anybody can give me some ideas, I would be most appreciative.

Thanks!
 
Old 01-08-2013, 08:31 PM   #2
lovesuicide
LQ Newbie
 
Registered: Dec 2012
Posts: 7

Original Poster
Rep: Reputation: Disabled
I did some research and I think this is something pretty close to what I need to add to my apache2.conf file. Does this look right?

<VirtualHost>
...
Order deny,allow
Deny from all
Allow from 127.0.0.0/255.0.0.0 ::1/128
Allow from .example.com
...
</VirtualHost>

If so, how can I add the host header as an allow parameter?
 
Old 01-09-2013, 05:00 PM   #3
lovesuicide
LQ Newbie
 
Registered: Dec 2012
Posts: 7

Original Poster
Rep: Reputation: Disabled
First I tried this:

<Directory /var/www/>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order deny,allow
deny from all
allow from passphrase
</Directory>

But the host header had to be a full domain, so that didn't work. I tried to do this:


SetEnvIf Custom-Header
passphrase
<Directory /var/www/>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order deny,allow
deny from all
allow from env=passphrase
</Directory>

But it errors out. Not sure how to set up a custom header value. Once I figured that out, I think I'm good. Does anybody have any ideas?

root@XXX:/etc/apache2/sites-enabled# sudo service apache2 restart
Syntax error on line 11 of /etc/apache2/sites-enabled/www.xxxx.com:
Missing regular expression for SetEnvIf
Action 'configtest' failed.
The Apache error log may have more information.
...fail!
 
  


Reply

Tags
acl, apache authentication


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
setting ACL recursively amar.sree Linux - Newbie 4 11-06-2012 07:05 AM
Date Time ACL in squid for Local time thetzawko Linux - Server 1 10-20-2009 07:58 PM
question setting acl's. extendedping Linux - Software 1 01-25-2008 05:59 AM
setting acl in aix manoj.linux AIX 0 10-08-2007 11:31 PM
Need help setting up an ACL flibby Linux - Security 3 01-17-2006 11:21 PM


All times are GMT -5. The time now is 08:18 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration