FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Debian > Debian User

 
 
LinkBack Thread Tools
 
Old 01-05-2009, 11:51 PM
"Zaki Akhmad"
 
Default Restrict Access Virtual Host on Apache2

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hello,

I am trying to restrict access on one of my virtual host which is
running on Apache2 web server. What should I do so that only specific
IP can access this virtual host?

- --
Zaki Akhmad


-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: http://getfiregpg.org

iEYEARECAAYFAkliqvwACgkQI3d58oE7Pt4lNQCfdGahy4kCml 2+2K93SjiaxU/O
H+UAoJfVYMSwNYbXKK0zXVDE2dzR7Pr5
=kral
-----END PGP SIGNATURE-----


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
 
Old 01-06-2009, 12:06 AM
Jeff D
 
Default Restrict Access Virtual Host on Apache2

On Tue, 6 Jan 2009, Zaki Akhmad wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Hello,
>
> I am trying to restrict access on one of my virtual host which is
> running on Apache2 web server. What should I do so that only specific
> IP can access this virtual host?
>

you could add something like this to your vhost conf:
<Directory /path/to/vhost/dir >
Order Deny,Allow
Deny from all
Allow from 1.2.3.4
</Directory>


then restart apache and only hosts coming from 1.2.3.4 will be able to
access the site..


--
8 out of 10 Owners who Expressed a Preference said Their Cats Preferred Techno.


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
 
Old 01-06-2009, 09:00 AM
Tzafrir Cohen
 
Default Restrict Access Virtual Host on Apache2

On Mon, Jan 05, 2009 at 05:06:25PM -0800, Jeff D wrote:
> On Tue, 6 Jan 2009, Zaki Akhmad wrote:
>
> > -----BEGIN PGP SIGNED MESSAGE-----
> > Hash: SHA1
> >
> > Hello,
> >
> > I am trying to restrict access on one of my virtual host which is
> > running on Apache2 web server. What should I do so that only specific
> > IP can access this virtual host?
> >
>
> you could add something like this to your vhost conf:
> <Directory /path/to/vhost/dir >
> Order Deny,Allow
> Deny from all
> Allow from 1.2.3.4
> </Directory>
>
>
> then restart apache and only hosts coming from 1.2.3.4 will be able to
> access the site..

Or similar directives in the <VirtualHost> context.

--
Tzafrir Cohen | tzafrir@jabber.org | VIM is
http://tzafrir.org.il | | a Mutt's
tzafrir@cohens.org.il | | best
ICQ# 16849754 | | friend


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
 
Old 01-06-2009, 10:34 AM
"Zaki Akhmad"
 
Default Restrict Access Virtual Host on Apache2

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Tue, Jan 6, 2009 at 8:06 AM, Jeff D wrote:

> you could add something like this to your vhost conf:
>
> Order Deny,Allow
> Deny from all
> Allow from 1.2.3.4
>

I am using Apache 2, so I add on sites-availabe directory


ServerAdmin za@design.paume.itb.ac.id
ServerName blaba.zup-zup.xxx.ac.id
DocumentRoot /var/lib/mediawiki

Order Deny,Allow
Deny from all
Allow from x.x.x.x/16

LogLevel warn
ErrorLog /var/log/apache2/error-wiki.log
CustomLog /var/log/apache2/access-wiki.log common

ServerSignature Off



But then when I reload it....
# /etc/init.d/apache2 reload
Syntax error on line 6 of /etc/apache2/sites-enabled/wiki:
order not allowed here
...fail!



- --
Zaki Akhmad


-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: http://getfiregpg.org

iEYEARECAAYFAkljQbEACgkQI3d58oE7Pt7wVwCdESEuZOdRPl PonwW7mXV36ftN
IHoAoII9etd89oQWaa0EUIddUR4V0K8s
=SVfV
-----END PGP SIGNATURE-----


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
 
Old 01-08-2009, 01:39 AM
Jeff D
 
Default Restrict Access Virtual Host on Apache2

On Tue, 6 Jan 2009, Zaki Akhmad wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> On Tue, Jan 6, 2009 at 8:06 AM, Jeff D wrote:
>
> > you could add something like this to your vhost conf:
> >
> > Order Deny,Allow
> > Deny from all
> > Allow from 1.2.3.4
> >
>
> I am using Apache 2, so I add on sites-availabe directory
>
>
> ServerAdmin za@design.paume.itb.ac.id
> ServerName blaba.zup-zup.xxx.ac.id
> DocumentRoot /var/lib/mediawiki
>
> Order Deny,Allow
> Deny from all
> Allow from x.x.x.x/16
>
> LogLevel warn
> ErrorLog /var/log/apache2/error-wiki.log
> CustomLog /var/log/apache2/access-wiki.log common
>
> ServerSignature Off
>
>
>
> But then when I reload it....
> # /etc/init.d/apache2 reload
> Syntax error on line 6 of /etc/apache2/sites-enabled/wiki:
> order not allowed here
> ...fail!
>
>
>
> - --
> Zaki Akhmad


try changing it to:

<Directory "/var/lib/mediawik/" >
Order Deny,Allow
Deny from all
Allow from x.x.x.x/16
</Directory>

--
8 out of 10 Owners who Expressed a Preference said Their Cats Preferred Techno.


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
 

Thread Tools




All times are GMT. The time now is 07:18 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org