📄 482-484.html
字号:
<HTML>
<HEAD>
<TITLE>Using Linux:Managing Daemons</TITLE>
<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>
-->
<!--ISBN=0789716232//-->
<!--TITLE=Using Linux//-->
<!--AUTHOR=William Ball//-->
<!--PUBLISHER=Macmillan Computer Publishing//-->
<!--IMPRINT=Que//-->
<!--CHAPTER=28//-->
<!--PAGES=482-484//-->
<!--UNASSIGNED1//-->
<!--UNASSIGNED2//-->
<CENTER>
<TABLE BORDER>
<TR>
<TD><A HREF="478-482.html">Previous</A></TD>
<TD><A HREF="../ewtoc.html">Table of Contents</A></TD>
<TD><A HREF="485-486.html">Next</A></TD>
</TR>
</TABLE>
</CENTER>
<P><BR></P>
<H4 ALIGN="LEFT"><A NAME="Heading17"></A><FONT COLOR="#000077">Starting and Stopping Network Services</FONT></H4>
<P>When starting and stopping network services, make sure that you stop all network-related services first. For the most part, these services continue to run if not stopped, generating errors and filling up log files. Furthermore, stopping the services properly ensures that all network connections have had the time to close down properly.
</P>
<H3><A NAME="Heading18"></A><FONT COLOR="#000077">Using the <I>ntsysv</I> Tool
</FONT></H3>
<P><TT>ntsysv</TT> is the text-mode service manager for Red Hat Linux. It is quite a bit simpler to use than <TT>tksysv</TT>, mainly because it deals with things one run level at a time.</P>
<P>To start <TT>ntsysv</TT>, type the command <TT>ntsysv --level <runlevel></TT>, in which <TT><runlevel></TT> is the run level you want to edit. To edit multiple run levels with <TT>ntsysv</TT>, list them all (for example, <TT>234</TT>).</P>
<TABLE BORDER="2" BORDERCOLOR="#0000" ALIGN="CENTER">
<TR><TD><FONT SIZE="+1"><B>Run a chkconfig</B></FONT>
<BR>When editing multiple run levels, <TT>ntsysv</TT> marks a service as being started if it is started on any run level that is currently being edited. You should confirm that any changes made did not have any undesirable effects by running <TT>chkconfig</TT> after running <TT>ntsysv</TT> this way.</TABLE>
<P><FONT SIZE="+1"><B><I>Adding or removing a service to a run level by using <I>ntsysv</I>
</I></B></FONT></P>
<DL>
<DD><B>1.</B> Log on as root.
<DD><B>2.</B> Issue the command <TT>ntsysv --level <runlevel></TT> in which <TT><runlevel></TT> is the number of the run level you wish to edit.
<DD><B>3.</B> Use the up and down arrow keys to move to the service that you want to modify.
<DD><B>4.</B> Press the Spacebar to turn the service on or off for the run level.
<DD><B>5.</B> Repeat steps 3 and 4 to turn any additional services on or off, as you need.
<DD><B>6.</B> Press the Tab key to highlight the OK button.
<DD><B>7.</B> Press Enter while OK is selected to save your work.
</DL>
<H3><A NAME="Heading19"></A><FONT COLOR="#000077">Enabling FTP Access</FONT></H3>
<P>The FTP network service is controlled by the Internet service daemon, <TT>inetd</TT>. To ensure that <TT>inetd</TT> knows how to respond to FTP connection requests, you must edit <TT>/etc/inetd.conf</TT> to ensure that the FTP service is enabled.</P>
<P>There are two types of FTP access—one type for regular users of your system (who have user accounts), and the other for <I>anonymous</I> user access. Anonymous user access allows anyone to download files from a set of defined directories on your system by logging on as user <I>anonymous</I> and by convention, leaving his email address as a password.</P>
<P><FONT SIZE="+1"><B><I>Determining whether FTP is enabled on your system</I></B></FONT></P>
<DL>
<DD><B>1.</B> Make sure you have the FTP server installed on your system. Issue the command <TT>rpm -q wu-ftpd</TT>. If the system responds with the message <TT>package wu-ftpd is not installed</TT> then you must install the package before continuing.
<DD><B>2.</B> Ensure that the FTP service line in <TT>/etc/inetd.conf</TT> exists and not commented out. Issue the command <TT>less /etc/inetd.conf</TT> and then make <TT>less</TT> perform a forward search for the word ftp by using the command <TT>/ftp</TT>. <TT>less</TT> should stop at a line like the following:
<!-- CODE SNIP //-->
<PRE>
ftp stream tcp nowait root /usr/sbin/tcpd
in.ftpd -l -a
</PRE>
<!-- END CODE SNIP //-->
<BR>If this line starts with a <TT>#</TT> you need to remove this before continuing.
<DD><B>3.</B> If you had to edit the <TT>inetd.conf</TT> file, you must notify <TT>inetd</TT> of the change to the file. Issuing <TT>/etc/rc.d/init.d/inet restart</TT> should do this for you.
</DL>
<P>Your system is now configured to accept incoming FTP connections.
</P>
<P>To enable anonymous FTP access, first follow the preceding steps. The <TT>wu-ftpd</TT> server included with Red Hat Linux provides anonymous FTP server capabilities immediately upon installation, but the additional directories are not installed with the server. You will need the package <TT>anonftp</TT> for this.</P>
<P>To check if you have <TT>anonftp</TT> installed, type <TT><B>rpm -q anonftp</B></TT> at the command line, and install the file if necessary.</P>
<P>The anonymous FTP server directories are in <TT>/home/ftp</TT>. Anything in the <TT>/home/ftp/pub</TT> directory can be downloaded by anonymous users.</P>
<P><FONT SIZE="+1"><B><I>Provide support for anonymous uploads</I></B></FONT></P>
<DL>
<DD><B>1.</B> Log on as root.
<DD><B>2.</B> Change directories to <TT>/home/ftp</TT>.
<DD><B>3.</B> Create a directory called <TT>incoming</TT>.
<DD><B>4.</B> Change the write permissions to all everyone write access to the <TT>chmod a+w /home/ftp/incoming</TT> directory.
</DL>
<P><FONT SIZE="+1"><B><I>Test your FTP server before letting other users onto it</I></B></FONT></P>
<DL>
<DD><B>1.</B> FTP to your server with the command <TT>ftp localhost</TT>.
<DD><B>2.</B> Log on as user anonymous. Enter a password when prompted. If the password was not a valid email address, the server should issue a warning but still let you in.
<DD><B>3.</B> Change to the incoming directory.
<DD><B>4.</B> Set your FTP client’s binary mode by typing the command <TT>bin</TT> at the <TT>ftp></TT> prompt.
<DD><B>5.</B> Attempt to upload a file to the server using the command <TT><filename></TT> where <TT>filename</TT> is the name of the file you want to upload.
<DD><B>6.</B> Try to download a file from your FTP server to make sure that everything works as expected.
</DL>
<P><BR></P>
<CENTER>
<TABLE BORDER>
<TR>
<TD><A HREF="478-482.html">Previous</A></TD>
<TD><A HREF="../ewtoc.html">Table of Contents</A></TD>
<TD><A HREF="485-486.html">Next</A></TD>
</TR>
</TABLE>
</CENTER>
</td>
</tr>
</table>
<!-- begin footer information -->
</body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -