Install CentOS6.5 on the network

Source: Internet
Author: User

Install CentOS6.5 on the network

Lab environment: vmworkstation10, centos6.5, remote terminal xshell, and apache has been installed in the operating system. The ip address of the VM is 192.168.1.55.

The service to be started when the server is installed on the network.

DHCP: it is used to assign an IP address to the client during startup and tell the client to find the boot program to start and install the system on the tftp server.

Tftp: Provides boot system boot programs and boot kernel.

File Server: Provides software packages required during installation and kickstart response files.

The client needs to connect the network to the same network as the server, and the bios of the device allows the network to start. Ensure that the first boot item is network boot.

Install and configure the dhcp service

# Rpm-qadhcp # Check whether the dhcp package is installed. If no installation is performed, skip the next step. # Yum-yinstalldhcp # Use yum to install dhcp

# Vim/etc/dhcp/dhcpd. conf # edit the dhcp configuration file. For details, refer to/usr/share/doc/dhcp <the same as the dhcp package version>/dhcpd. conf. sample. This is the template of the dhcp configuration file. The line starting with option is to configure network information for the client, and the remaining configuration is to configure the work characteristics of the dhcp server. The configuration file here is as follows.

Optiondomain-name "wukui.com"; # The domain optiondomain-name-servers8.8.8.8 to which the client belongs; # assigned to the customer mechanism dnsdefault-lease-time600; # lease time, in seconds. Max-lease-time7200; # maximum lease time, log-facilitylocal7 in seconds; # record DHCP Server Directory level subnet192.168.1.0netmask1_255.255.0 {# mark the network to be allocated, {} for a whole. Range192.168.1.60192.168.1.100; # address pool optionrouters192.168.1.1; # client's default gateway next-server192.168.1.55; # This is used when installing the operating system on the network, specify the first tftp server to be found after the client gets the network configuration. Filename "pxelinux.0"; # specify to read files on the tftp server. Hostwinxp {# specifies a MAC address to obtain the specified IP address. This section is not used here. It is just used to notify a single host of IP allocation. Hardwareethernet00: 11: 22: 33: 44: 55; # hardware address fixed-address192.168.1.88; # IPoptionrouters192.168.1.1; # gateway allocated to this IP address Host }}

Install and configure the tftp server. The tftp package is a client, and the tftp-server is a server. Tftp depends on the super daemon xinetd to start the listening service. xinetd must be started before the tftp service can be used.

# Yum-yinstalltftp-server # yum-yinstalltftp # vim/etc/xinetd. d/tftp # modify the disable value to no, and do not modify anything else. Servicetftp {socket_type = dgramprotocol = udpwait = yesuser = rootserver =/usr/sbin/in. tftpdserver_args =-s/var/lib/tftpbootdisable = no # modify the value here to no. After xinetd is started, the tftp listening port will be used. Per_source = 11cps = 1002 flags = IPv4}


Record the xinetd service and test tftp.

# Servicexinetdrestart # restart the xinetd service to listen to the tftp service. # Rpm-qltftp-server # Check the files generated by the tftp-server software package. Here we mainly look at the directory where the service is provided/etc/xinetd. d/tftp/usr/sbin/in. tftpd/usr/share/doc/tftp-server-0.49/usr/share/doc/tftp-server-0.49/CHANGES/usr/share/doc/tftp-server-0.49/README/usr/share/doc/tftp-server-0.49/README. security/usr/share/doc/tftp-server-0.49/README. security. tftpboot/usr/share/man/man8/in.tftpd.8.gz/usr/share/man/man8/tftpd.8.gz/var/lib/tftpboot # main directory for providing services

Test tftp to see if the file can be uploaded and downloaded normally. After entering tftp, you cannot use commands such as ls. Use help to get help

# Ss-unl | grep69 # Check whether tftp listens to the udp69 port. # Cp/etc/passwd/var/lib/tftpboot/# tftp192.168.1.55> getpasswd> quit # lspasswd # Check whether files can be downloaded. Make sure that the tftp service is correct.

Copy the files required for startup to the tftp directory. The following is a brief description of the role of each file.

Pxelinux.0 is similar to the grub boot program. The file is located in/usr/shate/syslinux/pxelinux.0. After it is loaded, a command line similar to grub will appear. Then load the Linux kernel and ramdisk on tftp. Load anaconda (the software maintained by fedora to install the operating system) to install the system.

Graphical interface when vesamenu. c32pxelinux. 0 is loaded.

Splash.jpg loads the background image inside the image.

The function configuration file of the content displayed in the isolinux. cfg graphic interface. Here I mainly specify the file for installing the automatic response file of the operating system. This file must be copied to the pxelinux. cfg directory in the tftp home directory, and the file name must be default

The above three files are stored in the isolinux directory on the CD.

The Linux kernel started from the vmlinuz network.

Initrd. img helps the kernel to load the driver of the client's large disk.

The above two files are stored in the image/pxeboot directory on the CD.

Configuration File defaultvesamenu. c32timeout60 # specify the timeout time to 6 seconds. Displayboot.msgmenubackgroundsplash.jpg menutitleWelcometoCentOS6.5! Menucolorborder0 # ffffffff # kernel # FFFF00 # kernel # ffffffff # kernel ^ kernel = # parameter, specifies the location of the configuration file. Appendinitrd = initrd. img

Now, the configuration file server and kickstart automatically respond to the file. File Service uses apache. The httpd service has been installed on my system. So you can start it directly.

Prepare the Operating System Installation File

# Servicehttpdstart # start apache # cp-r/media/*/var/www/html/centos/# copy the files required during operating system installation to the centos directory under the root directory of the website make kickstart automatic response file template file is/root/anaconda-ks.cfg, refer to this file. You can also use the graphical Configuration Tool system-config-kickstart to configure the response file. This software needs to be installed. # Yum-yinstallsystem-config-kickstart # system-config-kickstart # Start the image Configuration window. I tried not to use it in putty. The startup interface is as follows.

Configure the time zone and root Password

The url of the file required to install the operating system. Here, point to my CD file.

Partition configuration, and grub installation configuration. However, LVM is not supported. To use LVM, You need to refer to the template file and manually add it. Partition depends on your own situation. Pay attention to backing up data .!!

Select the software package to install

There are also scripts for installation and execution. At last, click the file button to save the file, which is saved in the current working directory.

Place the response file in the apache root directory and ensure that the file can be accessed. Make sure that the kernel vmlinuz ks = http: // 192.168.1.55/ks. cfg in the/var/lib/tftpboot/pxelinux. cfg/default file points to the correct r Response file.

Related Article

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.