Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Disable apache eth listening?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
RangerDude
Guru
Guru


Joined: 19 Apr 2003
Posts: 301

PostPosted: Thu Oct 30, 2003 10:48 pm    Post subject: Disable apache eth listening? Reply with quote

How can I make apache only listening on localhost, and no eth's?
It's because my dev server pages shouldn't be reachable from the outside of the local host for security reasons.
Back to top
View user's profile Send private message
BitJam
Advocate
Advocate


Joined: 12 Aug 2003
Posts: 2513
Location: Silver City, NM

PostPosted: Thu Oct 30, 2003 11:52 pm    Post subject: Reply with quote

In your .conf files, where-ever it says "Allow from all" replace this with:
Code:
   Order deny,allow
   Deny from all
   allow from 127.0.0.1
Back to top
View user's profile Send private message
Chris W
l33t
l33t


Joined: 25 Jun 2002
Posts: 972
Location: Brisbane, Australia

PostPosted: Fri Oct 31, 2003 12:12 am    Post subject: Reply with quote

With Bitjam's approach Apache will still accept the TCP connection before deciding it's not allowed to access the pages. The approach also potentially requires edits of all permissions in the configuration.

You can use the Listen directive to stop Apache listening on any interfaces (i.e. ignore) other than the one's you want:
Code:
Listen 192.168.1.1:80
Listen 127.0.0.1:80
where the addresses are those of the interfaces you want to listen on (apache2.conf). This has global effect.

(Example based on Apache 2, may be slightly different under 1.3)
_________________
Cheers,
Chris W
"Common sense: The collection of prejudices acquired by age 18." -- Einstein
Back to top
View user's profile Send private message
RangerDude
Guru
Guru


Joined: 19 Apr 2003
Posts: 301

PostPosted: Fri Oct 31, 2003 10:32 am    Post subject: Reply with quote

Code:
Listen 127.0.0.1:80

gives me
Code:
# /etc/init.d/apache2 restart
 * Starting apache2...
(98)Address already in use: make_sock: could not bind to address 0.0.0.0:80
no listening sockets available, shutting down
Unable to open logs
                                                                          [ !! ]
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum