LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices

Reply
 
LinkBack Search this Thread
Old 04-14-2010, 07:55 PM   #1
jdackle
Member
 
Registered: Apr 2010
Distribution: Debian, LMDE
Posts: 39

Rep: Reputation: 11
"Listen 127.0.0.1:80" on Apache 2.2?


Using Ubuntu 9.10 and Apache 2.2.12.

So... I wanted to make my Apache server available only to localhost and I found this thread: http://www.linuxquestions.org/questi...server-651883/

I prefer to do this using the second reply (define access rule for Apache) instead of the other option (define rule for the firewall).

So I found the "Listen 80" line on /etc/apache2/ports.conf (not on apache2.conf).
But I also found "NameVirtualHost 80".
Hence, currently my ports.conf file contains this:
Code:
NameVirtualHost 127.0.0.1:80
Listen 127.0.0.1:80
I've checked I can correctly access the server from the same machine it's installed in and will test if it refuses to serve a different machine tomorrow.

But in the meantime, as what I did is not exactly what was advised (in other places too) and maybe that was intended for Apache 2.0 and 2.2 seems to have implemented something new, the Virtual Host names (for what I gather from the comments on the ports.conf file)... is what i did (assuming my test tomorrow goes well) ok or am I messing with what I shouldn't be messing - do note I know basically nothing on this subject.

Thanks in advance.
 
Old 04-14-2010, 08:09 PM   #2
kbp
Senior Member
 
Registered: Aug 2009
Posts: 3,716

Rep: Reputation: 634Reputation: 634Reputation: 634Reputation: 634Reputation: 634Reputation: 634
You should be fine... you can always confirm what is listening on your machine with netstat:

'sudo netstat -tunlp'

Code:
....
tcp        0      0 :::80                       :::*                        LISTEN      1270/httpd  
...
In this case, httpd is listening on all interfaces
 
1 members found this post helpful.
Old 04-14-2010, 08:35 PM   #3
jdackle
Member
 
Registered: Apr 2010
Distribution: Debian, LMDE
Posts: 39

Original Poster
Rep: Reputation: 11
Thanks for the tip.

Oddly enough, there is no httpd program listed in my output for "sudo netstat -tunlp". I did find apache2 though:
Code:
tcp        0      0 127.0.0.1:80            0.0.0.0:*               ESCUTA      15281/apache2
"ESCUTA" means "LISTEN" BTW.
 
Old 04-14-2010, 08:57 PM   #4
kbp
Senior Member
 
Registered: Aug 2009
Posts: 3,716

Rep: Reputation: 634Reputation: 634Reputation: 634Reputation: 634Reputation: 634Reputation: 634
Yeah.. it depends on your distro, the Red Hat family call it 'httpd'
 
Old 04-15-2010, 04:58 AM   #5
jdackle
Member
 
Registered: Apr 2010
Distribution: Debian, LMDE
Posts: 39

Original Poster
Rep: Reputation: 11
I do have a /etc/apache2/httpd.conf file though. I gather that just comes from the Apache project, independently from the distro...?

Thanks.
 
Old 04-15-2010, 09:44 AM   #6
kbp
Senior Member
 
Registered: Aug 2009
Posts: 3,716

Rep: Reputation: 634Reputation: 634Reputation: 634Reputation: 634Reputation: 634Reputation: 634
A distro just decides how and what apps they're going to provide, they don't muck about with the content too much generally
 
Old 04-15-2010, 10:59 AM   #7
jdackle
Member
 
Registered: Apr 2010
Distribution: Debian, LMDE
Posts: 39

Original Poster
Rep: Reputation: 11
Ok, thanks, kbp!


EDIT:
BTW I also edited /etc/apache2/sites-enabled/000-default so that
Code:
<VirtualHost *:80>
now reads
Code:
<VirtualHost 127.0.0.1:80>
This got me rid of the warning message on Apache restart that complained:
Code:
[warn] NameVirtualHost 127.0.0.1:80 has no VirtualHosts

Last edited by jdackle; 04-16-2010 at 05:43 PM.
 
  


Reply

Tags
apache22, localhost


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
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Trying webmin, getting "attempt to connect to 127.0.0.1:10000 (localhost) failed" jeffreybluml Linux - General 1 08-16-2007 11:16 AM
Problem with rplay: "rplayd: 127.0.0.1 permission denied" Cluracan Linux - Software 0 08-09-2007 05:57 AM
apache security for intranet: "listen 80" vs. "listen 127.0.0.1:80" pulper Linux - Software 3 09-27-2006 06:24 AM
Automatically execute "ifconfig lo up 127.0.0.1" robbbert Linux - Networking 2 04-22-2006 05:16 PM
KDE/CUPS printer slow to start up; fixed with "127.0.0.1 localhost" in /etc/hosts KWTm LinuxQuestions.org Member Success Stories 0 03-05-2005 11:11 AM


All times are GMT -5. The time now is 10:48 AM.

Main Menu
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