'종합문제'에 해당되는 글 2건

  1. 2015.04.06 [40] 종합문제(2)
  2. 2015.04.06 [39] 종합문제(1)_nfs, automount, dns, Apache, mysql

[40] 종합문제(2)

|


- 2015.01.02




[문제]


어제 종합문제에 이은 문제.


dns, web : 192.168.1.10

sub.it.com

xe 페이지 뜨도록 설정


db : 192.168.1.20

        db : subuser, subdb




[db 서버]


# mysql -u root -p mysql

mysql> create database subdb;

mysql> grant all privileges on subdb.* to 'subuser'@'192.168.1.10' identified by 'samadal' with grant option;




[dns, web 서버]


php 설치


# rpm -ivh php*

오류: Failed dependencies:

        libXpm.so.4 is needed by php-gd-5.3.3-38.el6.i686

        libodbc.so.2 is needed by php-odbc-5.3.3-38.el6.i686

        libpq.so.5 is needed by php-pgsql-5.3.3-38.el6.i686


# rpm -ivh libXpm-3.5.10-2.el6.i686.rpm

# rpm -ivh php* --nodeps


dns 설정

# vi /var/named/it.z

     15 sub     IN      A       192.168.1.10


# vi /var/named/it.r

     15 10      IN      PTR     sub.it.com.


# /etc/rc.d/init.d/named restart


# mkdir -p /export/home

# useradd -d /export/home/sub sub

# passwd sub


xe 압축해제 후 권한 설정


# chmod o+x /export/home/sub/

# chmod 707 /export/home/sub/public_html/


xe 설정 중 db server ip 는 192.168.1.20 으로 지정




And


[39] 종합문제(1)_nfs, automount, dns, Apache, mysql

|


- 2014.12.31




[문제]


기존에 사용하던 Server 삭제 후 압축 2개 풀기


- DNS : 192.168.1.10

1) HDD : 1G(SCSI) : 200, 300, 500

2) automount

3) nfs로 200, 300, 500 빌려주기

4) host : ns, www, cafe, bank

5) domain : it.com


- WEB, DB : 192.168.1.20

1) nomal nfs(자동) : 200, 300

2) autofs : 500

3) web  : www = 500 (/export/home/main/public_html) main 사용자

        : cafe = 300 (/hosting/home/cafe/public_html) cafe 사용자

        : bank = 200 (/hosting/bank)

4) db : dbwww, dbcafe

5) dbuser : userwww, usercafe

6) xe : www, cafe

7) index : bank.html

8) userdir : ~samadal  입력시 내용이 뜨도록

9) alias : /newyear    입력시 내용이 뜨도록

모든 설정 완료 후 DNS쪽 불여시에서 www.it.com, cafe.it.com, bank.it.com 입력 시 www, cafe 는 xe페이지가, bank는 bank.html 문서가 뜨도록 설정하세요




- 공통 설정


root 권한 획득 및 /etc/inittab 설정

network 설정



- DNS 측 설정


HDD 추가 및 automount

exports 설정 (nfs)

     방화벽 설정

bind 설치

DNS 설정

     .10 <-> ns.it.com.

     .20 <-> 나머지



- WEB, DB 측 설정


automount 설정

skel 설정 후 main, cafe 사용자 생성

     사용자들이 $HOME 이 다른 서버에 위치해있기 때문에 $HOME의 소유주는 NOBODY 이다.

mysql, php 설치

http 및 mysql 설정 




[해답]


- 2014.12.31



[공통 설정]


root 권한 획득 및 /etc/inittab 설정

# vi /etc/inittab

     26 id:5:initdefault:


network 설정

# vi /etc/sysconfig/network-scripts/ifcfg-eth0

      1 DEVICE=eth0

      2 TYPE=Ethernet

      3 ONBOOT=yes

      4 BOOTPROTO=none

      5 IPADDR=192.168.1.10

      6 PRIFIX=24

      7 GATEWAY=192.168.1.2

      8 DNS1=192.168.1.10

      9 DNS2=192.168.1.2

     10 DNS3=168.126.63.1



[ DNS 측 설정]


HDD 추가 및 automount

# vi /etc/fstab

     19 /dev/sdb1       /sdb1   ext4    defaults        1 2

     20 /dev/sdb2       /sdb2   ext4    defaults        1 2

     21 /dev/sdb3       /sdb3   ext4    defaults        1 2

     22 /dev/cdrom      /cd     iso9660 defaults        1 2


exports 설정 (nfs)

# vi /etc/exports

      1 /sdb1   192.168.1.0/24(rw,no_root_squash)

      2 /sdb2   192.168.1.0/24(rw,no_root_squash)

      3 /sdb3   192.168.1.0/24(rw,no_root_squash)


bind 설치


DNS 설정

# vi /etc/named.conf

     11         listen-on port 53 { any; };

     12         listen-on-v6 port 53 { any; };

     17         allow-query     { any; };

     18         recursion no;


# vi /etc/named.rfc1912.zones

     43 zone "it.com" IN {

     44         type master;

     45         file "it.z";

     46         allow-update { none; };

     47 };

     48

     49 zone "1.168.192.in-addr.arpa" IN {

     50         type master;

     51         file "it.r";

     52         allow-update { none; };

     53 };


# vi /var/named/it.z

      1 $TTL 1D

      2 @       IN      SOA     ns.it.com. root.it.com.(

      3                         2014123101

      4                         3H

      5                         15M

      6                         1W

      7                         1D)

      8         IN      NS      ns.it.com.

      9

     10         IN      A       192.168.1.20

     11 ns      IN      A       192.168.1.10

     12 www     IN      A       192.168.1.20

     13 cafe    IN      A       192.168.1.20

     14 bank    IN      A       192.168.1.20


# vi /var/named/it.r

      1 $TTL 1D

      2 @       IN      SOA     ns.it.com. root.it.com.(

      3                         2014123101

      4                         3H

      5                         15M

      6                         1W

      7                         1D)

      8         IN      NS      ns.it.com.

      9

     10 10      IN      PTR     ns.it.com.

     11 20      IN      PTR     it.com.

     12 20      IN      PTR     www.it.com.

     13 20      IN      PTR     cafe.it.com.

     14 20      IN      PTR     bank.it.com.


# /etc/rc.d/init.d/named restart

# /etc/rc.d/init.d/nfs restart

# chkconfig named on

# chkconfig nfs on

# system-config-firewall

        NFS4 활성화




[ WEB, DB 측 설정]


automount 설정

# vi /etc/fstab

     20 192.168.1.10:/sdb2      /hosting/home   nfs     defaults 1 2

     21 192.168.1.10:/sdb1      /hosting/bank   nfs     defaults 1 2


# vi /etc/auto.master

      7 /export /etc/auto.misc


# vi /etc/autofs.conf

     38 browse_mode = yes


# vi /etc/auto.misc

     16 home            -rw,hard,intr           192.168.1.10:/sdb3


skel 설정 후 main, cafe 사용자 생성

     사용자들이 $HOME 이 다른 서버에 위치해있기 때문에 $HOME의 소유주는 NOBODY 이다.


mysql, php 설치


http 및 mysql 설정

# vi /etc/httpd/conf/httpd.conf

     44 ServerTokens PROD

    262 ServerAdmin root@it.com

    277 ServerName www.it.com:80

    366     UserDir disabled

    367     UserDir enable samadal

    374     UserDir public_html

    403 DirectoryIndex index.html index.php index.html.var bank.html

    552 Alias /newyear "/newyear"

   1012 <VirtualHost 192.168.1.20:80>

   1013     DocumentRoot /export/home/main/public_html

   1014     ServerName it.com

   1015 </VirtualHost>

   1016 <VirtualHost 192.168.1.20:80>

   1017     DocumentRoot /export/home/main/public_html

   1018     ServerName www.it.com

   1019 </VirtualHost>

   1020 <VirtualHost 192.168.1.20:80>

   1021     DocumentRoot /hosting/home/cafe/public_html

   1022     ServerName cafe.it.com

   1023 </VirtualHost>

   1024 <VirtualHost 192.168.1.20:80>

   1025     DocumentRoot /hosting/bank

   1026     ServerName bank.it.com

   1027 </VirtualHost>



# /etc/rc.d/init.d/autofs restart

# /etc/rc.d/init.d/httpd restart

# /etc/rc.d/init.d/mysqld restart

# chkconfig autofs on

# chkconfig httpd on

# chkconfig mysqld on




And


prev | 1 | next