[root@centos7 ~]# system-config-kickstart [root@centos7 ~]# vim ks6.cfg #platform=x86, AMD64, or Intel EM64T #version=DEVEL # Firewall configuration firewall --disabled # Install OS instead of upgrade install # Use network installation url --url="http://192.168.73.120/centos/6/os/x86_64" # Root password rootpw --iscrypted $1$6oVXZR1R$QOASc6inirmHCZmQ.W9Hg0 # System authorization information auth --useshadow --passalgo=sha512 # Use text mode install text # System keyboard keyboard us # System language lang en_US # SELinux configuration selinux --disabled # Do not configure the X Window System skipx # Installation logging level logging --level=info # Reboot after installation reboot # System timezone timezone Asia/Shanghai # Network information network --bootproto=dhcp --device=eth0 --onboot=on # System bootloader configuration bootloader --location=mbr # Clear the Master Boot Record zerombr # Partition clearing information clearpart --all --initlabel # Disk partitioning information part /boot --fstype="ext4" --size=200 part / --fstype="ext4" --size=20000 part swap --fstype="swap" --size=1024
[root@centos7 ~]# cp ks6.cfg ks7.cfg [root@centos7 ~]# vim ks7.cfg #platform=x86, AMD64, or Intel EM64T #version=DEVEL # Firewall configuration firewall --disabled # Install OS instead of upgrade install # Use network installation url --url="http://192.168.73.120/centos/7/os/x86_64"#将url改为7的url # Root password rootpw --iscrypted $1$6oVXZR1R$QOASc6inirmHCZmQ.W9Hg0 # System authorization information auth --useshadow --passalgo=sha512 # Use text mode install text # System keyboard keyboard us # System language lang en_US # SELinux configuration selinux --disabled # Do not configure the X Window System skipx # Installation logging level logging --level=info # Reboot after installation reboot # System timezone timezone Asia/Shanghai # Network information network --bootproto=dhcp --device=ens33 --onboot=on #将网卡名修改为ens33 # System bootloader configuration bootloader --location=mbr # Clear the Master Boot Record zerombr # Partition clearing information clearpart --all --initlabel # Disk partitioning information part /boot --fstype="ext4" --size=200 part / --fstype="ext4" --size=20000 part swap --fstype="swap" --size=1024
%packages @core
%end
三、配置httpd服务
1.创建http目录
bash
1 2 3 4 5 6 7 8 9
[root@centos7 ~]# mkdir -pv /var/www/html/{centos/{6,7}/os/x86_64,ksdir} mkdir: created directory ‘/var/www/html/centos’ mkdir: created directory ‘/var/www/html/centos/6’ mkdir: created directory ‘/var/www/html/centos/6/os’ mkdir: created directory ‘/var/www/html/centos/6/os/x86_64’ mkdir: created directory ‘/var/www/html/centos/7’ mkdir: created directory ‘/var/www/html/centos/7/os’ mkdir: created directory ‘/var/www/html/centos/7/os/x86_64’ mkdir: created directory ‘/var/www/html/ksdir’
2.将CentOS6及7的光盘文件挂在至相关的目录下(工作中可以直接将光盘镜像复制至目录下)
bash
1 2 3 4 5 6 7 8 9 10
[root@centos7 ~]# lsblk | grep sr sr0 11:0 1 10G 0 rom /mnt sr1 11:1 1 3.7G 0 rom [root@centos7 ~]# mount /dev/sr0 /var/www/html/centos/7/os/x86_64/ mount: /dev/sr0 is write-protected, mounting read-only [root@centos7 ~]# mount /dev/sr1 /var/www/html/centos/6/os/x86_64/ mount: /dev/sr1 is write-protected, mounting read-only [root@centos7 ~]# lsblk | grep sr sr0 11:0 1 10G 0 rom /var/www/html/centos/7/os/x86_64 sr1 11:1 1 3.7G 0 rom /var/www/html/centos/6/os/x86_64
[root@centos7 ~]# vim /etc/dhcp/dhcpd.conf # option definitions common to all supported networks... option domain-name "mylinuxops.com"; #指定预添加域名 option domain-name-servers 114.114.114.114; #指定DNS服务器
default-lease-time 6000; max-lease-time 72000;
...中间省略...
# No service will be given on this subnet, but declaring it helps the # DHCP server to understand the network topology.