Linux/CentOS2013. 9. 15. 01:13

Web Server로 설치 후에

 

KDE를 설치하는 과정을 설명하도록 하겠다.

CentOS 버전은 6.4 이며 진행과정은 root권한을 획득한 후 진행한다.


우선 다음 명령으로 [X Window System] 그룹을 인스톨한다.

$ yum groupinstall "X Window System"


그러면 백 개 넘는 패키지가 설치될 것이라고 알려주고 사용자의 대답을 기다린다. "y"를 입력하여 진행한다.

Total download size: 47 M
Installed size: 139 M
Is this ok [y/N]: y


그리고 [KDE Desktop]을 설치한다.

$ yum groupinstall "KDE Desktop"


마찬가지로 백 몇십 개가 되는 패키지를 설치할 것이라고 메세지를 보여주고 사용자의 대답을 기다린다. 역시 "y"를 입력하여 진행한다.


이제 KDE 데스크탑을 실행해준다.

$ startx


참고사이트 : http://selene0301.tistory.com/266

 

 

GNOME를 설치하는 과정을 설명하도록 하겠다.

CentOS 버전은 6.4 이며 진행과정은 root권한을 획득한 후 진행한다.


다음과 같이 [Desktop]을 설치한다.

$  yum groupinstall "Desktop"

 

부팅시 자동으로 GUI 화면으로 부팅되도록 다음 명령어로 편집기를 연다.

$ vi /etc/inittab


다음과 같이 숫자를 3에서 5로 바꾸어주고 재부팅을 한다.

id:5:initdefault:


재부팅을 하면 GUI화면으로 로그인할 수 있다.


참고사이트 : http://selene0301.tistory.com/267

 

 

한글 키보드 설정

$ yum install ibus ibus-hangul ibus-anthy

System > Preferences > Input Method > 한글 선택 
Ctrl + Alt + Backspace
로그인 후에 System tray 에서 설정(한영 전환: Ctrl+Space(기본))


네트워크 설정
$ vi /etc/sysconfig/network-scripts/ifcfg-eth0
--------------------------------------------------------------------------------
:

ONBOOT=yes
NM_CONTROLLED=yes
BOOTPROTO=none
IPADDR=121.***.225.***
NETMASK=255.255.255.0
GATEWAY=121.***.225.***
DNS1=168.126.63.1
DNS2=168.126.63.2
PREFIX=24
DEFROUTE=yes
:
--------------------------------------------------------------------------------
$ service network stop
$ service network start
$ service network restart

만약, 호스트명(hostname)을 확인하려면,
# hostname
변경하려면,
# vi /etc/sysconfig/network
를 수행하여,
HOSTNAME=myhost
처럼 원하는 호스트명으로 수정하고, 저장한 뒤에 리부팅(# init 6)을 수행한다.
결과는 아래와 같다.
[root@myhost ~]# _


기본 프로그램 설치
adobe 프로그램 설치 요구되면, 해당 rpm 다운로드 후에
$ rpm -Uvh adobe-release-i386-1.0-1.noarch.rpm
Midnight Commander 설치
$ yum install mc
Krusader 설치
$ rpm -Uvh krusader-2.3.0-0.3.beta1.el6.R.x86_64.rpm
Teamviewer 설치
$ rpm -Uvh teamviewer_linux.rpm
설치 시에 전송 중지에 의한 오류가 발생하면, 아래와 같이 전송완료처리 후에 재설치
$ yum-complete-transaction


방화벽 설치
시스템 > 소프트웨어 추가/제거 > firewall
√ IPv6 support for iptables
√ Tools for managing Linux kernel packet filtering capabilities
√ system-config-firewall base components and command line tool
√ A text interface for basic firewall setup
√ A graphical interface for basic firewall setup
[적용] 수행
시스템 > 관리 > 방화벽
- 그 외의 포트
  . 5900, tcp, vnc-server
  . 5901, tcp
  . 5902, tcp
- 포트포워딩
  . 소스: eth0, tcp, 5900
  . 수신지: 로컬포트포워딩, 5901


VNC 설치
기존 VNC 중복설치에 의한 충돌의 경우, 아래와 같이 먼저 삭제
$ cd /usr/bin
$ ls -al vnc*
$ rm vnc*
$ yum -y remove vnc
$ yum -y remove vnc-server
VNC 재설치
$ yum -y install vnc
$ yum -y install vnc-server

필요에 따라 화면크기, 색상수 등을 설정
$ vi /usr/bin/vncserver

접속계정 설정
$ vi /etc/sysconfig/vncservers
--------------------------------------------------------------------------------
:
VNCSERVERS="1:username 2:root"
VNCSERVERARGS[1]="-geometry 1024x768"
VNCSERVERARGS[2]="-geometry 1024x768"
--------------------------------------------------------------------------------
접속 암호 설정(계정별 로그인하여 각각 설정 필요)
$ vncpasswd
만약, 계정 1개만 vnc서비스로 수행을 원하고, service vncserver start 수행 시에 오류 발생의 경우,
service vncserver stop 수행 후에 /etc/sysconfig/vncservers 를 수정하고,
root(su) 계정에서 다시 service vncserver start 수행 필요.
이때, /etc/sysconfig/vncservers 에
VNCSERVERS="1:username"
VNCSERVERARGS[1]="-geometry 1024x768"
 이면, /usr/bin/vncserver 설정의
$vncPort = 5900 + $displayNumber; 내용과 같이, 포트번호 5900+1=5901 이므로
해당 포트 5901을 방화벽에서 오픈처리 필요


서비스 시작 시에 수행될 설정내용을 확인하려면,
$ vi /root/.vnc/xstartup

필요시에 방화벽 환경설정 확인하여 변경 후, 재시작
$ netstat -antp
$ vi /etc/sysconfig/iptables
--------------------------------------------------------------------------------
# Firewall configuration written by system-config-firewall
# Manual customization of this file is not recommended.
*mangle
:PREROUTING ACCEPT [0:0]
:INPUT ACCEPT [0:0]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
:POSTROUTING ACCEPT [0:0]
-A PREROUTING -i eth0 -p tcp --dport 5900 -j MARK --set-mark 0x64
COMMIT
*nat
:PREROUTING ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
:POSTROUTING ACCEPT [0:0]
-A PREROUTING -i eth0 -p tcp --dport 5900 -m mark --mark 0x64 -j DNAT --to-destination :5901
COMMIT
*filter
:INPUT ACCEPT [0:0]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
-A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
-A INPUT -p icmp -j ACCEPT
-A INPUT -i lo -j ACCEPT
-A INPUT -i eth0 -m state --state NEW -m tcp -p tcp --dport 5901 -m mark --mark 0x64 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 53 -j ACCEPT
-A INPUT -m state --state NEW -m udp -p udp --dport 53 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 443 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 5900 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 5901 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 5902 -j ACCEPT
-A INPUT -j REJECT --reject-with icmp-host-prohibited
-A FORWARD -j REJECT --reject-with icmp-host-prohibited
COMMIT
--------------------------------------------------------------------------------
$ /etc/rc.d/init.d/iptables restart
방화벽 포트 확인 후에 vncserver 시작
$ iptables -nvL
$ netstat -tpln|grep "5900"
$ service vncserver stop
$ service vncserver start
또는
$ service vncserver restart

시스템 시작 시에 vncserver 구동을 위해 등록
$ chkconfig vncserver on


openSSL 설치
$ yum -y install openssl* (기설치된 상태)
yum install mod_ssl openssl (기설치된 상태)

self-signed certificate 생성

OpenSSL을 이용해 self-signed certificate를 생성한다. 위에서 쓴 글이지만 서비스를 할 예정이라면 verisign과 같은 업체에서 인증서를 사서 써야겠지만 개인 사이트라면 self-signed certificate 라면 충분하다고 한다. 다음과 같이 입력하거나 복사&붙여넣는다.


인증서 생성에 대한 보다 자세한 설명은 아래 링크를 참조한다.

http://dimdim.tistory.com/50


private key 생성

# openssl genrsa -out ca.key 1024


CSR(Certificate Signing Request) 생성

# openssl req -new -key ca.key -out ca.csr

:
[예제] : [자신의정보입력]

Country Name (2 letter code) [XX]:KR
State or Province Name (full name) []:Seoul
Locality Name (eg, city) [Default City]:Seocho-gu
Organization Name (eg, company) [Default Company Ltd]:Company Incorporate
Organizational Unit Name (eg, section) []:Technical Support Dept.
Common Name (eg, your name or your server's hostname) []:company.com
Email Address []:company@gmail.com

Please enter the following 'extra' attributes
to be sent with your certificate request
A challenge password []:
An optional company name []:
:

Self signed key 생성

# openssl x509 -req -days 365 -in ca.csr -signkey ca.key -out ca.crt


다음 위치에 files을 복사한다.

# cp ca.crt /etc/pki/tls/certs

# cp ca.key /etc/pki/tls/private/ca.key

# cp ca.csr /etc/pki/tls/private/ca.csr


SELinux 에 의해 Certificate files이 삭제될 수 있다.
이로 인해 삭제된 구문을 원복시키기 위해 다음 명령어를 쓴다.
삭제된 경우, 이 명령어를 통해 복원 된다. 

# restorecon -RvF /etc/pki

/etc/pki/* 하위의 모든 폴더나 파일에서 삭제된 구문을 복원한다.


# vi /etc/httpd/conf.d/ssl.conf

아파치의 ssl 설정을 변경하기 위해 편집기로 열어 아래와 같이 수정한다.


SSLCertificateFile /etc/pki/tls/certs/ca.crt

SSLCertificateKeyFile /etc/pki/tls/private/ca.key


# service httpd restart


3. SSL VirtualHost 추가

SSL은 443 포트를 사용하기 때문에 이를 위한 Virtualhost를 추가한다.


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

httpd 설정 파일을 편집기로 열어 마지막 위치에 아래 내용을 입력한다. httpd.conf 파일 내에 예제로 적혀있는 내용이 있으니 복사&붙여넣기 하면 된다.


# SSL Virtual host add

NameVirtualHost *:443


# SSL Virtual host add
<VirtualHost *:443>
    SSLEngine on
    SSLCertificateFile /etc/pki/tls/certs/ca.crt
    SSLCertificateKeyFile /etc/pki/tls/private/ca.key
    ServerAdmin starkapin@tistory.com
    DocumentRoot /var/www/html
    ServerName ssl.starkapin.com
    ErrorLog logs/ssl_starkapin_com_error_log
    CustomLog logs/ssl_starkapin_com_error_log common
</VirtualHost>


# service httpd restart


4. 방화벽 설정

443 포트를 방화벽으로 허용시켜준다.


# vi /etc/sysconfig/iptables

편집기로 불러와 아래 내용을 추가한다.


-A INPUT -p tcp -m state --state NEW -m tcp --dport 443 -j ACCEPT


# service iptables restart


이제 웹으로 접속해서 확인 하면 인증서 경고가 발생하며 접속됨을 확인 할 수 있다.

https://127.0.0.1/



APM 설치
최신 php 버전이 보안관련하여, safe_mode 옵션항목 등이 삭제된 관계로
kcp에서 제공한 실행파일을 php에서 사용이 불가하여, php 5.3.10 설치수행이 필요

@ 설치된 버전 확인

# yum search php

# yum list installed | grep php

# php -v

@ 필수 설치 패키지 확인
# yum list libtool
# yum list libtool-ltdl
# yum list libtool-ltdl-devel

 

@권한 확인: 755이상으로 설정

# ls –al /app
# ls -al /app/ora11g/11g/network/admin/tnsnames.ora

 

@rpm으로 설치된 httpd를 확인 및 삭제

# rpm -qa | grep http
httpd-2.2.15-29.el6.centos.x86_64
httpd-tools-2.2.15-29.el6.centos.x86_64
jakarta-commons-httpclient-3.1-0.7.el6_3.x86_64
httpd-manual-2.2.15-29.el6.centos.noarch
# rpm -e --nodeps httpd-2.2.15-29.el6.centos.x86_64
# rpm -e --nodeps httpd-tools-2.2.15-29.el6.centos.x86_64


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

mysql-5.1.69-1.el6_4.x86_64
php-5.3.3-23.el6_4.x86_64
# yum remove -y httpd php mysql

:

Dependency Removed:
  akonadi.x86_64 0:1.2.1-2.el6                                                 
  kdepim.x86_64 6:4.3.4-6.el6                                                  
  kdepim-libs.x86_64 6:4.3.4-6.el6                                             
  kdepim-runtime.x86_64 0:4.3.4-5.el6                                          
  kdepim-runtime-libs.x86_64 0:4.3.4-5.el6                                     
  kdepimlibs-akonadi.x86_64 0:4.3.4-4.el6                                      
  mysql-server.x86_64 0:5.1.69-1.el6_4                                         

Complete!
# rm -fR php

# rm /usr/local/lib/php.ini

 

 

@ 서버운영에 필요한 소스 및 라이브러리 추가
설치된 것 외에 210개가 추가로 설치된다.
# 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
http://www.cmake.org 에서 최신 버전을 확인하여 해당 버전으로 설치한다.
# wget http://www.cmake.org/files/v2.8/cmake-2.8.11.2.tar.gz (최신버전)
# tar zxvf cmake-2.8.11.2.tar.gz (최신버전)
# cd cmake-2.8.11.2 (최신버전)
# ./bootstrap
# make; make install

@ mysql 최신버전 설치
# cd /usr/local/src
http://www.mysql.com/downloads/mysql/ 에서 Source Code 중,
Generic Linux (Architecture Independent), Compressed TAR Archive 최신버전을 Download 수행한다.
# wget http://www.mysql.com/get/Downloads/MySQL-5.6/mysql-5.6.13.tar.gz/from/http://mirror.khlug.org/mysql/ (최신버전)

# tar zxvf mysql-5.6.13.tar.gz (최신버전) 

# cd mysql-5.6.13  (최신버전) 
# 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

실행 중에 아래와 같은 오류가 발생하면,
:
CMake Error at configure.cmake:1071 (MESSAGE):
  Unable to find Valgrind header files
  valgrind/memcheck.h;valgrind/valgrind.h.  Make sure you have them in your
  include path.
Call Stack (most recent call first):
  CMakeLists.txt:314 (INCLUDE)

-- Configuring incomplete, errors occurred!
일부 패키지가 미설치된 상태이므로 다음과 같이 설치한다.
# yum install valgrind
yum install valgrind-devel
기존 소스를 모두 지우고, tar 실행부분부터 다시 수행한다.
# cd ..
# rm -fR mysql-5.6.13

wget 명령 다음, tar 부분부터 다시 수행...


# 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
mysql-5.6.13 에는 support-files 아래에 실행에 필요한 cnf 파일이 미존재하여
첨부된 기존 버전의 my.cnf를 /etc/my.cnf로 저장한다. 

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 설치

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. 아파치 다운로드 & 컴파일 
# cd /usr/local/src 
# wget http://linux-files.com/httpd/httpd-2.4.6.tar.gz  (http://linux-files.com/httpd/ 에서 최신버전 검색하여 버전 수정 후에 수행)
# tar zxvf httpd-2.4.6.tar.gz
# cd httpd-2.4.6
 

./configure 옵션 설명

--prefix=/usr/local/apache : 아파치의디렉토리설정 

--enable-so : DSO 방식으로 설치 

--enable-ssl : SSL/TLS지원 (mod_ssl) 

--with-mpm=worker : 아파치프로세스가 사용할 멀티스레드방식으로 지정 

Worker, beos, prefork, mpm_os2, prechild, leader,threadpool 등으로 설정가능 

Worker는 멀티프로세싱 모듈, 멀티스레드, 멀티프로세스 지원 

--disable-access : 호스트기반의 접근제어 

--disable-auth : 사용자기반 접근제어 

--enable-auth-anon : 익명 사용자 액세스를 위한 옵션 

--enable-auth-dbm : 암호인증방식으로 DBM 데이터베이스의 인증방식을 지원 

--enable-auth-digest :암호인증방식으로 RFC2617에 따른 digest를 지원 

--disable-status : 아파치프로세스/스레드 모니터링을 지원하지 않도록 하는 옵션 

--disable-autoindex: 디렉토리리스팅을 지원 

--enable-speling : 보편적으로 알려진 URL가운데 URL스펠링을 고쳐주는 스펠링보정기능을 위한 옵션 

--with-port-PORT : 아파치에서 사용할 포트번호를 지정 

--enable-disk-cache : 디스크 캐싱 기능을 위한 모듈을 넣을 수 있다. 

--enable-auth-ldap : LDAP기반 인증을 지원하기 위한 옵션 

./configure 수행 시에 아래와 같은 오류가 발생하는 경우, 해당 httpd 버전에 필요한 lib가 없기 때문이다.
checking for chosen layout... Apache
checking for working mkdir -p... yes
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking target system type... x86_64-unknown-linux-gnu
configure: 
configure: Configuring Apache Portable Runtime library...
configure: 
configure: error: Bundled APR requested but not found at ./srclib/. Download and unpack the corresponding apr and apr-util packages to ./srclib/.

현재 설치된 버전을 확인
# yum list |grep apr
apr.x86_64                             1.3.9-5.el6_2                   @anaconda-CentOS-201303020151.x86_64/6.4
apr-devel.x86_64                       1.3.9-5.el6_2                   @base    
apr-util.x86_64                        1.3.9-3.el6_0.1                 @anaconda-CentOS-201303020151.x86_64/6.4
apr-util-devel.x86_64                  1.3.9-3.el6_0.1                 @base    
apr-util-ldap.x86_64                   1.3.9-3.el6_0.1                 @anaconda-CentOS-201303020151.x86_64/6.4
apr.i686                               1.3.9-5.el6_2                   base     
apr-devel.i686                         1.3.9-5.el6_2                   base     
apr-util.i686                          1.3.9-3.el6_0.1                 base     
apr-util-devel.i686                    1.3.9-3.el6_0.1                 base     
apr-util-mysql.x86_64                  1.3.9-3.el6_0.1                 base     
apr-util-odbc.x86_64                   1.3.9-3.el6_0.1                 base     
apr-util-pgsql.x86_64                  1.3.9-3.el6_0.1                 base     
apr-util-sqlite.x86_64                 1.3.9-3.el6_0.1                 base     
haproxy.x86_64                         1.4.22-5.el6_4                  updates  

해당 lib를 다운로드하여 해당 디렉토리에 압축해제를 수행하고 다시 configure를 수행한다.
1. For Apache 2.4.x - you need apr and apr-util 1.4.x or later
(means most probably you do not have them yet in you OS repos
and need manually download them form http://apr.apache.org/download.cgi)
2. Extract them to ./srclib/apr 
and ./srclib/apr-util directory respectively.
3. Download -deps files for your Apache build from
http://httpd.apache.org/download.cgi#apache24
(I used this one - http://www.sai.msu.su/apache//httpd/httpd-2.4.6-deps.tar.gz)
4. Extract -deps files to your ./srclib/apr directory
5. Use --with-included-apr switch with ./configure script

# ./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: 345 85 15

345는 부팅시 런레벨 3,4,5 에서 구동됨을 의미.

85는 데몬 실행 우선순위, 15는 데몬 종료 우선순위를 의미.

# chkconfig --add httpd

# chkconfig --list | grep httpd 
  
4. apache 설정 변경

# vi /usr/local/apache/conf/httpd.conf
주석을 해제하고 서버이름이나 IP주소를 설정합니다.

ServerName xxx.xxx.xxx.xxx (IP주소)
KeepAlive ON
서버관리자 메일주소 설정
ServerAdmin webmaster@localhost
인터넷주소 rewrite 모드 사용을 위한 설정
AllowOverride None  AllowOverride All

 

루트 디렉토리 설정에 대해 알맞게 수정

#DocumentRoot "/usr/local/apache/htdocs"

DocumentRoot "/home

#<Directory "/usr/local/apache/htdocs">

<Directory "/home">

웹 페이지 접속시 기본적으로 읽어 들일 파일명 설정 

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 None

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 /usr/local/apache/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 /usr/local/apache/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.18/libpng-1.5.18.tar.gz
# wget
http://www.youtu.kr/mirror/imap-2004g.tar.bz2
# 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
# wget ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.30.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.18.tar.gz; tar jxvf imap-2004g.tar.bz2; tar zxvf libmcrypt-2.5.8.tar.gz; tar zxvf libiconv-1.14.tar.gz; tar zxvf pcre-8.30.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.18
# 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/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
# cd /usr/local/src/etc/pcre-8.30 
# make clean;./configure --prefix=/usr/local;make -j4;make install 

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
wget http://www.ijg.org/files/jpegsrc.v6b.tar.gz 
tar xvfz jpegsrc.v6b.tar.gz
cd jpeg-6b/
cp /usr/share/libtool/config/config.guess ./
cp /usr/share/libtool/config/config.sub ./  
mkdir /usr/local/jpeg  

mkdir /usr/local/jpeg/include  

mkdir /usr/local/jpeg/lib  

mkdir /usr/local/jpeg/bin  

mkdir /usr/local/jpeg/man  

mkdir -p /usr/local/man/man1
mkdir /usr/local/jpeg/man/man1
./configure --enable-shared --enable-static

./configure --prefix=/usr/local/jpeg --enable-shared --enable-static  

make && make install

make libdir=/usr/lib64  

make install  

에러 발생 원인 및 해결법

 config.guess와 config.sub 를 복사하지 않는 다면 configure 시에 아래와 같은 메세지가 나온다.

checking host system type... Invalid configuration `x86_64-unknown-linux-gnu': machine `x86_64-unknown' not recognized

  
 미리 mkdir 명령어로 디렉토리를 만들지 않는다면 아래와 같은 메세지가 나온다.

                /usr/bin/install -c -m 644 jconfig.h /usr/local/jpeg/include/jconfig.h
                /usr/bin/install: cannot create regular file `/usr/local/jpeg/include/jconfig.h': No such file or directory
                make: *** [install-headers] Error 1

 man 과 man1 디렉토리를 만들지 않는다면 아래와 같은 메세지가 나온다.

                /usr/bin/install -c -m 644 ./cjpeg.1 /usr/local/jpeg/man/man1/cjpeg.1
                /usr/bin/install: cannot create regular file `/usr/local/jpeg/man/man1/cjpeg.1': No such file or directory

 64bit arch를 사용한다면 make할때 libdir=/usr/lib64 옵션을 주어야 한다.
 

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
# wget http://museum.php.net/php5/php-5.3.10.tar.gz 
# 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 --enable-mod-charset --enable-safe-mode --enable-sysvmsg --enable-sysvsem --enable-sysvshm --with-snmp --with-zlib-dir --enable-exif --with-xpm-dir --with-libxml-dir --with-pcre-dir --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.
[root@ns php-5.3.10]# 

위와 같이 표시되어야 정상수행된 것입니다. 확인하시기 바랍니다. 

# make -j4; make install 

# cp php.ini-production /usr/local/lib/php.ini --> 5.3.0 이후 버전 


------------------------------------------------------------------------------------------
컴파일 오류시 대처
컴파일 오류는 해당 라이브러리 미설치 또는 configure 옵션설정 오류가 대부분입니다.
반드시, configure의 옵션설정부분의 라이브러리 설치를 확인하고, 옵션 오류가 없는 지 먼저 확인해야 합니다.

1. configure: error: xml2-config not found. Please check your libxml2 installation.
# yum install libxml2-devel

 

2. configure: error: Please reinstall the BZip2 distribution
해결책 :
[root@localhost local]# wget ftp://sources.redhat.com/pub/bzip2/v102/bzip2-1.0.2.tar.gz
Bzip2팩키지는 configure script가 없습니다. option을 한줄로 써서 컴파일 하고 설치합니다.
# cd bzip2-1.0.2
# make PREFIX=/tools install
# make clean
# cd ../php-5.2.11

 

3. configure: error: libXpm.(a|so) not found
# yum install gtk+ gtk+-devel

# yum install libXpm-devel

(# yum install xorg-x11-devel)

# sudo ln -s /usr/lib/x86_64-linux-gnu/libXpm.a /usr/lib/libXpm.a

# sudo ln -s /usr/lib/x86_64-linux-gnu/libXpm.so /usr/lib/libXpm.so

# sudo ln -s /usr/lib64/libXpm.so /usr/lib/libXpm.so

configure의 --with-libdir=/usr/lib64 를 --with-libdir=lib64 로 수정하고, configure 재수행!

 

4. configure: error: mcrypt.h not found. Please reinstall libmcrypt.  
# cd ..
# wget http://ftp.linux.co.kr/pub/etc/libmcrypt-2.5.7.tar.gz
# tar zxvfp libmcrypt-2.5.7.tar.gz
# cd libmcrypt-2.5.7
# ./configure && make && make install
# cd ../php-5.2.11

 

5. /usr/bin/ld: cannot find -lltdl
collect2: ld returned 1 exit status
make: *** [libphp5.la] Error 1 
# cd ..
# wget http://ftp.gnu.org/gnu/libtool/libtool-2.2.6a.tar.gz
# cd libtool-2.2.6
# ./configure
# make
# make install
# cd ../php-5.2.11

 

6. overflow2
~/php-5.3.4/ext/gd/gd.c (php를 받아서 압축을 푼 경로)


/*
        if (overflow2(font->nchars, font->h)) {
                php_error_docref(NULL TSRMLS_CC, E_WARNING, "Error reading font, invalid font header");
                efree(font);
                php_stream_close(stream);
                RETURN_FALSE;
        }
        if (overflow2(font->nchars * font->h, font->w )) {
                php_error_docref(NULL TSRMLS_CC, E_WARNING, "Error reading font, invalid font header");
                efree(font);
                php_stream_close(stream);
                RETURN_FALSE;
        }
*/ 해당 부분을 주석처리

[출처] [PHP] 컴파일시 나오는 에러대처|작성자 참좋은날

7. configure: error: Please reinstall the iconv library.
--with-iconv=/usr/local 를 --with-iconv 로 대체

8. checking for specified location of the MySQL UNIX socket... no
configure: error: Cannot find libmysqlclient_r under /usr/local/mysql.
Note that the MySQL client library is not bundled anymore!

When PHP is configured using --with-mysql=/usr/local/mysql and --with-libdir=lib64, it should search for /usr/local/mysql/lib64, since there is no such directory there encountered an error in PHP compile.

Since MYSQL is compiled from source, there will not be a 'lib64', the following steps will solve this problem.

[root@vps ~]# cd /usr/local/mysql  #Change directory to mysql's home directory
[root@vps mysql]# ln -s lib lib64    #Create a link for lib to lib64
를 수행하고, configure 재수행!
------------------------------------------------------------------------------------------

# 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


ZendGuard 설치

 

* ZendOptimizer는 PHP 5.2까지만 지원됨으로 PHP5.3을 설치 하는 경우 ZendGuard를 설치한다.

 

step 1) ZendGuard 소스를 /usr/local/에 다운 받는다.
wget http://downloads.zend.com/guard/5.5.0/ZendGuardLoader-php-5.3-linux-glibc23-i386.tar.gz

# uname -a

Linux mgribbon.net 2.6.32-358.18.1.el6.x86_64 #1 SMP Wed Aug 28 17:19:38 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux

# cat /etc/issue

CentOS release 6.4 (Final)

Kernel \r on an \m

위와 같이 64-bit가 설치되었음을 확인한다.

wget http://downloads.zend.com/guard/5.5.0/ZendGuardLoader-php-5.3-linux-glibc23-x86_64.tar.gz

 
step 2) 소스파일의 압축을 푼다

# tar zxvf ZendGuardLoader-php-5.3-linux-glibc23-x86_64.tar.gz

 

step 3) Zend 모듈을 php 모듈에 복사한다.

cp ZendGuardLoader-php-5.3-linux-glibc23-x86_64/php-5.3.x/ZendGuardLoader.so /usr/lib64/php/modules

 

step 4)  /usr/local/lib/php.ini 파일에 Zend 설정을 추가한다.

vi /usr/local/lib/php.ini

..............
[Zend]
zend_extension=/usr/lib64/php/modules/ZendGuardLoader.so


설치 후에는 웹서버를 리스타트 수행한다.

# /etc/init.d/httpd restart 



 php pdo-mysql 확장 모듈 설치

 

1.pdo_mysql download 

wget http://pecl.php.net/get/PDO_MYSQL-1.0.2.tgz

 

2.설치
적당한 위치에 다운로드 받은 파일을 압축해제 후 압축해제한 디렉토리로 이동 
# tar -xzvf PDO_MYSQL-1.0.2.tgz
# cd
PDO_MYSQL-1.0.2

# /usr/local/php/bin/phpize

# ./configure --with-php-config=/usr/local/php/bin/php-config --with-pdo-mysql=/usr/local/mysql
# make

# make install 

Installing shared extensions:     /usr/local/php/lib/php/extensions/no-debug-zts-20090626/

 

3.적용

php.ini 파일은 대부분 /etc 또는 apache/conf 디렉토리에 있음.

php.ini 파일에 추가
# vi /usr/local/lib/php.ini

extension=/usr/local/php/lib/php/extensions/no-debug-zts-20090626/pdo_mysql.so

 

추가 후 apache restart 하면 적용완료 됨!! 

# service httpd restart  


'Linux > CentOS' 카테고리의 다른 글

PHPIZE를 이용한 openSSL PHP 확장 모듈 설치  (0) 2013.09.16
집 컴퓨터를 웹서버로 만들기  (0) 2013.09.16
리눅스 yum 명령어  (0) 2012.10.10
BackupPC for CentOS  (0) 2012.10.09
아파치 모듈 mod_rewrite 설정  (0) 2012.09.13
Posted by iWithJoy