티스토리 뷰


kickstart 정의

네트워크 부팅(pxebooting)으로 서버 및 PC의 OS를 automatic으로 설치하는 서비스이다.

필요사항

DHCP 서버: 리눅스가     설치될     클라이언트에게 IP를     할당해주고 TFTP서버에서     이미지를     받게     해주는     역할을     한다.

TFTP 서버: PXE 부팅시     리눅스     부팅용     커널과     램디스크     이미지를     제공

 

NFS 혹은 FTP,HTTP 서버: 설치용     파일들을     제공.OS 환경

 

Centos 6.3 64bit / VMWARE esxi 5.1

설치하기

dhcp 서버 설치 및 설정

yum install dhcp

vi /etc/dhcpd/dhcpd.conf

allow booting;

allow bootp;

   

#boot-unknown-clients false;

   

default-lease-time 600;

max-lease-time 7200;

   

option domain-name "zeroblack.net";

option domain-name-servers 1.1.1.2,1.1.1.3;

   

   

option ip-forwarding false;

option mask-supplier false;

ddns-update-style none;

next-server 192.168.137.6; //kickstart 서버 ip

filename "pxelinux.0";

   

subnet 192.168.137.0 netmask 255.255.255.0 {

        option routers 192.168.137.1;  //gateway 설정

 

        range 192.168.137.140 192.168.137.240;

}

host test1     { hardware ethernet 00:0c:29:86:c0:95; fixed-address 192.168.99.141; }

dhcp 서버

     구동

 

/etc/init.d/dhcpd start or restart

tftp server 설치 및 설정

yum install tftp-server

vi /etc/xinetd.d/tftp

service tftp

{

       socket_type             = dgram

       protocol                = udp

       wait                    = yes

       user                    = root

       server                  = /usr/sbin/in.tftpd

       server_args             = -s /tftpboot

       disable                 = no (yes에서 no로

     변경)

       per_source              = 11

       cps                     = 100 2

       flags                   = IPv4

}

tftp 구동

 

/etc/init.d/xinetd start or restart


@방화벽 설정 및 해제 sh#iptables -L

Chain INPUT (policy ACCEPT)

 target     prot opt source               destination

Chain FORWARD (policy ACCEPT)

 target     prot opt source               destination 

Chain OUTPUT (policy ACCEPT)

 target     prot opt source               destination

   

<b>@iptables 해제</b>

sh#iptables -F

@selinux 설정 및 해제

sh#sestatus - enforcing 설정으로

     인한 tftp permission denied 발생됨

 

SELinux status:                 enabled

SELinuxfs mount:                /selinux

Current mode:                   enforcing

Mode from config file:          enforcing

Policy version:                 24

Policy from config file:        targeted

selinux 해제

 

sh# restorecon -r -F /tftpboot

httpd server 설치 및 설정

yum -y install  httpd

vim /etc/httpd/conf/httpd.conf 

 #도큐멘트

     위치를

     확인한다.

 DocumentRoot "/var/www/html"

#http 서비스

     구동

 

service httpd start

centos 6 복사

#파일질라로

     통하여 os 이미지 vmware 서버로 copy 

- 파일질라

     설치

     후 host=sftp://192.168.137.6 username=root password=password입력 Quick connect

/root/에 iso 파일

     복사

     진행

 

mount -t iso9660 -o loop Centos6.3_i386.iso /tmp

mkdir -p /var/www/html/centos/6

cp -a /tmp/* /var/www/html/centos/6/

#web페이지에서

     실제로

     접근이

     가능한지

     확인

 

 iptables -F(방화벽

     해제) 후

 

 


     http://192.168.137.6/centos/6  - 정상적인 iso image 내용이

     나오는지

     확인한다.

pxeboot 파일 복사

 

     보통     설치CD/images/pxeboot/ 디렉토리에     네트워크     부팅을     위한     커널과     램디스크     이미지     파일이    있다.

 mkdir -p /tftpboot/centos6

 cp -a /var/www/html/centos/6/images/pxeboot/* /tftpboot/centos6/

pxelinux.0 복사

- pxelinux.0가 centos6은

     기본

     지원이

     아니므로

 

  yum install syslinux - 설치

 

  cd /usr/share/syslinux/ 에

     존재하게

     된다 .

 cp /usr/share/syslinux/pxelinux.0 /tftpboot/

pxelinux.cfg 설정

mkdir /tftpboot/pxelinux.cfg

vi default 

timeout=30

default centos6

label centos6

 kernel centos6/vmlinuz

 append ksdevice=link load_ramdisk=1 initrd=centos6/initrd.img network ks=http://192.168.137.6/ks/ks.cfg
    

 

label CentOS5

 kernel CentOS5/vmlinuz

 append ksdevice=link load_ramdisk=1 initrd=CentOS5/initrd.img network ks=nfs:NFS....:/ks/ks.cfg

default 설정은 ip 주소를 16진수로     변환과정     중     해당이     안될경우는     가장     최상위     디폴트     값으로     설치하는     경우이다.

만약 192.168.0 에     대역은     설치방법(os 버젼, 패키징, 파일시스템     다른     경우 ) 16진수로     변환시켜     만든     파일로     설치가     가능하다.

# 16진수

     변환방법

 

 printf "%02x%02x%02x" 192 168 0

 c0a800

ks.cfg파일 설정

mkdir /var/www/html/ks/

#centos 6를     설치한     아나콘다     파일을     활용하여 ks.cfg를 configuation 한다.

cp /root/anaconda-ks.cfg /var/www/htl/ks/ks.cfg

vi ks.cfg

install

url --url http://192.168.137.6/centos/6

lang en_US.UTF-8

keyboard us

skipx

network --device eth0 --bootproto static --ip 192.168.137.11 --netmask 255.255.255.0 --gateway 192.168.137.1 --nameserver 192.168.137.6 --hostname kstest01.linuxz.kr

rootpw  --iscrypted $6$4MnIsCtC/IG4IplW$UAvhmTdI71MlmVMvdjTO4ERNFb3nFBJ3JeBTDnFjKydn5Z.TNaiRxfXND/ZpYqJmZB6YoECvZD9yBuF9hXhyj0

firewall --disabled

timezone asia/seoul

bootloader --location=mbr --driveorder=sda --append="crashkernel=auto rhgb quiet"

zerombr

clearpart --all --initlabel

part / --fstype ext4 --size=1 --grow --ondisk=sda

part swap --size=4000 --ondisk=sda

   

%packages

@base

@console-internet

@core

@debugging

@directory-client

@hardware-monitoring

@java-platform

@large-systems

@network-file-system-client

@performance

@perl-runtime

@server-platform

@server-policy

pax

oddjob

sgpio

certmonger

pam_krb5

krb5-workstation

perl-DBD-SQLite

APM 추가설치하여 web으로 ks화면 구현하기

APM 설치하기

- 보안 옵션 문제로 아래와 같이 diabled 작업 진행 선작업이 되어야한다.vi /etc/selinux/config - 진행 후 리부팅

SELINUX=enfored => disabled 변경

 

mysql,php 설치 및 설정 하기


sh#yum install -y mysql php mysql-server php-mysql

@라이브러리 설치

yum -y install gd gd-devel

yum -y install libpng libpng-devel libjpeg libjpeg-devel freetype

yum -y install freetype-devel fontconfig fontconfig-devel libxml2

yum -y install libxml2-devel openssl openssl-devel gmp-devel mhash

yum -y install mhash-devel libmcrypt libmcrypt-devel

yum -y install php-devel php-gd php-mbstring php-mhash


vi /etc/httpd/conf/httpd.conf
맨 하단에 추가

addtype application/x-httpd-php .php .php3 .html .htm .inc

cp /usr/share/mysql/my-large.cnf /etc/my.cnf
overwrite ? yes

chown -R mysql /var/lib/mysql/

chown -R root /usr/bin/

chgrp -R mysql /usr/bin/

   

/usr/bin/mysql_install_db --user=mysql 

@skip-locking 진행

perl -pi -e "s/skip-locking/skip-external-locking/g" /etc/my.cnf

@password 초기화하기
[root@localhost libexec]# mysqld_safe --skip-grant &

[root@localhost libexec]# 130307 02:47:47 mysqld_safe Logging to '/var/lib/mysql/localhost.localdomain.err'.

130307 02:47:47 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql

[root@localhost libexec]# mysql

Welcome to the MySQL monitor.  Commands end with ; or \g.

Your MySQL connection id is 1

Server version: 5.1.67-log Source distribution

   

Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.

   

Oracle is a registered trademark of Oracle Corporation and/or its

affiliates. Other names may be trademarks of their respective

owners.

   

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

   

mysql> select * from user;

ERROR 1046 (3D000): No database selected

mysql> use mysql;

Database changed

mysql> select * from user;

Empty set (0.00 sec)

   

mysql> truncate table user;

Query OK, 0 rows affected (0.00 sec)

   

mysql> flush privileges;

Query OK, 0 rows affected (0.01 sec)

   

mysql> grant all privileges on *.* to root@localhost identified by 'nh123' with grant option;

Query OK, 0 rows affected (0.00 sec)

   

mysql> flush privileges;

Query OK, 0 rows affected (0.00 sec)

   

mysql> select host,user from user;

+-----------+------+

| host      | user |

+-----------+------+

| localhost | root |

+-----------+------+

1 row in set (0.00 sec)

   

mysql> quit

Bye

[root@localhost libexec]# service mysqld restart

Stopping mysqld:                                           [  OK  ]

Starting mysqld:                                           [  OK  ]

[root@localhost libexec]# mysql -u root -p

Enter password:

Welcome to the MySQL monitor.  Commands end with ; or \g.

Your MySQL connection id is 3

Server version: 5.1.67-log Source distribution

   

Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.

   

Oracle is a registered trademark of Oracle Corporation and/or its

affiliates. Other names may be trademarks of their respective

owners.

   

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

   

mysql>

php 인식

vi /etc/php.ini //수정

short_open_tag =off -> On

vi /etc/httpd/conf.d/php.conf //추가

AddType application/x-httpd-php-source .phps .inc .html

DirectoryIndex index.php -> DirectoryIndex index.php index.html index.htm

출처 : http://blog.naver.com/elshada7/120183836554

공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
링크
TAG
more
«   2024/05   »
1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31
글 보관함