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

📄 configure.html

📁 lfs3.1 从源代码构建linux。html版本。
💻 HTML
字号:
<HTML><HEAD><TITLE>Configuring essential software</TITLE><METANAME="GENERATOR"CONTENT="Modular DocBook HTML Stylesheet Version 1.63"><LINKREL="HOME"TITLE="Linux From Scratch"HREF="../index.html"><LINKREL="UP"TITLE="Installing basic system software"HREF="../chapter06/chapter06.html"><LINKREL="PREVIOUS"TITLE="Removing old NSS library files"HREF="../chapter06/removeoldnss.html"><LINKREL="NEXT"TITLE="Creating system boot scripts"HREF="../chapter07/chapter07.html"></HEAD><BODYCLASS="sect1"BGCOLOR="#FFFFFF"TEXT="#000000"LINK="#0000FF"VLINK="#840084"ALINK="#0000FF"><DIVCLASS="NAVHEADER"><TABLEWIDTH="100%"BORDER="0"CELLPADDING="0"CELLSPACING="0"><TR><THCOLSPAN="3"ALIGN="center">Linux From Scratch: Version 3.1</TH></TR><TR><TDWIDTH="10%"ALIGN="left"VALIGN="bottom"><AHREF="../chapter06/removeoldnss.html">Prev</A></TD><TDWIDTH="80%"ALIGN="center"VALIGN="bottom">Chapter 6. Installing basic system software</TD><TDWIDTH="10%"ALIGN="right"VALIGN="bottom"><AHREF="../chapter07/chapter07.html">Next</A></TD></TR></TABLE><HRALIGN="LEFT"WIDTH="100%"></DIV><DIVCLASS="sect1"><H1CLASS="sect1"><ANAME="ch06-configure">6.56. Configuring essential software</A></H1><P>Now that all software is installed, all that we need to do to get a fewprograms running properly is to create their configuration files.</P><DIVCLASS="sect2"><H2CLASS="sect2"><ANAME="AEN4089">6.56.1. Configuring Vim</A></H2><P>By default Vim runs in vi compatible mode. Some people might like this,but we have a high preference to run vim in vim mode (else we wouldn'thave included Vim in this book but the original Vi). Create the<TTCLASS="filename">/root/.vimrc</TT> by running the following:</P><P><TABLEBORDER="0"BGCOLOR="#E0E0E0"WIDTH="100%"><TR><TD><FONTCOLOR="#000000"><PRECLASS="screen"><TTCLASS="userinput"><B>cat &#62; /root/.vimrc &#60;&#60; "EOF"</B></TT>" Begin /root/.vimrcset nocompatibleset bs=2" End /root/.vimrc<TTCLASS="userinput"><B>EOF</B></TT></PRE></FONT></TD></TR></TABLE></P></DIV><DIVCLASS="sect2"><H2CLASS="sect2"><ANAME="AEN4097">6.56.2. Configuring Glibc</A></H2><P>We need to create the /etc/nsswitch.conf file. Although glibc should provide defaults when this file is missing or corrupt, its defaults don't workwell with networking which will be dealt with in a later chapter. Also, ourtimezone needs to be set up.</P><P>Create a new file <TTCLASS="filename">/etc/nsswitch.conf</TT> by running thefollowing:</P><P><TABLEBORDER="0"BGCOLOR="#E0E0E0"WIDTH="100%"><TR><TD><FONTCOLOR="#000000"><PRECLASS="screen"><TTCLASS="userinput"><B>cat &#62; /etc/nsswitch.conf &#60;&#60; "EOF"</B></TT># Begin /etc/nsswitch.confpasswd: filesgroup: filesshadow: filespublickey: fileshosts: files dnsnetworks: filesprotocols: db filesservices: db filesethers: db filesrpc: db filesnetgroup: db files# End /etc/nsswitch.conf<TTCLASS="userinput"><B>EOF</B></TT></PRE></FONT></TD></TR></TABLE></P><P>The <TTCLASS="userinput"><B>tzselect</B></TT> script has to be run and the questions regarding your timezone have to be answered.When you're done, the script will give the location of the needed timezone file.</P><P> Create the <TTCLASS="filename">/etc/localtime</TT> symlinkby running:</P><P><TABLEBORDER="0"BGCOLOR="#E0E0E0"WIDTH="100%"><TR><TD><FONTCOLOR="#000000"><PRECLASS="screen"><TTCLASS="userinput"><B>cd /etc &#38;&#38;ln -sf ../usr/share/zoneinfo/&#60;tzselect's output&#62; localtime</B></TT></PRE></FONT></TD></TR></TABLE></P><P>tzselect's output can be something like <EM>EST5EDT</EM> or<EM>Canada/Eastern</EM>.</P><P>The symlink you'd create with that information would be:</P><P><TABLEBORDER="0"BGCOLOR="#E0E0E0"WIDTH="100%"><TR><TD><FONTCOLOR="#000000"><PRECLASS="screen"><TTCLASS="userinput"><B>ln -sf ../usr/share/zoneinfo/EST5EDT localtime</B></TT></PRE></FONT></TD></TR></TABLE></P><P>Or:</P><P><TABLEBORDER="0"BGCOLOR="#E0E0E0"WIDTH="100%"><TR><TD><FONTCOLOR="#000000"><PRECLASS="screen"><TTCLASS="userinput"><B>ln -sf ../usr/share/zoneinfo/Canada/Eastern localtime </B></TT></PRE></FONT></TD></TR></TABLE></P></DIV><DIVCLASS="sect2"><H2CLASS="sect2"><ANAME="AEN4124">6.56.3. Configuring Dynamic Loader</A></H2><P>By default the dynamic loader searches a few default paths for dynamiclibraries, so there normally isn't a need for the<TTCLASS="filename">/etc/ld.so.conf</TT> file unless the system has extradirectories in which you want the system to search for libraries. The<TTCLASS="filename">/usr/local/lib</TT> directory isn'tsearched through for dynamic libraries by default, so we want to addthis path so when you install software you won't be surprised by them notrunning for some reason.</P><P>Create a new file <TTCLASS="filename">/etc/ld.so.conf</TT> by running thefollowing:</P><P><TABLEBORDER="0"BGCOLOR="#E0E0E0"WIDTH="100%"><TR><TD><FONTCOLOR="#000000"><PRECLASS="screen"><TTCLASS="userinput"><B>cat &#62; /etc/ld.so.conf &#60;&#60; "EOF"</B></TT># Begin /etc/ld.so.conf/lib/usr/lib/usr/local/lib# End /etc/ld.so.conf<TTCLASS="userinput"><B>EOF</B></TT></PRE></FONT></TD></TR></TABLE></P><P>Although it's not necessary to add the <TTCLASS="filename">/lib</TT> and <TTCLASS="filename">/usr/lib</TT> directories it doesn't hurt. This way it can be seen right away what's being searched and a youdon't have to remember the default search paths if you don't want to.</P></DIV><DIVCLASS="sect2"><H2CLASS="sect2"><ANAME="AEN4138">6.56.4. Configuring Sysklogd</A></H2><P>Create a new file <TTCLASS="filename">/etc/syslog.conf</TT> by running thefollowing:</P><P><TABLEBORDER="0"BGCOLOR="#E0E0E0"WIDTH="100%"><TR><TD><FONTCOLOR="#000000"><PRECLASS="screen"><TTCLASS="userinput"><B>cat &#62; /etc/syslog.conf &#60;&#60; "EOF"</B></TT># Begin /etc/syslog.confauth,authpriv.* -/var/log/auth.log*.*;auth,authpriv.none -/var/log/sys.logdaemon.* -/var/log/daemon.logkern.* -/var/log/kern.logmail.* -/var/log/mail.loguser.* -/var/log/user.log*.emerg *# End /etc/syslog.conf<TTCLASS="userinput"><B>EOF</B></TT></PRE></FONT></TD></TR></TABLE></P></DIV><DIVCLASS="sect2"><H2CLASS="sect2"><ANAME="AEN4146">6.56.5. Configuring Shadow Password Suite</A></H2><P>This package contains the utilities to modify user's passwords, add newusers/groups, delete users/groups and more. We're not going to explain what 'password shadowing' means. All about that can be read in the doc/HOWTOfile within the unpacked shadow password suite's source tree. There's one thing you should keep in mind, if you decide to use shadow support, that programs that need to verify passwords (examples are xdm, ftp daemons, pop3 daemons, etc) need to be 'shadow-compliant', eg. they need tobe able to work with shadow'ed passwords.</P><P>To enable shadow'ed passwords, run the following command:</P><P><TABLEBORDER="0"BGCOLOR="#E0E0E0"WIDTH="100%"><TR><TD><FONTCOLOR="#000000"><PRECLASS="screen"><TTCLASS="userinput"><B>/usr/sbin/pwconv</B></TT></PRE></FONT></TD></TR></TABLE></P></DIV><DIVCLASS="sect2"><H2CLASS="sect2"><ANAME="AEN4153">6.56.6. Configuring Sysvinit</A></H2><P>Create a new file <TTCLASS="filename">/etc/inittab</TT> by running thefollowing:</P><P><TABLEBORDER="0"BGCOLOR="#E0E0E0"WIDTH="100%"><TR><TD><FONTCOLOR="#000000"><PRECLASS="screen"><TTCLASS="userinput"><B>cat &#62; /etc/inittab &#60;&#60; "EOF"</B></TT># Begin /etc/inittabid:3:initdefault:si::sysinit:/etc/init.d/rcSl0:0:wait:/etc/init.d/rc 0l1:S1:wait:/etc/init.d/rc 1l2:2:wait:/etc/init.d/rc 2l3:3:wait:/etc/init.d/rc 3l4:4:wait:/etc/init.d/rc 4l5:5:wait:/etc/init.d/rc 5l6:6:wait:/etc/init.d/rc 6ca:12345:ctrlaltdel:/sbin/shutdown -t1 -a -r nowsu:S016:respawn:/sbin/sulogin1:2345:respawn:/sbin/agetty tty1 96002:2345:respawn:/sbin/agetty tty2 96003:2345:respawn:/sbin/agetty tty3 96004:2345:respawn:/sbin/agetty tty4 96005:2345:respawn:/sbin/agetty tty5 96006:2345:respawn:/sbin/agetty tty6 9600# End /etc/inittab<TTCLASS="userinput"><B>EOF</B></TT></PRE></FONT></TD></TR></TABLE></P></DIV><DIVCLASS="sect2"><H2CLASS="sect2"><ANAME="AEN4161">6.56.7. Creating the /var/run/utmp, /var/log/wtmp and /var/log/btmp files</A></H2><P>Programs like login, shutdown, uptime and others want to read from and write to the /var/run/utmp /var/log/btmp and /var/log/wtmp. These files contain information about who is currently logged in. It also contains information on when the computer was last booted and shutdown and a record of thebad login attempts.</P><P>Create these files with their proper permissions by running thefollowing commands:</P><P><TABLEBORDER="0"BGCOLOR="#E0E0E0"WIDTH="100%"><TR><TD><FONTCOLOR="#000000"><PRECLASS="screen"><TTCLASS="userinput"><B>touch /var/run/utmp /var/log/wtmp \

⌨️ 快捷键说明

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