The company adds dozens of new servers each month. It is too tired to install one server. It is easy to install 60 systems within one hour through the following methods. Environment: 192.168.5.20.dhcpserver, Ubuntu10.04192.168.5.150-200 dhcpclient, all pxeboot configurations
The company adds dozens of new servers each month. It is too tired to install one server. It is easy to install 60 systems within one hour through the following methods.
Environment:
192.168.5.112 dhcp server, Ubuntu 10.04
192.168.5.150-200 dhcp client, pxe boot
All configurations are performed on 192.168.5.112.
1. Install dnsmasq
Apt-get install dnsmasq
2. Configure dnsmasq
Vi/etc/dnsmasq. conf
Bogus-priv
Filterwin2k
Interface = eth0
Dhcp-range = 192.168.5.150, 192.168.5.250, 12 h
Dhcp-boot = pxelinux.0
Enable-tftp
Tftp-root =/var/ftpd
Dhcp-authoritative
3. Install apache2 and create related directories
Apt-get install apache2
Mkdir/var/www/ubuntu
Mount-o loop ~ /Ubuntu10.04.iso/mnt
Cp/mnt/preseed/ubuntu-server.seed/var/www/ubuntu
Cp-a/mnt/*/var/www/ubuntu
Cp-r/mnt/install/netboot/*/var/ftpd/
4. Modify pxe Configuration
Vi/var/ftpd/pxelinux. cfg/default
Label linux
Kernel ubuntu-installer/amd64/linux
Append ks = http: // 192.168.5.112/ubuntu/ks. cfg preseed/url = http: // 192.168.5.112/ubuntu/ubuntu-server.seed vga = normal initrd = ubuntu-installer/amd64/initrd.gz-
5. Modify ks. cfg
Vi ks. cfg
# System language
Lang en_US
# Language modules to install
Langsupport en_US
# System keyboard
Keyboard us
# System mouse
Mouse
# System timezone
Timezone Asia/Chongqing
# Root password
Rootpw-disabled
# Initial user gaojinbo/gaojinbo.com
User gaojinbo-fullname "gaojinbo.com"-iscrypted-password $1 $ YKmaOIb5 $/13bs7gCjaoH./ohFT0A7/
# Reboot after installation
Reboot
# Use text mode install
Text
# Install OS instead of upgrade
Install
# Use Web installation
Url-url http: // 192.168.5.112/ubuntu
# System bootloader configuration
Bootloader-location = mbr
# Clear the Master Boot Record
Zerombr yes
# Partition clearing information
Clearpart-all-initlabel
# Disk partitioning information
Part/-fstype ext4-size 10000
Part swap-size 5000
Auth-useshadow-enablemd5
# Network-bootproto = dhcp-device = eth0
Network-bootproto = static-ip = 192.168.5.168-netmask = 255.255.255.0-gateway = 192.168.5.112-nameserver = 221.5.88.88-device = eth0
Firewall-disabled
Skipx
% Packages
@ Openssh-server
Note:
Generate Password
Echo gaojinbo.com | openssl passwd-1-stdin
6. Modify ubuntu-server.seed Configuration
Vi ubuntu-server.seed
# Suggest LVM by default.
D-I partman-auto/init_automatically_partition string some_device_lvm
D-I partman-auto/init_automatically_partition seen false
# Always install the server kernel.
D-I base-installer/kernel/override-image string linux-server
# Install the Ubuntu Server seed.
Tasksel/force-tasks string server
# Only install basic language packs. Let tasksel ask about tasks.
D-I pkgsel/language-pack-patterns string
# No language support packages.
D-I pkgsel/install-language-support boolean false
# Only ask the UTC question if there are other operating systems installed.
D-I clock-setup/utc boolean false
D-I clock-setup/ntp boolean false
D-I apt-setup/use_mirror boolean false
D-I netcfg/get_ipaddress string 127.0.0.1
D-I mirror/http: // hostname string 127.0.0.1
D-I apt-setup/restricted boolean false
# No boot splash screen.
D-I debian-installer/splash boolean false
# Install the debconf oem-config frontend (if in OEM mode ).
D-I oem-config-udeb/frontend string debconf
# Add the network and tasks oem-config steps by default.
Oem-config/steps multiselect language, timezone, keyboard, user, network, tasks
7. Restart dnsmasq
/Etc/init. d/dnsmasq restart
It's quite easy. Seven steps :)
Done!