Page 1 of 2 12 LastLast
Results 1 to 10 of 12

Thread: How to restrict the visit to my apache server within a specified IP range?

  1. #1

    Default How to restrict the visit to my apache server within a specified IP range?

    Hi,

    My computer is running SUSE Linux Enterprise Server 11 (x86_64). I have set up an apache server there. The version is Apache/2.2.10 (Linux/SUSE) PHP/5.2.14 with Suhosin-Patch mod_python/3.3.1 Python/.

    It works well. I can reach the server and visit the webpages from other computers. The problem is every computer can visit it. I just want to some people can reach my server by specifying the IP address, or computer name, or whatever else. Do you guy have any idea how I can do it?

    Thanks for any suggestions and comments.

    Davidehs

  2. #2
    Join Date
    Jun 2008
    Location
    Netherlands
    Posts
    29,728

    Default Re: How to restrict the visit to my apache server within a specified IP range?

    I guess you know this is an openSUSE forums and that any answer here is most likely to be based on openSUSE and thus not have to be applicable to your SUSE Linux Enterprise Server?
    Henk van Velden

  3. #3
    Join Date
    Mar 2008
    Location
    Oz
    Posts
    11,731
    Blog Entries
    2

    Default Re: How to restrict the visit to my apache server within a specified IP range?

    Check out this directive: mod_authz_host - Apache HTTP Server
    Leap 42.3 & 15.1 &KDE
    FYIs from the days of yore

  4. #4
    Join Date
    Jun 2008
    Location
    Earth - Denmark
    Posts
    10,730

    Default Re: How to restrict the visit to my apache server within a specifiedIP range?

    On 06/09/2011 02:06 PM, davidehs wrote:

    > My computer is running SUSE Linux Enterprise Server 11 (x86_64).
    > Thanks for any suggestions and comments.


    you are welcome to seek advice here, but BE ADVISED that many of the
    answers might be from folks who have never run SLES (or maybe never even
    heard of it before) and you are likely much better off if you seek
    assistance from the Novell forums, via:
    http://forums.novell.com/novell-prod...e-server-sles/

    same pass/ID as used here works there..

    --
    dd CAVEAT: http://is.gd/bpoMD
    via NNTP openSUSE 11.4 [2.6.37.6-0.5] + KDE 4.6.0 + Thunderbird 3.1.10
    Acer Aspire One D255, 1.66 GHz Atom, 1 GB RAM, Intel Pineview graphics
    * When your gecko is broken you have a reptile dysfunction! *

  5. #5
    Join Date
    Mar 2008
    Location
    Oz
    Posts
    11,731
    Blog Entries
    2

    Default Re: How to restrict the visit to my apache server within a specified IP range?

    To help you understand this, if you put this in e.g. your .htaccess file:
    Code:
      Order deny,allow
      Deny from all
      Allow from 192.168.1.2
    Then only 192.168.1.2 can get a look in.

    Similarly "Allow from 192.168." allows a broader range
    and so on
    Leap 42.3 & 15.1 &KDE
    FYIs from the days of yore

  6. #6
    Join Date
    Mar 2008
    Location
    Oz
    Posts
    11,731
    Blog Entries
    2

    Default Re: How to restrict the visit to my apache server within a specified IP range?

    To all the ppl who think the questioner might be better off elsewhere, this is a question about Apache servers. It would equally well be answered in the Linux Mint forums. Asking it here is just fine because it's a Linux-wide question.
    Leap 42.3 & 15.1 &KDE
    FYIs from the days of yore

  7. #7

    Default Re: How to restrict the visit to my apache server within a specified IP range?

    Hi, hcvv and DenverD,

    Thanks for your reminding. I will ask questions about SLES at the Novell forum in the future.

    Hi Swerdna,

    Thanks for your encouraging and your suggestions.

    Actually, I use both openSUSE and SLES. I have openSUSE on my laptop and run the SLES on the server machine. But I am pretty new with SUSE, and even with linux. I just transferred from a windows system to linux two months ago.

    Now continue my question.
    I could not find the .htaccess file on my computer. So I made one at /srv/www/htdocs/.htaccess, and added the following two lines,
    Order deny,allow
    Deny from all
    into it.

    Then, I stopped and restarted the apache. But my laptop still can access the web pages.
    My laptop and the server machine are both located under the domain of my university. Is this the reason why the access can not be blocked?

    Thanks,

    David

  8. #8
    Join Date
    Jun 2008
    Location
    Netherlands
    Posts
    29,728

    Default Re: How to restrict the visit to my apache server within a specified IP range?

    It is not that we ill discourage you to ask here, but we only want you to know which sort of experst are mainly here. It is up to you to decide where you ask.

    In this case, as Swerdna pointed out, it is a pure Apache2 question and as such operating system independent.

    That said, when you run Apache you should know something about how it canve configured. Thus Swerdna's implication that you know about .htaccess files and where they can be created. Maybe yoy should read a little bit in the Apache docs. They are on the internet as Swerdna pointed you to one of the pages within http://httpd.apache.org/docs/ And when your apache server is running, they are on your own system at http://localhost/manual/
    Henk van Velden

  9. #9
    Join Date
    Jun 2008
    Location
    Netherlands
    Posts
    29,728

    Default Re: How to restrict the visit to my apache server within a specified IP range?

    When you know more about configuring Apache you know that you can also configure these things centraly in /etc/apache2/default-server.conf. E.g. for the DocumentRoot:
    Code:
    <Directory "/srv/www/htdocs">
    Order deny,allow
     Deny from all
     Allow from 10.0.0
     Allow from localhost
    </Directory>
    Henk van Velden

  10. #10
    Join Date
    Mar 2008
    Location
    Oz
    Posts
    11,731
    Blog Entries
    2

    Default Re: How to restrict the visit to my apache server within a specified IP range?

    If you put these lines in
    Order deny,allow
    Deny from all
    Then all is blocked unless /srv/www/htdocs is not the Document Root or some other Directive overrides these lines.


    Presumably you altered the file default-server.conf. Please post here the contents
    and
    Are you using a .conf file in vhost.d? If "yes" then please post here the contents.
    Leap 42.3 & 15.1 &KDE
    FYIs from the days of yore

Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •