⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 asg04.htm

📁 apache技术手册
💻 HTM
📖 第 1 页 / 共 3 页
字号:

<PRE>

<FONT COLOR="#000080">BindAddress www.foo.com</FONT></PRE>

<P>To have the server listen to all IP addresses accepted by the host, use BindAddress *. 

<BR>

<P>BindAddress * is also the default value if BindAddress is not specified.

<BR>

<P>Note that the server will only bind to requests on the port specified by the Port directive, which defaults to 80&#151;the standard TCP port for HTTP servers .

<BR>

<BR>

<A NAME="E69E25"></A>

<H4 ALIGN=CENTER>

<CENTER>

<FONT SIZE=4 COLOR="#FF0000"><B>Listen</B></FONT></CENTER></H4>

<BR>

<P>The Listen directive is new for Apache 1.1. It has similar functionality to the BindAddress. This directive allows you to specify additional ports that the server will listen in for requests. This feature is useful in implementing internal servers that contain information you don&#146;t want others to see by default when they connect to your address. For example, you may want to have special information about your network available through the Web. Instead of running a separate server process to serve this information, you can have Apache listen in on multiple ports, such as port 8080.

<BR>

<P>This feature is used in the upcoming version of Stronghold&#151;a commercial secure version of Apache that implements both an SSL and standard server using one process. Instead of running two server processes (one for the secure server and another for the nonsecure one), you can have one process respond appropriately depending on the port used for the connection.

<BR>

<BLOCKQUOTE>

<BLOCKQUOTE>

<HR ALIGN=CENTER>

<BR>

<NOTE>BindAddress and Listen don&#146;t implement virtual hosts. They simply tell the server where to listen for requests. BindAddress and Listen are used to build a list of addresses and ports that the server will listen for. If Apache is not configured to listen for a particular request, your virtual host won&#146;t be accessible.</NOTE>

<BR>

<HR ALIGN=CENTER>

</BLOCKQUOTE></BLOCKQUOTE>

<BR>

<A NAME="E68E32"></A>

<H3 ALIGN=CENTER>

<CENTER>

<FONT SIZE=5 COLOR="#FF0000"><B>Multihoming: IP-Intensive Virtual Hosts</B></FONT></CENTER></H3>

<BR>

<P>This section does not apply if you are using Apache 1.1 non&#150;IP-intensive virtual hosts . If you are using Apache 1.1 or better, you may want to skip this section because Apache 1.1 has a much easier way of developing a virtual host that doesn't require multihoming. (Refer to &quot;Apache Non-IP Virtual Hosts&quot; later in this chapter.)

<BR>

<P>For a multihomed Web server to work, the host computer needs to be able to respond to multiple names or IP addresses. Traditionally, multihomed hosts were the only computers on a network that did this. Because they bridged two separate networks, they had the need to answer to two different addresses. To do this, these computers were usually fitted with two networking cards that allowed the computer to have two different network addresses. Each network knew the multihomed host by a different name. On the Web, multihomed computers don't connect two networks, but they do need to answer to multiple names.

<BR>

<P>Most modern unices (plural for UNIX) provide the software tools needed to allow you to specify multiple IP addresses to a single interface. If your system does not include a version of ifconfig that supports the alias option, don't despair. Table 4.1 lists the major systems and the how you can achieve multiple IP support.

<BR>

<BR>

<P ALIGN=CENTER>

<CENTER>

<FONT COLOR="#000080"><A NAME="I2"></A><B>Table 4.1. Operating systems and multihoming .</B></FONT></CENTER>

<BR>



<TABLE  BORDERCOLOR=#000040 BORDER=1 CELLSPACING=2 WIDTH="80%" CELLPADDING=2 >

<TR>

<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>

<I>Operating System</I>

</FONT>

<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>

<I>Multiple IP Support</I>

</FONT>

<TR>

<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>

AIX 4.1

</FONT>

<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>

Built-in: ifconfig alias

</FONT>

<TR>

<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>

BSDI 

</FONT>

<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>

Built-in: ifconfig alias

</FONT>

<TR>

<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>

Digital OSF/1

</FONT>

<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>

Built-in: ifconfig alias

</FONT>

<TR>

<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>

Digital UNIX

</FONT>

<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>

Built-in: ifconfig alias

</FONT>

<TR>

<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>

FreeBSD

</FONT>

<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>

Built-in: ifconfig alias

</FONT>

<TR>

<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>

HPUX 10.<I>x</I>

</FONT>

<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>

Needs ifconfig alias patch

</FONT>

<TR>

<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>

HPUX 9.<I>x</I> 

</FONT>

<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>

Needs virtual interface (VIF) patch

</FONT>

<TR>

<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>

IRIX 5.3

</FONT>

<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>

Needs SGI's ifconfig alias patch

</FONT>

<TR>

<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>

Linux

</FONT>

<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>

Needs ifconfig alias patch

</FONT>

<TR>

<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>

NeXTSTEP 3.3

</FONT>

<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>

Use PPP Interfaces to provide virtual interfaces

</FONT>

<TR>

<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>

Solaris 2.3 and better

</FONT>

<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>

Built-in: ifconfig logical units

</FONT>

<TR>

<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>

SunOS 4.<I>x</I>

</FONT>

<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>

Needs VIF patch 

</FONT>

<TR>

<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>

SunOS 5.3 and better

</FONT>

<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>

Built-in: ifconfig logical units

</FONT>

<TR>

<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>

Ultrix

</FONT>

<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>

Needs VIF patch</FONT>

</TABLE><P>If your system is not listed in Table 4.1, you might want to try the PPP approach described later in this chapter. Alternatively, you can opt for Apache's 1.1 non-IP-intensive virtual hosts, which remove the need to create a multihomed server altogether.

<BR>

<P>You can specify multiple IP addresses to a single interface by using the following:

<BR>

<UL>

<LI>The ifconfig alias

<BR>

<BR>

<LI>The VIF patch

<BR>

<BR>

<LI>PPP

<BR>

<BR>

</UL>

<BR>

<A NAME="E69E26"></A>

<H4 ALIGN=CENTER>

<CENTER>

<FONT SIZE=4 COLOR="#FF0000"><B>ifconfig alias</B></FONT></CENTER></H4>

<BR>

<P>The alias option of ifconfig is the easiest way to implement a virtual host. The ifconfig command is used to set or display configuration values of a network interface. Not all vendors support the alias option.

<BR>

<P>You can make your Ethernet interface answer to an additional IP by issuing the following command:

<BR>

<BR>

<PRE>

<FONT COLOR="#000080">ifconfig <I>interface</I> <I>IP </I>alias</FONT></PRE>

<P>Depending on your operating system, <I>Interface</I> can be en0 or le0, so you'll need to check your man pages for ifconfig to determine the appropriate name for your Ethernet interface. Set the IP parameter to a valid DNS address you assigned to the virtual host. That's it! The interface will now accept packets destined for the virtual site.

<BR>

<P>Some operating systems in the preceding list don't offer the alias option by default, but patches are available from the vendor or the Net. Each patch distribution includes information on how to apply it, as well as any other specifics on its use. I have included some of these patches on the CD, but you may want to check for updates on them at the following locations:

<BR>

<P>Each patch distribution will include information on how to apply it and any other specifics on its use. I have included some of these patches on the CD, but you may want to check for updates on them at the following locations:

<BR>

<UL>

<LI>The ifconfig alias patch for HPUX 10.X can be found at <A HREF="javascript:if(confirm('http://www.limitless.co.uk/hp_ifalias.html  \n\nThis file was not retrieved by Teleport Pro, because it is addressed on a domain or path outside the boundaries set for its Starting Address.  \n\nDo you want to open it from the server?'))window.location='http://www.limitless.co.uk/hp_ifalias.html'" tppabs="http://www.limitless.co.uk/hp_ifalias.html"> http://www.limitless.co.uk/hp_ifalias.html</A>. This patch has been included on the CD with the kind permission of its author Julian Perry (<A HREF="MAILTO:jules@limitless.co.uk"> jules@limitless.co.uk</A>).

<BR>

<BR>

<LI>You can find the ifconfig patch for IRIX 5.3 at <A HREF="javascript:if(confirm('http://www.sgi.com/  \n\nThis file was not retrieved by Teleport Pro, because it is addressed on a domain or path outside the boundaries set for its Starting Address.  \n\nDo you want to open it from the server?'))window.location='http://www.sgi.com/'" tppabs="http://www.sgi.com/"> http://www.sgi.com</A>.

<BR>

<BR>

<LI>The Linux ifconfig alias patch can be found at <A HREF="javascript:if(confirm('ftp://ftp.mindspring.com/users/rsanders/ipalias  \n\nThis file was not retrieved by Teleport Pro, because it did not meet the project\'s file type specifications.  \n\nDo you want to open it from the server?'))window.location='ftp://ftp.mindspring.com/users/rsanders/ipalias'" tppabs="ftp://ftp.mindspring.com/users/rsanders/ipalias"> ftp://ftp.mindspring.com/users/rsanders/ipalias</A>.

<BR>

<BR>

</UL>

<BR>

<A NAME="E70E1"></A>

<H5 ALIGN=CENTER>

<CENTER>

<FONT SIZE=4 COLOR="#FF0000"><B>Solaris Virtual Interfaces</B></FONT></CENTER></H5>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -