LinuxQuestions.org
Visit Jeremy's Blog.
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 06-15-2005, 12:43 AM   #1
IwantLINUX
Member
 
Registered: Oct 2004
Location: India
Distribution: RH9,Fedora
Posts: 75

Rep: Reputation: 15
Apache


Hi all,

can somebody let me know the use of the LISTEN directive in httpd.conf. It has been mentioned that "The Listen directive tells the server to accept incoming requests on the specified port or address-and-port combination." and it specify particular IP addresses over which the server will accept connections. But what does that actually means and what is its use?

Pls hlp...
 
Old 06-15-2005, 03:04 AM   #2
Boby
Member
 
Registered: Feb 2004
Posts: 781

Rep: Reputation: Disabled
Hello!

Quote:
The Listen directive instructs Apache to listen to only specific IP addresses or ports; by default it responds to requests on all IP interfaces. Listen is now a required directive. If it is not in the config file, the server will fail to start. This is a change from previous versions of Apache.

The Listen directive tells the server to accept incoming requests on the specified port or address-and-port combination. If only a port number is specified, the server listens to the given port on all interfaces. If an IP address is given as well as a port, the server will listen on the given port and interface.

Multiple Listen directives may be used to specify a number of addresses and ports to listen to. The server will respond to requests from any of the listed addresses and ports.

For example, to make the server accept connections on both port 80 and port 8000, use:

Listen 80
Listen 8000

To make the server accept connections on two specified interfaces and port numbers, use

Listen 192.170.2.1:80
Listen 192.170.2.5:8000

IPv6 addresses must be surrounded in square brackets, as in the following example:

Listen [fe80::a00:20ff:fea7:ccea]:80

Error condition
Multiple Listen directives for the same ip address and port will result in an Address already in use error message.
http://httpd.apache.org/docs-2.0/mod/mpm_common.html

Hope you understand
Boby
 
Old 06-16-2005, 08:21 AM   #3
IwantLINUX
Member
 
Registered: Oct 2004
Location: India
Distribution: RH9,Fedora
Posts: 75

Original Poster
Rep: Reputation: 15
Hi Boby,
I do understand this, but what i want to know is its exact usage. I mean what effect does it makes when my machine is having multiple IPs and what is the use of making Apache listen over just one IP address...

I am really sorry for being dumb....
 
Old 06-16-2005, 11:03 AM   #4
tuxrules
Senior Member
 
Registered: Jun 2004
Location: Chicago
Distribution: Slackware64 -current
Posts: 1,158

Rep: Reputation: 62
AFAIK, you can setup Virtual hosting (i.e. host more that one website) either with one IP address or specify a seperate IP address to each virtual host you have on your machine.

Quote:
what is the use of making Apache listen over just one IP address...
I believe its used when you have a static IP address. Whereas, if you have a dynamic IP address, you would just want apache to listen to a port so that you dont have to go and change apache config file everytime your IP address changes.

I hope you understand...for more info you can read the apache config file (httpd.conf) file which has detailed explanation.

Tux,

Last edited by tuxrules; 06-16-2005 at 11:07 AM.
 
Old 06-17-2005, 05:48 AM   #5
IwantLINUX
Member
 
Registered: Oct 2004
Location: India
Distribution: RH9,Fedora
Posts: 75

Original Poster
Rep: Reputation: 15
Hello tuxrules,

Thank you for your valuable reply. I have gone through httpd.conf but comments didn't solve my concern. I mean what benefits we are getting by making Apache listen over one IP?

lookin forward for a reply...
 
  


Reply


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
Mail from Apache being rejected - Cannot route to sender apache@localhost.localdomain jimwillsher Linux - Networking 2 01-19-2006 12:41 AM
Apache 1.3.33 (debian built) and Apache SSL does not respond to the proper ports lqorg_user Linux - Networking 0 11-06-2005 04:11 PM
Strange apache trailing / problem - Slack-current, apache 1.3.33 vamp Linux - Networking 1 01-30-2005 07:28 PM
Apache Webserver 403 Forbidden Errors (User not in apache group?) Mankind75 Mandriva 4 07-08-2004 05:30 AM
apache benchmarks (apache v13 / apache v20) ; large differences between benchmarking markus1982 Linux - Software 0 02-08-2003 10:53 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 05:23 AM.

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
Open Source Consulting | Domain Registration