Linux Concise system maintenance Manual (III)

Source: Internet
Author: User
Tags empty ftp include mysql openssl php file socket version
(3) Installing a DHCP server
1, the source program download address is: ftp://ftp.isc.org/isc/dhcp/dhcp-3.0.tar.gz, our version is: dhcpd-3.0

2, copy to:/USR/LOCAL/SCR after decompression: Tar zxvf dhcp-3.0.tar.gz

3, cd/usr/local/src/dhcp-3.0.tar.gz

4./configure

5, make (if not the first compilation, make clean first)

6, make install

7, CP./SERVER/DHCPD.CONF/ETC

8, edit this file, looks like the following: (To change the place in bold)


# dhcpd.conf
#
# Sample configuration file for ISC dhcpd
#

# option definitions common to all supported networks ...
Option Domain-name "rd.xxx.com";
Option Domain-name-servers compaq.rd.xxx.com;

Default-lease-time 86400;
Max-lease-time 172800;

Ddns-update-style Ad-hoc;

# IF This DHCP server was the official DHCP server for the local
# Network, the authoritative directive should be uncommented.
#authoritative;

# Use this to send DHCP log messages to a different log file (for you also
# have to hack syslog.conf to complete the redirection).
Log-facility Local7;

# No Service is given on this subnet, but declaring it helps the
# DHCP Server to understand the network topology.

# This is a very basic subnet declaration.

Subnet 21.9.22.0 netmask 255.255.255.224 {
Range 21.9.22.2 21.9.22.6;
Option routers 21.9.22.1;
}

# This declaration allows BOOTP clients to get dynamic addresses,
# which we don ' t really recommend.

#subnet 10.254.239.32 netmask 255.255.255.224 {
# range DYNAMIC-BOOTP 10.254.239.40 10.254.239.60;
# option Broadcast-address 10.254.239.31;
# option Routers rtr-239-32-1.example.org;
#}

# A slightly different configuration for A internal subnet.
#subnet 10.5.5.0 netmask 255.255.255.224 {
# range 10.5.5.26 10.5.5.30;
# option Domain-name-servers ns1.internal.example.org;
# option Domain-name "internal.example.org";
# option routers 10.5.5.1;
# option Broadcast-address 10.5.5.31;
# Default-lease-time 600;
# Max-lease-time 7200;
#}

# Hosts which require special configuration options can is listed in
# host statements. If No is specified, the address would be
# Allocated dynamically (if possible), but the host-specific information
# would still come from the host declaration.

#host Passacaglia {
# Hardware Ethernet 0:0:c0:5d:bd:95;
# filename "Vmunix.passacaglia";
# server-name "Toccata.fugue.com";
#}

# Fixed IP addresses can also be specified for hosts. These addresses
# should not also is listed as being available for dynamic assignment.
# Hosts for which fixed IP addresses have been specified can boot using
# BOOTP or DHCP. Hosts for which no fixed address are specified can only
# being booted with DHCP, unless there is a address range on the subnet
# to which a BOOTP client is connected which has the DYNAMIC-BOOTP flag
# set.
#host Fantasia {
# Hardware Ethernet 08:00:07:26:C0:A5;
# fixed-address fantasia.fugue.com;
#}

# You can declare a class of clients and then does address allocation
# based on that. The example below shows a case where all clients
# in a certain class get addresses on the 10.17.224/24 subnet, and all
# Other clients get addresses on the 10.0.29/24 subnet.
  
#class "foo" {
# Match if substring (option vendor-class-identifier, 0, 4) = "SUNW";
#}

#shared-network 224-29 {
# subnet 10.17.224.0 netmask 255.255.255.0 {
# option Routers rtr-224.example.org;
# }
# subnet 10.0.29.0 netmask 255.255.255.0 {
# option Routers rtr-29.example.org;
# }
# pool {
# Allow members of "Foo";
# range 10.17.224.10 10.17.224.250;
# }
# pool {
# Deny members of "Foo";
# range 10.0.29.10 10.0.29.230;
# }



The above file in the following are comments, is the original system for your configuration to do the example, you can not. Unless, of course, you use them, and you know what they mean.

9, the establishment of empty files: touch/var/state/dhcp/dhcpd.leases empty files

10, check the kernel compilation options: Networking options-----Packet socket:mmapped IO and socket filtering options are selected (do not know how to see? Look at the previous article, use make menuconfig ah, if not, you need to recompile the kernel.

11, Route add-host 255.255.255.255 Dev eth0

12, roote add-host localhost dev eth0

13, in/etc/rc.d/rc.local last add one line route add-host 255.255.255.255 Dev eth0

14. Reboot System

15, with the DHCPD command to start DHCP, with other machines to try to automatically configure the network.

(4) Installation Apache+mysql+php+gd+png+zlib+jpeg+freetype+sslmod

Why do we have to say a whole lot of stuff like that? Because there is a close connection between them, especially that PHP, using all the other modules. PHP can only be done in a step-by-step way if you want it to function.

1, the first installation of MySQL: From the http://www.mysql.com/downloads/index.html download the version you feel appropriate. This is in the 3.23.42 version.

2, into the directory/usr/local/src (after that, don't say it?) ) Decompression: Tar zxvf mysql-3.23.42.tar.gz

3. CD mysql-3.23.42/

4, configure--prefix=/usr/local/mysql

5, make

6, make install

7, Useradd MySQL; Groupadd MySQL; Su MySQL;(set up users and groups named MySQL and switch to MySQL identity)

8, scripts/mysql_install_db (establish the database structure)

9, Cd/usr/local/mysql/bin

10./safe_mysqld & (started)

11./mysqladmin-u Root Password "New-password" (Your new password, remember that MySQL password kernel system password is independent, default is no password)

12, with the MySQL program to try.

The following steps are stylized and I write as succinctly as I can.

13, download the relevant software package: Address form is as follows


Software version Address
JPEGSRC.V6B.TAR.GZ 6b Ftp://ftp.uu.net/graphics/jpeg
zlib.tar.gz 1.1.3 Ftp://ftp.uu.net/graphics/png/src
freetype-2.0.8.tar.gz 2.0.8 http://www.freetype.org
libpng-1.0.10.tar.gz 1.0.10 FTP://FTP.UU.NET/GRAPHICS/PNG/SRC
gd-1.8.4.tar.gz 1.8.4 HTTP://WWW.BOUTELL.COM/GD
apache_1.3.23.tar.gz 1.3.23 http://www.apache.org
Php-4.1.1.tar.gz 4.1.1 Http://www.php.net
Number4.tar.gz 4 Http://www.php.net/extra
RSAREF20.TAR.Z 2.0 Ftp://ftp.ai.mit.edu/pub/deberg
openssl-engine-0.9.6c.tar.gz 0.9.6c Http://www.openssl.org/source
mod_ssl-2.8.6-1.3.23.tar.gz 2.8.6 http://www.modssl.org



The bottom is placed in the/USR/LOCAL/SRC directory, in addition to number4.tar.gz and Rsaref20.tar.z, other than the tar zxvf XXXX.tar.gz uncompressed. (Fun, huh?) )

In particular, Rsaref20.tar.z needs to first create a rsaref-2.0 directory, and then copy Rsaref20.tar.z to a modified directory with tar zxvf rsaref30.tar.z release compression. Number4.tar.gz need to be copied to the php-4.1.1 directory and then extracted with the tar zxvf number4.tar.gz.

The following description I would like to simply write down the commands that are executed after entering the directory. Those directories are created by themselves when they are released, and if you perform these operations under/USR/LOCAL/SRC, all directories will be in this area. It is best to perform in order. If you are not compiling for the first time, perform a make clean and then compile it.

14, [jpeg-6b]: a function library to generate JPEG images.


./configure
Make
Make Test
Make install



15, [zlib-1.1.3]: Compression algorithm library, PNG and JPEG need


Make Test
Make install



16, [freetype-2.0.8]: Font library, the use of fonts on the image need to use,


./configure--prefix=/usr/local
Make
Make install



17, [libpng-1.0.10]: function library to generate PNG image


CP Scripts/makefile.linux Makefile
Make Test
Pngtest Pngnow.png
(If you have passed the test, please continue.) Otherwise, look at the error prompts, correct the error)
Make install



18, [GD-1.8.4]:GD Library, used to dynamically generate images, here is mainly with PHP to generate images.

Edit Makefile File:

Uncomment the following line (#):


Cflags=-o-dhave_libxpm-dhave_libpng-dhave_libjpeg
-dhave_libfreetype-dhave_libttf
Libs=-lgd-lpng-lz-ljpeg-lfreetype-lm-lttf

Note the following lines (add #):
Cflags=-o-dhave_libpng-dhave_libjpeg
Libs=-lgd-lpng-lz-lm

Modify the following lines:
Includedirs=-i.-i/usr/local/include/freetype2-i/usr/include/x11
-i/usr/x11r6/include/x11-i/usr/local/include
-i/usr/include/freetype



Execute after Save:


Make
Make install



19, [apache_1.3.23]: Step one./configure--prefix=/usr/local/apache

20, [php-4.1.1]:

If this is not the first installation, delete: Config.cache file, and then execute make clean first

Next configure the environment and enter a longer command:


./configure
--with-apache=/usr/local/src/apache_1.3.23
--with-config-file-path=/local/apache/conf
--with-enable-versioning
--with-mysql=/usr/local/mysql
--with-ftp
--with-gd=/usr/local/src/gd-1.8.4
--with-enabled-bcmath=yes
--with-disable-debug
--enable-memory-limit=yes
--enable-track-vars
--with-zlib
--with-jpeg-dir=/usr/local/src/jpeg-6b
--with-png-dir=/usr/local/src/libpng-1.0.10
--with-freetype-dir=/usr//local/src/freetype-2.0.8



Of course, you can also achieve the preparation of a containing the above command of the sh file, which is easier to change. That's what I did.


Make
Make install



21, [Rsaref-2.0]:rsa encryption module

As I said before, the release of this directory is special, the first list is released, I hope you do.


CP-RP Install/unix Local
CD Local
Make
MV RSAREF.A LIBRSAREF.A



22. [Openssl-engine-0.9.6c]:openssl Engine


./config-prefix=/usr/local/ssl-l ' pwd '/.. /rsaref-2.0/local/rsaref–fpic
Make
Make Test
Make install



23, [mod_ssl-2.8.6-1.3.23]


./configure--with-apache=. /apache_1.3.23



24. [Apache_1.3.23] Step Two


./configure--prefix=/usr/local/apache--enable-shared=ssl
--enable-module=ssl--activate-module=src/modules/php4/libphp4.a
Make
Make certificate Type=custom (answer some questions)
Make install



25. Finishing work:

To edit the/usr/local/apache/conf/httpd.conf file, add one line:


AddType application/x-httpd-php. php



26, with the command/usr/local/apache/bin/apachectl configtest Check the correctness of the configuration file.

27. Start Apache server with/usr/lcoal/apache/bin/apachectl start

28, in/usr/local/apache/htdocs to establish a test.php file contains the following content:


  
Phpinfo ();
?>



29, in other machines with a browser to see the machine: http://xxx.xxx.xxx.xxx/test.php will appear in the configuration of PHP, see the previous compiled modules are not in.

30, check SSL is very troublesome, need to use Apachectl Startssl to start Apache and then also generate a lot of certificates. There's no discussion here.

31, copy the/usr/local/apache/bin/apachectl file into the/ETC/RC.D/INIT.D, and then establish a symbolic connection in/ETC/RC.D/RD3.D to the above file in/ETC/RC.D/INIT.D:


Ln-s.. /init.d/apachectl S70apachectl



This allows the system to start automatically with Apache and her large stack of modules.

Call ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Here, basically completes a full-featured Web server system.

(5) Install FTP server

(6) Install POP3 server

Some mail servers themselves with POP3 functions (such as qmail, Xmail), if you use these kinds of mail server software, of course, do not install POP3. At present, the commonly used mail server does not carry POP3 as if only SendMail and postfix and so on a few. These types of mail server software are used by system users, and the POP3 we install is only a pop-up operation of the system user's mail. The version and download address we use here are:


Qpopper4.0.3.tar.gz
http://www.eudora.com/qpopper_general/



Similarly, download the file to/usr/local/src and install the following steps:


Tar zxvf qpopper4.0.3.tar.gz
CD qpopper4.0.3
./configure
Make
Make install



When finished, the Qpopper is installed in the/usr/local/sbin (if you want to put it somewhere else, you can use it in front of the./configure–prefix=/your_path), the file is called Popper. Typically, Popper is loaded as a child process of a inetd (Super Network Service process). This requires editing the file/etc/inetd.conf and making the following changes: ...


# POP3 Mail Server

#pop-3 Stream TCP nowait ROOT/USR/SBIN/TCPD ipop3d
pop-3 Stream TCP nowait root/usr/local/sbin/popper qpopper–s
...



Add this line in bold, comment out the original (above line), and note that if your installation path is different, remember to mend it. Then, use the following command to get the inetd process number:


Ps–ax | grep inetd



The results are similar:


248? S 0:00 inetd



What the? Which is the process number? That's the first number in the front. Then restart the inetd with the following command:


Kill–hup 248



Use the following command to see if POP3 is starting.


Netstat-ln|grep 110



If it turns out to be so, congratulations.


TCP 0 0 0.0.0.0:110 0.0.0.0:* LISTEN



It is also added that in a few cases, the POP3 process requires a separate listening port, which is not loaded as a child of the inetd process, which requires the following changes:

Add--enable-standalone parameters when/configure.

Edit/etc/inetd.conf does not increase the black line, but you need to comment out the original pop-3 line (if any).

When you start, run the/usr/local/sbin/popper xxx.xxx.xxx.xxx:110 directly. The following argument is a local IP address and port that requires a few listening. Note that there is no special need for the port to be 110. The last thing to say is: In fact, the simplest way is to use the Linux distribution of your POP3 software, install the time directly selected.


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.