Linux/CentOS2012. 3. 7. 15:13

 
@ 패키지 제거 및 설치
# rpm -qa httpd php mysql
# yum remove -y httpd php mysql

@ 서버운영에 필요한 소스 및 라이브러리 추가

# yum -y install ORBit2 PyXML a2ps acpid alsa-lib amtu aspell at atk audiofile audit-libs-python autoconf autofs automake avahi avahi-glib bc bind bind-chroot bind-libs bind-utils cairo ccid compat-libstdc++-33 conman cpp cpuspeed crash createrepo crypto-utils cryptsetup-luks cups-libs cvs cyrus-sasl-md5 cyrus-sasl-plain db4-devel dbus-python device-mapper-multipath dhcp dhcp-devel dialog dmraid dos2unix dosfstools dump e2fsprogs-devel ed eject elfutils elfutils-libs enscript expat-devel expect expect-devel expectk fetchmail file finger flex fontconfig fontconfig-devel foomatic freetype freetype-devel ftp gcc gcc-c++ gd gd-devel gd-progs gdb gdbm-devel gettext gfs2-utils glib2-devel glibc-devel glibc-headers gmp-devel gnutls gpm gtk2 hal hdparm hesiod hicolor-icon-theme imake iptraf iptstate ipvsadm irqbalance jwhois kernel-devel kernel-headers keyutils-libs-devel kpartx krb5-devel krb5-workstation ksh lcms lftp libICE libSM libX11 libX11-devel libXau libXau-devel libXcursor libXdmcp libXdmcp-devel libXext libXfixes libXft libXi libXinerama libXpm libXpm-devel libXrandr libXrender libXt libXxf86vm libaio libaio-devel libart_lgpl libbonobo libc-client libcurl-devel libdaemon libevent libfontenc libgomp libgssglue libhugetlbfs libhugetlbfs-devel libidn-devel libjpeg libjpeg-devel libmng libnl libnl-devel libpcap libpng libpng-devel libselinux-devel libselinux-python libsepol-devel libsmi libstdc++-devel libsysfs libtiff libtool libtool-ltdl libwvstreams libxml2-devel libxml2-python libxslt libxslt-python lksctp-tools logwatch lrzsz lsof m2crypto mailcap mailx make man man-pages man-pages-ko mc mcstrans mdadm memtest86+ mesa-libGL mesa-libGL-devel mgetty microcode_ctl mkbootdisk mlocate mrtg mt-st mtools mtr mutt nc ncurses-devel net-snmp-libs netpbm nfs-utils nfs-utils-lib nmap nscd nss_db ntp ntsysv numactl oddjob openssh-clients openssl-devel pam-devel pam_krb5 pam_passwdqc pam_pkcs11 pango parted parted-devel patch pax pciutils pcsc-lite perl perl-Archive-Tar perl-BSD-Resource perl-Compress-Zlib perl-DBI perl-Digest-HMAC perl-Digest-SHA1 perl-HTML-Parser perl-HTML-Tagset perl-IO-Socket-INET6 perl-IO-Socket-SSL perl-IO-Zlib perl-Net-IP perl-Net-SSLeay perl-Newt perl-Socket6 perl-String-CRC32 perl-URI perl-libwww-perl pkgconfig pm-utils postgresql-libs prelink procmail psacct psutils pulseaudio-esound-compat pyOpenSSL pykickstart pyorbit pyparted python-pyblock pyxf86config quota rdate rdist readahead rmt rpcbind rpm-build rsh rsync rusers rwho samba samba-client samba-common samba-swat sendmail sendmail-cf setools setserial setuptool shared-mime-info sip sos spamassassin squashfs-tools strace stunnel symlinks sysfsutils syslinux sysstat system-config-date system-config-firewall talk tcl tcp_wrappers tcpdump tcsh telnet telnet-server time tk tmpwatch traceroute tree ttmkfdir unix2dos unixODBC unzip usbutils usermode vconfig vim-common vim-enhanced vsftpd wget wireless-tools words xfsprogs xfsprogs-devel xinetd xorg-x11-proto-devel yp-tools ypbind ypserv zip zlib-devel GConf2 ImageMagick ImageMagick-perl avahi-libs bwidget cloog-ppl crda cryptsetup-luks-libs cups db4-cxx deltarpm desktop-file-utils device-mapper-multipath-libs dmidecode dmraid-events docbook-dtds flac foomatic-db foomatic-db-filesystem foomatic-db-ppds ghostscript ghostscript-fonts gnome-doc-utils-stylesheets gnome-python2 gnome-python2-canvas gnome-user-docs gnome-vfs2 gpm-libs groff-perl gstreamer gstreamer-tools hal-info hal-libs html2ps hunspell iw jasper-libs kpathsea lcms-libs libIDL libX11-common libXcomposite libXdamage libXdamage-devel libXext-devel libXfixes-devel libXfont libXres libXtst libXxf86vm-devel libasyncns libcanberra libcanberra-gtk2 libcom_err-devel libcroco libdrm-devel libedit libglade2 libgnomecanvas libgsf libnetfilter_conntrack libnfnetlink libnotify libogg libpaper librsvg2 libsamplerate libsndfile libtalloc libtasn1 libtdb libthai libtirpc libusb1 libvorbis libwmf-lite libwnck libxcb libxcb-devel lm_sensors-libs mesa-dri-drivers mozilla-filesystem mpfr mrtg-libs netpbm-progs notification-daemon ntpdate openjpeg-libs pcsc-lite-libs perl-Compress-Raw-Zlib perl-Crypt-OpenSSL-Bignum perl-Crypt-OpenSSL-RSA perl-Crypt-OpenSSL-Random perl-Date-Manip perl-Digest-SHA perl-Encode-Detect perl-ExtUtils-MakeMaker perl-ExtUtils-ParseXS perl-IO-Compress-Base perl-IO-Compress-Zlib perl-Mail-DKIM perl-MailTools perl-Module-Pluggable perl-Net-DNS perl-Net-LibIDN perl-NetAddr-IP perl-Package-Constants perl-Pod-Escapes perl-Pod-Simple perl-SNMP_Session perl-Test-Harness perl-Time-HiRes perl-TimeDate perl-YAML-Syck perl-devel perl-libs perl-version pixman poppler poppler-data poppler-utils portreserve ppl psutils-perl pulseaudio pulseaudio-libs pycairo pygobject2 pygtk2 pygtk2-libglade python-decorator python-deltarpm python-slip python-slip-dbus rarian rarian-compat rtkit samba-winbind-clients setools-console setools-gui setools-libs setools-libs-tcl sgml-common sgpio sound-theme-freedesktop speex startup-notification system-config-date-docs system-config-firewall-tui tex-preview texinfo texinfo-tex texlive texlive-dvips texlive-latex texlive-texmf texlive-texmf-dvips texlive-texmf-errata texlive-texmf-errata-dvips texlive-texmf-errata-fonts texlive-texmf-errata-latex texlive-texmf-fonts texlive-texmf-latex texlive-utils tokyocabinet urlview urw-fonts usermode-gtk xcb-util xml-common xorg-x11-font-utils xulrunner xz xz-lzma-compat yelp lksctp-tools-devel apr-util apr-util-devel libtool-ltdl-devel libmcrypt libmcrypt-devel gmp mhash mhash-devel gdbm zlib curl g++ openssl bzip2-devel libc-client-devel bison system-config-securitylevel

@ cmake 설치
# cd /usr/local/src
# wget http://www.cmake.org/files/v2.8/cmake-2.8.7.tar.gz
# tar zxvf cmake-2.8.7.tar.gz
# cd cmake-2.8.7
# ./bootstrap
# make; make install

@ mysql 최신버전 설치
# yum remove mysql*
# cd /usr/local/src
# wget http://www.mysql.com/get/Downloads/MySQL-5.5/mysql-5.5.27.tar.gz/from/http://mirror.khlug.org/mysql/
http://www.mysql.com/downloads/mysql/ 에서 Source Code 중,
Generic Linux (Architecture Independent), Compressed TAR Archive 최신버전을 Download 수행한다.
# tar zxvf mysql-5.5.27.tar.gz (최신버전) 
# cd mysql-5.5.27  (최신버전) 
# cmake -DCMAKE_INSTALL_PREFIX=/usr/local/mysql -DENABLED_LOCAL_INIFILE=1 -DWITH_INNOBASE_STORAGE_ENGINE=1 -DWITH_PARTITION_STORAGE_ENGINE=1 -DWITH_EXTRA_CHARSETS=all -DWITH_SSL=system -DWITH_ZLIB=system -DENABLED_LOCAL_INFILE=1 -DWITH_READLINE=1 -DWITH_VALGRIND=1 -DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8_general_ci -DMYSQL_DATADIR=/usr/local/mysql/data
# make; make install
# groupadd mysql
# useradd -M -o -r -d /usr/local/mysql -s /sbin/nologin -c "Mysql Server" -u 27 -g mysql mysql >/dev/null 2>&1 || :
# chown -R root:mysql /usr/local/mysql; chown -R mysql:mysql /usr/local/mysql/data
# cd /usr/local/mysql; ./scripts/mysql_install_db --user=mysql --datadir=/usr/local/mysql/data
@ 비밀번호 설정
# cp support-files/mysql.server /etc/init.d/mysqld
# cp support-files/my-huge.cnf /etc/my.cnf --> 메모리 1G 이상
# cp support-files/my-medium.cnf /etc/my.cnf
# vi /etc/init.d/mysqld ##### datadir 찾아서 datadir=/usr/local/mysql/data 라고 입력
# service mysqld start
# chkconfig --add mysqld
# chkconfig --level 35 mysqld on (런레벨 35일때 자동 실행 된다)
# chkconfig --list | grep mysqld
@ 리부팅시 서비스 실행하지 않으려면 - chkconfig mysqld off
# /usr/local/mysql/bin/mysqladmin -u root password
설치 작업이 끝났다면 익명접근권한을 삭제하자. ( mysql 콘솔에 그냥 접근을 못하게 해야 함.)
# /usr/local/mysql/bin/mysql -u root -p
# Enter password:
# mysql> USE mysql;
# mysql> delete from user where password = "";
# mysql> exit
# /usr/local/mysql/bin/mysqladmin -u root -p reload
# Enter password:


@ cronolog 설치(apache log 분할)
# cd /usr/local/src
# wget http://www.youtu.kr/mirror/cronolog-1.6.2.tar.gz
# tar xvf cronolog-1.6.2.tar.gz
# cd cronolog-1.6.2
# ./configure
# make;make install 

 

APACHE


Apache 설치

1. 라이브러리 설치(설치 되어 있음 안 깔아도 됨)
yum -y install gcc
yum -y install openssl-devel
yum -y install apr-devel
yum -y install apr-util-devel
yum -y install pcre-devel
yum -y install zlib-devel

홈페이지를 운영 중, 해당 도메인 접속 시에 갑자기 홈페이지가 나타나지 않고, 아파치 기본화면이 나타나면,
아래의 2번과 3번을 재수행하여, configure의 아파치 설치위치를 재정의해주어야 한다. 

2. 아파치 다운로드 & 컴파일 
# cd /usr/local/src 
# wget http://linux-files.com/httpd/httpd-2.4.1.tar.gz  (http://linux-files.com/httpd/ 에서 최신버전 검색하여 버전 수정 후에 수행)
# tar zxvf httpd-2.4.1.tar.gz (<--- 호환을 위해 2.4.1 버전 사용)
# cd httpd-2.4.1

./configure --prefix=/usr/local/apache --enable-mods-shared=most --enable-ssl --with-ssl=/usr/local/openssl --enable-modules=ssl --enable-rewrite --with-included-apr --with-included-apr-util --enable-deflate --enable-expires --enable-headers --enable-proxy --enable-mpms-shared=all./configure --prefix=/usr/local/apache --enable-mods-shared=most --enable-ssl --with-ssl=/usr/local/openssl --enable-modules=ssl --enable-rewrite --with-included-apr --with-included-apr-util --enable-deflate --enable-expires --enable-headers --enable-proxy --enable-mpms-shared=all 

# make && make install

 
3. 데몬등록
# /usr/local/apache/bin/apachectl -l
Compiled in modules:
  core.c
  mod_so.c
  http_core.c
  event.c
# cp /usr/local/apache/bin/apachectl /etc/init.d/httpd
@ chkconfig를 이용해서 자동실행 등록해야 하지만 이전에 실행 스크립트 파일에 아래 내용 추가가 선행되어야 한다.
# vi /etc/init.d/httpd
-httpd 파일의 맨 끝에 아래의 내용... 
-----------------------------------------------  

chkconfig: 2345 90 90
description: init file for Apache server daemon
processname: /usr/local/apache/bin/apachectl
config: /usr/local/apache/conf/httpd.conf
pidfile: /usr/local/apache/logs/httpd.pid 
-----------------------------------------------  
여기까지를 추가한다.

# chkconfig --add httpd
# chkconfig --list | grep httpd
 
4. apache 설정 변경
# vi /usr/local/apache/conf/httpd.conf
KeepAlive ON
주석을 해제하고 서버이름이나 IP주소를 설정합니다.
ServerName localshot:80
서버관리자 메일주소 설정
ServerAdmin webmaster@localhost
인터넷주소 rewrite 모드 사용을 위한 설정
AllowOverride None –> AllowOverride All
웹 페이지 접속시 기본적으로 읽어 들일 파일명 설정
DirectoryIndex index.html 를 찾아 DirectoryIndex index.html index.htm index.php index.php3 index.cgi index.jsp 로 수정
아래와 같이 추가 합니다.
AddType application/x-compress .Z
AddType application/x-gzip .gz .tgz
AddType application/x-httpd-php .htm .html .php .ph php3 .php4 .phtml .inc -->추가
AddType application/x-httpd-php-source .phps -->추가

주석제거
# AddHandler cgi-script .cgi
몇가지 주석 및 제거 - 필요에 따라 더 적용해도 무방함
Include conf/extra/httpd-mpm.conf <-- 주석제거
Include conf/extra/httpd-userdir.conf <-- 주석제거
Include conf/extra/httpd-vhosts.conf <-- 주석제거
Include conf/extra/httpd-default.conf <-- 주석제거
<Directory />
Options FollowSymLinks
AllowOverride All <-- 수정
Order deny,allow
#Deny from all <-- 주석처리
</Directory>
#vi /usr/local/apache/conf/extra/httpd-userdir.conf
Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec 를
Options MultiViews SymLinksIfOwnerMatch IncludesNoExec 로
Indexes 를 삭제 한다.
#vi /usr/local/apache/conf/extra/httpd-vhosts.conf
내용을 모두 삭제하고 구문만 적용후 저장 - 저장방법은 :wq 인 것은 아시죠...^^
NameVirtualHost *:80
<VirtualHost *:80>
DocumentRoot /usr/local/apache/htdocs/
ServerName *
</VirtualHost>

#NameVirtualHost *:80
<VirtualHost *:80>
    ServerAdmin webmaster@dummy-host2.example.com
    DocumentRoot /usr/local/apache/htdocs/
    ServerName www.도메인주소
    ErrorLog logs/도메인주소.error_log
    #CustomLog logs/dummy-host2.example.com-access_log common
</VirtualHost>

# /etc/init.d/httpd start 수행 시에 아래와 같은 오류가 발생하는 경우,
AH00526: Syntax error on line 10 of /usr/local/apache/conf/extra/httpd-userdir.conf:
Invalid command 'UserDir', perhaps misspelled or defined by a module not included in the server configuration
# vi /etc/httpd/conf/httpd.conf 로 들어가서
LoadModule userdir_module /etc/httpd/modules/mod_userdir.so 부분의 주석을 제거

# /etc/init.d/httpd start 수행 시에 아래와 같은 오류가 발생하는 경우,
AH00534: httpd: Configuration error: No MPM loaded.
# vi /etc/httpd/conf/httpd.conf 로 들어가서
LoadModule mpm_event_module modules/mod_mpm_event.so 부분의 주석을 제거
(특정 LoadModule에 대한 오류가 발생한 경우, 해당 부분의 주석을 제거하여 재실행)
 
# /etc/init.d/httpd start 를 실행했을 때,

httpd: Syntax error on line 144 of /usr/local/apache/conf/httpd.conf: Cannot load /usr/local/apache/modules/mod_mpm_event.so into server: /usr/local/apache/modules/mod_mpm_event.so: cannot open shared object file: No such file or directory
와 같은 오류가 발생하는 경우, 해당 라인으로 이동(:144)하여 주석처리 후 재실행 하되,
AH00557: httpd: apr_sockaddr_info_get() failed for 도메인명
AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1. Set the 'ServerName' directive globally to suppress this message
와 같은 오류가 추가로 발생하는 경우,
# cd /etc
# cp hosts hosts.old 를 수행하여 백업하고,
# vi hosts 를 수행하여,
127.0.0.1   localhost.localdomain localhost 도메인명
서버에할당된주소 도메인주소
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6
로 수정하고 저장한 후,
# /etc/init.d/httpd start 를 실행하면 정상 수행되어야 한다.


@ 접속이 안될경우 80포트 열어 주어야 한다.
# vi /etc/sysconfig/iptables
-A INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT =>추가
# /etc/init.d/iptables restart 또는 service iptables restart
# service iptables restart 를 재수행해준다.

@ 기타 모듈 설치 (아래 PHP 설치 시에 라이브러리로 사용될 모듈)
# cd /usr/local/src
# mkdir etc
# cd etc
# wget http://download.savannah.gnu.org/releases/freetype/freetype-2.4.8.tar.gz
# wget http://www.peregrinehw.com/downloads/gd/gd-2.0.33.tar.gz
# wget http://www.youtu.kr/mirror/jpegsrc.v6b.tar.gz
# wget http://sourceforge.net/projects/libpng/files/libpng15/1.5.12/libpng-1.5.12.tar.gz
# wget http://www.youtu.kr/mirror/imap-2004g.tar.bz2
# wget ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.30.tar.gz
# wget http://heanet.dl.sourceforge.net/mcrypt/libmcrypt-2.5.8.tar.gz
# wget http://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.14.tar.gz
# tar zxvf freetype-2.4.8.tar.gz; tar zxvf gd-2.0.33.tar.gz; tar zxvf jpegsrc.v6b.tar.gz; tar zxvf libpng-1.5.12.tar.gz; tar jxvf imap-2004g.tar.bz2; tar zxvf pcre-8.30.tar.gz; tar zxvf libmcrypt-2.5.8.tar.gz; tar zxvf libiconv-1.14.tar.gz
# cd /usr/local/src/etc/jpeg-6b; mkdir -p /usr/local/libjpeg/bin; mkdir -p /usr/local/libjpeg/man/man1; make clean;make -j4; make install; cp -f libjpeg.a /usr/local/lib; cp -f *.h /usr/include
# cd /usr/local/src/etc/libpng-1.5.12
# cp scripts/makefile.linux Makefile
# make clean;make -j4;make install
# cd /usr/local/src/etc/freetype-2.4.8
# make clean;./configure --prefix=/usr/local/freetype;make -j4;make install
# cd /usr/local/src/etc/gd-2.0.33
# make clean;./configure --prefix=/usr/local/gd;make -j4;make install
# cd /usr/local/src/etc/imap-2004g
# make clean;make slx SPECIALS="SSLDIR=/usr SSLINCLUDE=/usr/include SSLLIB=/usr/lib"
# cd /usr/local/src/etc/imap-2004g/c-client
# cp -f c-client.a /usr/lib; cp -f rfc822.h mail.h linkage.h /usr/include
# cd /usr/local/src/etc/pcre-8.30
# make clean;./configure --prefix=/usr/local;make -j4;make install
# cd /usr/local/src/etc/libmcrypt-2.5.8
# make clean;./configure --prefix=/usr/local;make -j4;make install
# cd /usr/local/src/etc/libiconv-1.14
# make clean;./configure --prefix=/usr/local;make -j4;make install
# ln -s /usr/local/lib/libiconv.so.2 /usr/lib/libiconv.so.2


PHP 설치
 
1.php 다운로드 & 라이브러리 컴파일
yum -y install zlib curl
yum -y install openssl openssl-devel
yum -y install libtermcap-devel ncurses-devel libc-client-devel bzip2-devel
yum -y install bison
yum -y install libpng

yum install net-snmp net-snmp-devel
yum -y install libjpeg-devel libpng-devel freetype-devel gd-devel libtermcap-devel ncurses-devel libxml2-devel libc-client-devel bzip2-devel
rpm -qa gcc* cpp* compat-gcc* flex* openssl*
rpm -qa libjpeg* libpng* freetype* gd-*
 
cd /usr/local/src
wget http://graphics.cs.uni-sb.de/NMM/Download/external/jpegsrc.v6b.tar.gz
tar xvfz jpegsrc.v6b.tar.gz
cd jpeg-6b/
mkdir -p /usr/local/man/man1
./configure --enable-shared --enable-static
make && make install
 
cd /usr/local/src
wet http://cdnetworks-kr-1.dl.sourceforge.net/project/mcrypt/Libmcrypt/2.5.8/libmcrypt-2.5.8.tar.gz
tar xvfz libmcrypt-2.5.8.tar.gz
cd libmcrypt-2.5.8
./configure
make && make install

# cd /usr/local/src
# wget http://kr2.php.net/get/php-5.3.10.tar.gz/from/kr.php.net/mirror
# tar zxvf php-5.3.10.tar.gz
# cd php-5.3.10
# make clean
# ./configure --prefix=/usr/local/php --with-mysql=/usr/local/mysql --with-apxs2=/usr/local/apache/bin/apxs --with-config-file-path=/usr/local/lib --with-gd --with-freetype-dir=/usr/local/freetype --with-zlib --enable-sockets --enable-gd-native-ttf --with-png-dir=/usr/local/lib --with-jpeg-dir=/usr/local/lib --enable-sigchild --enable-magic-quotes --with-gettext --enable-mbstring --enable-inline-optimization --enable-bcmath --enable-shmop --enable-calendar --enable-ftp --with-gdbm --with-iconv=/usr/local --enable-mbregex --with-imap --with-imap-ssl --with-openssl --with-curl --enable-soap --disable-debug --with-mcrypt=/usr/local/libmcrypt --with-kerberos --with-mysqli=/usr/local/mysql/bin/mysql_config --with-pdo-mysql=/usr/local/mysql --enable-mod-charset --enable-safe-mode --enable-sysvmsg --enable-sysvsem --enable-sysvshm --with-snmp --with-zlib-dir --with-ttf --enable-exif --with-xpm-dir --with-libxml-dir --with-pcre-dir --with-ncurses --enable-sqlite-utf8 --with-regex=php --with-bz2
...
creating main/internal_functions_cli.c
+--------------------------------------------------------------------+
| License:                                                           |
| This software is subject to the PHP License, available in this     |
| distribution in the file LICENSE.  By continuing this installation |
| process, you are bound by the terms of this license agreement.     |
| If you do not agree with the terms of this license, you must abort |
| the installation process at this point.                            |
+--------------------------------------------------------------------+
Thank you for using PHP.
Notice: Following unknown configure options were used:
--with-ttf
--with-ncurses
Check './configure --help' for available options
[root@ns php-5.3.10]#
위와 같이 표시되어야 정상수행된 것입니다. 확인하시기 바랍니다. 
# make -j4; make install
# cp php.ini-production /usr/local/lib/php.ini --> 5.3.0 이후 버전 
도메인주소 부분에는 xxx.com과 같이 입력하면 된다.

# vi /root/.bash_profile
PATH=$PATH:$HOME/bin 를
PATH=$PATH:$HOME/bin:/usr/local/mysql/bin:/usr/local/apache/bin:/usr/local/php/bin 로 수정

@ php.ini 설정
# vi /usr/local/lib/php.ini
post_max_size = 100M (Default: 8M)
file_uploads = On
upload_max_filesize = 100M (Default: 2M)
allow_url_fopen = Off (Default: On)
allow_url_include = Off
short_open_tag = On (Default: Off)
disable_functions = exec,passthru,proc_open,popen,curl_exec,curl_multi_exec,parse_ini_file,show_source
(Default: disable_functions =)

# ntsysv <--- 서비스 상태확인

# reboot <-- 설정을 마치면 한번쯤 리부팅 해 주세요...^^
 
 
서비스 시작
# service mysqld start
# service httpd start


새로운 도메인을 추가하는 경우, 아래의 처리들을 다시한번 확인해본다.
--------------------------------------------------------------------------------
[root@ns user]# vi /etc/resolv.conf
[root@ns user]# vi /etc/hosts <--- 신규 추가 시에 추가 필요
[root@ns user]# vi /etc/named.conf <--- 신규 추가 시에 추가 필요
[root@ns user]# vi /var/named/chroot/var/named/도메인주소.zone <--- 신규 추가 시에 생성 필요
[root@ns user]# ln -s /var/named/chroot/var/named/도메인주소.zone /var/named/도메인주소.zone
[root@ns user]# vi /usr/local/apache/conf/httpd.conf <--- 신규 추가 시에 추가 필요

[root@ns user]# /etc/rc.d/init.d/named reload
[root@ns user]# service named restart  (# chkconfig --level 35 named on (부팅 시에 런레벨 35일때 자동 실행))
[root@ns user]# service httpd restart

이제, 도메인을 등록한 사이트의 네임 호스트 관리에서 네임 호스트 및 IP주소를 추가하고,
네임서버를 네임 호스트 관리에서 입력한 네임 호스트로 입력하여 변경을 수행(보통, 등록한 사이트의 네임서버로 초기설정된 상태)

등록을 완료한 후에 ISP의 네임서버에 등록 및 변경이 수행되기까지는 약간의 시간이 필요하다.
잠시 후에 아래의 명령으로 정상 등록 및 변경여부를 확인한다.

[root@ns user]# nslookup 도메인주소
[root@ns user]# dig 도메인주소

시스템 > 관리 > 사용자 및 그룹에서 사용자를 추가 후에 권한을 변경한다. 

[root@ns user]# chmod 711 /home/사용자
[root@ns user]# chmod 755 /home/사용자/www
[root@ns user]# chgrp -R 사용자 /home/사용자
[root@ns user]# chown -R 사용자 /home/사용자


 
 
번외 Apache 계정별 사용 설정
vi /usr/local/apache/conf/httpd.conf
 
Include conf/extra/httpd-userdir.conf
LoadModule userdir_module modules/mod_userdir.so
LoadModule authn_core_module modules/mod_authn_core.so
LoadModule authz_host_module modules/mod_authz_host.so
주석 제거
 
/home/계정디렉토리 권한 711
/home/계정/public_html 권한 755 필요
 

 
참고 URL 
http://vogel.tistory.com/143


openSSL 설치를 위해서는 5.2 버젼에서는 5.2.11 , 5.2.12 버젼을 설치한다.
Zend Optimizer 설치를 위해서는 5.2 version을 설치 해야 한다.
Posted by iWithJoy