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

📄 lsg46.htm

📁 linux-unix130.linux.and.unix.ebooks130 linux and unix ebookslinuxLearning Linux - Collection of 12 E
💻 HTM
📖 第 1 页 / 共 4 页
字号:


<META NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW">
<SCRIPT>
<!--
function displayWindow(url, width, height) {
        var Win = window.open(url,"displayWindow",'width=' + width +
',height=' + height + ',resizable=1,scrollbars=yes');
}
//-->
</SCRIPT>
</HEAD>

 -->


























<LINK REL="ToC" HREF="index.htm">







<LINK REL="Index" HREF="htindex.htm">







<LINK REL="Next" HREF="lsgpt07.htm">



















<A NAME="I0"></A>







<H2>Linux System Administrator's Survival Guide lsg46.htm</H2>







<P ALIGN=LEFT>







































<HR ALIGN=CENTER>







<P>







<UL>







<UL>







<UL>







<LI>







<A HREF="#E68E243" >Web Server Software</A>







<UL>







<LI>







<A HREF="#E69E261" >Unpacking the Web Files</A>







<LI>







<A HREF="#E69E262" >Compiling the Web Software</A>







<LI>







<A HREF="#E69E263" >Configuring the Web Software</A>







<LI>







<A HREF="#E69E264" >Starting the Web Software</A></UL>







<LI>







<A HREF="#E68E244" >Setting Up Your Web Site</A>







<UL>







<LI>







<A HREF="#E69E265" >HTML Authoring Tools</A>







<LI>







<A HREF="#E69E266" >Maintaining HTML</A></UL>







<LI>







<A HREF="#E68E245" >Summary</A></UL></UL></UL>







<HR ALIGN=CENTER>







<A NAME="E66E52"></A>







<H1 ALIGN=CENTER>







<CENTER>







<FONT SIZE=6 COLOR="#FF0000"><B>Chapter 46</B></FONT></CENTER></H1>







<BR>







<A NAME="E67E55"></A>







<H2 ALIGN=CENTER>







<CENTER>







<FONT SIZE=6 COLOR="#FF0000"><B>Configuring a WWW Site</B></FONT></CENTER></H2>







<BR>







<P>Just about everyone on the planet knows about the World Wide Web. It's the most talked-about aspect of the Internet. With the WWW's popularity, more system users are getting into the game by setting up their own WWW servers and home page. Sophisticated packages now act as Web servers for many operating systems, although UNIX users have always done it from scratch. Linux, based on UNIX, has the software necessary to provide a Web server readily available.







<BR>







<P>You don't need fancy software to set up a Web site, only a little time and the correct configuration information. That's what this chapter is about. The chapter looks at how you can set up a World Wide Web server on your Linux system, whether for friends, your LAN, or the Internet as a whole.







<BR>







<P>The major aspect of the Web that attracts users and makes it so powerful, aside from its multimedia capabilities, is the use of <I>hyperlinks</I>. A hyperlink lets you move with only one mouse click from document to document, site to site, graphic to movie, and so on. All the instructions of the move are built into the Web code.







<BR>







<P>There are two aspects to the World Wide Web: server and client. Client software is the best known, such as Mosaic and Netscape. However, there are many different Web client packages available other than these two, some specifically for X or Linux.







<BR>







<BR>







<A NAME="E68E243"></A>







<H3 ALIGN=CENTER>







<CENTER>







<FONT SIZE=5 COLOR="#FF0000"><B>Web Server Software</B></FONT></CENTER></H3>







<BR>







<P>There are three primary versions of Web server software that will run under Linux. They are from NCSA, CERN, and Plexus. The most readily available system is from NCSA, which also provides Mosaic. NCSA's Web system is fast and quite small, can run under inetd or as a stand-alone daemon, and provides pretty good security. This chapter uses NCSA's Web software, although you can easily use any of the other two packages instead (some of the configuration information will be different, of course).







<BR>







<BLOCKQUOTE>







<BLOCKQUOTE>







<HR ALIGN=CENTER>







<BR>







<NOTE>The Web server software is available via anonymous FTP or WWW from one of the three sites listed following, depending on the type of server software you want:







<BR>CERN: <A HREF="ftp://info.cern.ch.pub/www.bin">ftp://info.cern.ch.pub/www.bin</A> (FTP)







<BR>NCSA: <A HREF="ftp://ftp.ncsa.edu">ftp.ncsa.edu</A> (FTP)







<BR><A TARGET="resource window" HREF="http://boohoo.ncsa.uiuc.edu">http://boohoo.ncsa.uiuc.edu</A> (WWW)







<BR>Plexus: <A HREF="ftp://autsin.bsdi.com/plexus/2.2.1/dist/Plexus.html">ftp://autsin.bsdi.com/plexus/2.2.1/dist/Plexus.html</A> (WWW)</NOTE>







<BR>







<HR ALIGN=CENTER>







</BLOCKQUOTE></BLOCKQUOTE>







<P>The NCSA Web software is available for Linux in both compiled and source code forms. Using the compiled version is much easier because you don't have to configure and compile the source code for the PC and Linux platforms. The binaries are often provided compressed and tarred, so you will have to uncompress and then extract the tar library. Alternatively, many CD-ROMs provide the software ready-to-go. If you do obtain the compressed form of the Web server software, follow the installation or readme files to place the Web software in the proper location.







<BR>







<BR>







<A NAME="E69E261"></A>







<H4 ALIGN=CENTER>







<CENTER>







<FONT SIZE=4 COLOR="#FF0000"><B>Unpacking the Web Files</B></FONT></CENTER></H4>







<BR>







<P>If you have obtained a library of source code or binaries from an FTP or BBS site, you will probably have to untar and uncompress them first. (Check with any README files before you do this, if there are any; otherwise, you may be doing this step for nothing.) Usually, you proceed by creating a directory for the Web software, then changing into it and expanding the library with a command like this:







<BR>







<BR>







<PRE>







<FONT COLOR="#000080">zcat httpd_X.X_XXX.tar.Z | tar xvf -</FONT></PRE>







<P>The software is often named by the release and target platform, such as httpd_1.5_linux.tar.Z. Use whatever name your tar file has in the above line. Installation instructions are sometimes in a separate tar file, such as Install.tar.z, which you will have to obtain and uncompress with the following command:







<BR>







<BR>







<PRE>







<FONT COLOR="#000080">zcat Install.txt.z</FONT></PRE>







<P>Make sure you are in the target directory when you issue the commands above, though, or you will have to move a lot of files. You can place the files anywhere, although it is often a good idea to create a special area for the Web software that can have its permissions controlled, such as /usr/web, /var/web, or similar name.







<BR>







<P>Once you have extracted the contents of the Web server distribution and the library files are in their proper directories, you can look at what has been created automatically. You should have the following subdirectories:







<BR>















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







<TR>







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







cgi-bin







</FONT>







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







Common gateway interface binaries and scripts</FONT>







<TR>







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







conf







</FONT>







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







Configuration files</FONT>







<TR>







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







icons







</FONT>







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







Icons for home pages</FONT>







<TR>







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







src







</FONT>







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







Source code and (sometimes) executables</FONT>







<TR>







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







support







</FONT>







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







Support applications</FONT>







</TABLE><BR>







<A NAME="E69E262"></A>







<H4 ALIGN=CENTER>







<CENTER>







<FONT SIZE=4 COLOR="#FF0000"><B>Compiling the Web Software</B></FONT></CENTER></H4>







<BR>







<P>If you don't have to modify the source code and recompile it under Linux, you can skip the configuration details mentioned in the rest of this section. On the other hand, you may want to know what is happening in the source code anyway, because you can better understand how Linux works with the Web server code. If you obtained a generic, untailored version of the NCSA Web server, you will have to configure the software.







<BR>







<P>Begin by editing the src/Makefile file to specify your platform. You have to check several variables for proper information:







<BR>















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







<TR>







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







AUX_CFLAGS







</FONT>







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







Uncomment the entry for Linux (identified by comment lines and symbols, usually)</FONT>







<TR>







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







CC







</FONT>







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







Specify the name of the C compiler (usually cc or gcc)</FONT>







<TR>







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







EXTRA_LIBS







</FONT>







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







Add any extra libraries that need to be linked in (none are required for Linux)</FONT>







<TR>







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







LFLAGS







</FONT>







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







Add any flags you need for linking (none are required for most Linux linkers)</FONT>







</TABLE><P>Finally, look for the CFLAGS variable. Some of the values for CFLAGS may be set already. Valid values for CFLAGS are as follows:







<BR>















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







<TR>







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







DESCURE_LOGS







</FONT>





⌨️ 快捷键说明

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