관리자 글쓰기

**APM 설치**

환경 CentOs 6.x


#yum -y install openssl openssl-devel mhash mhash-devel libtool libtool-ltdl libtool-ltdl-devel imap-devel imap zlib-devel zlib freetype-devel freetype libpng-devel libpng libjpeg-devel libjpeg libtiff-devel libtiff gd-devel gd pcre-devel pcre libxml-devel libxml libxml2-devel libxml2 gdbm-devel gdbm ncurses-devel ncurses curl-devel curl expat-devel expat bzip2-devel bzip2-libs bzip2 libc libc-devel libc-client-devel gcc*


;;필수구성요소 설치하고 진행한다


**apache 설치**


#cd /usr/local/src

# wget http://archive.apache.org/dist/apr/apr-1.4.2.tar.gz

# tar -xvzf apr-1.4.2.tar.gz

# cd apr-1.4.2.tar.gz

# ./configure

# make

# make install

# cd ..

# wget http://archive.apache.org/dist/apr/apr-util-1.3.9.tar.gz

# tar -xvzf apr-util-1.3.9.tar.gz

# ./configure --wiht-apr=/usr/local/apr ;;apr에 대한 전체 설치 경로

# make

# make install

# cd ..


# wget http://archive.apache.org/dist/httpd/httpd-2.3.8.tar.gz


# tar -xvzf httpd-2.3.8.tar.gz


# cd httpd-2.3.8


# ./configure --prefix=/usr/local/apache --enable-modules=so --enable-mods-shared=all --enable-modules=shared  --enable-ssl --enable-rewrite --with-mpm=worke --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr                  

 

1. 옵션값 설명

  ;;--prefix(설치경로) --enable-modules=so(모듈동적컴파일)

                ;;--enable-mods-shared(모든모듈을 DSO모드로지정) --enable-modules(정적링크)

         ;;(ssl모듈)(rewrite모듈) mpm(서버의동작방식prefork로 설치해야만 zend설치가능)

  ;; 이미설치된 apr과 apr-util 컴파일경로



# cp /usr/local/apache/bin/apachectl /etc/init.d/httpd

# vim /etc/init.d/httpd

#chkconfig: - 85 15      <<추가해야지만 chkconfig --add 에 apachectl 이 추가된다

#chkconfig --add apacheclt

#chkconfig --level 3 apachectl on ;;리부팅되도 apache자동실행




**mysql 설치**


#cd /usr/local/src

# wget  http://www.cmake.org/files/v2.8/cmake-2.8.5.tar.gz ;;cmake 설치

# tar -zvxf cmake-2.8.5.tar.gz

# cd cmake-2.8.5.tar.gz

# ./bootstarp

# make

# make install


#groupadd -g 400 mysql ;;-g(그룹고유 ID부여)

#useradd -u400 -g400 -d /usr/local/mysql -s /bin/false mysql ;; -u(UID값) -g(그룹지정) -d (디렉토리지정) -s (쉘지정)


# wget  http://downloads.mysql.com/archives/mysql-5.5/mysql-5.5.14.tar.gz

# tar -zvxf mysql-5.5.14.tar.gz

# cd mysql-5.5.14.tar.gz

# cmake -DCMAKE_INSTALL_PREFIX=/usr/local/mysql                               

-DMYSQL_DATADIR=/usr/local/mysql/data                                

-DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8_general_ci      

-DWITH_EXTRA_CHARSETS=all -DENABLED_LOCAL_INFILE=1        

-DWITH_INNOBASE_STORAGE_ENGINE=1                                                   

-DMYSQL_UNIX_ADDR=/tmp/mysql.sock                                                   

-DSYSCONFDIR=/etc -DMYSQL_TCP_PORT=3306                           


옵션값 설명

-DCMAKE_INSTALL_PREFIX= ;;mysql설치할 디렉토리

-DMYSQL_DATADIR= ;;mysql 데이터디렉토리

-DDEFAULT_CHARSET= ;; 기본문자셋

-DDEFAULT_COLLATION=;;기본콜레션(문자셋과동일) euckr로 원하는경우 변경

-DWITH_EXTRA_CHARSETS=;;추가로 지원할언어선택 기본값 all,

-DENABLED_LOCAL_INFILE=sql파일을 로드하게해주는기능 0끄기 1 켜기

-DWITH_INNOBASE_STORAGE_ENGINE=   ;; 사용하고자 하는 스토리지 엔진 지정

-DMYSQL_UNIX_ADDR= ;; 유닉스소켓파일지정

-DSYSCONFDIR= ;; 프로필 경로

-DMYSQL_TCP_PORT= 기본포트


# make

# make install



**mysql DB생성및 보안설정**


# cp -arp scripts/mysql_install_db /usr/local/mysql/

# cd /usr/local/mysql

# rm -rf data                                                     ;;기존 data폴더를지운뒤

# sh ./mysql_install_db                                         ;;다시 data폴더생성

그럼에도 data가 생기지않을경우

#sh ./mysql_install_db --user=mysql --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data


# chown -R mysql:mysql /usr/local/mysql

# chown -R mysql.mysql /usr/local/mysql/data

# cp support-files/my-huge.cnf /etc/my.cnf     ;;메모리가 1G-2G일때 huge 사용

# cp /usr/local/mysql/support-files/mysql.server /etc/init.d/mysqld

# chmod 700 /etc/init.d/mysqld

# chown root.root /etc/init.d/mysqld

# chkconfig --add mysqld                                        ;;mysqld라는 새로운 서비스 추가

# chkconfig --level 3 mysqld on                            ;;리부팅되도 자동실행

# chmod 711 /usr/local/mysql

# chmod 700 /usr/local/mysql/data

# chmod 751 /usr/local/mysql/bin

# chmod 750 /usr/local/mysql/bin/*

# chmod 755 /usr/local/mysql/bin/mysql

# chmod 755 /usr/local/mysql/bin/mysqldump


#vim /root/.bashrc         ;;mysql명령어 사용할수 있게 추가

alias mysqladmin='/usr/local/mysql/bin/mysqladmin'

alias mysqldump='/usr/local/mysql/bin/mysqldump'

alias mysql='/usr/local/mysql/bin/mysql'




**PHP 설치 **


필수구성요소 먼저설치

# cd /usr/local/src

# wget http://ris.smileserv.com/source/mhash-0.9.7.1.tar.gz

# tar -zvxf mhash-0.9.7.1.tar.gz

# cd mhash-0.9.7.1.tar.gz

# ./confgure

# make

# install


# cd /usr/local/src

# wget http://ris.smileserv.com/source/libmcrypt-2.5.7.tar.gz

# tar -zvxf libmcrypt-2.5.7.tar.gz

# cd libmcrypt-2.5.7.tar.gz

# ./confgure

# make

# install


# cd /usr/local/src

# wget http://www.ijg.org/files/jpegsrc.v6b.tar.gz

# tar -zvxf jpegsrc.v6b.tar.gz

# cd jpeg-6b

#cp -f /usr/share/libtool/config/config.guess .

#cp -f /usr/share/libtool/config/config.sub .

# ./confgure --enable-shared --enable-static

# make

# install



@@64비트 운영체제는 진행


#ln -sf /usr/lib64/libpng12.so.0 /usr/lib/libpng12.so.0      ;;이부분은 CentOS 6, fedora 15 이상에서 해당되는 내용입니다.

ln -sf /usr/lib64/libpng12.a /usr/lib/libpng12.a

ln -sf /usr/lib64/libpng.so.3 /usr/lib/libpng.so.3

ln -sf /usr/lib64/libpng.so /usr/lib/libpng.so

ln -sf /usr/lib64/libpng12.so /usr/lib/libpng12.so

ln -sf /usr/lib64/libc-client.so /usr/lib/libc-client.so

ln -sf /usr/lib64/libgssapi_krb5.so /usr/lib/libgssapi_krb5.so

ln -sf /usr/lib64/libkrb5.so /usr/lib/libkrb5.so

ln -sf /usr/lib64/libkrb5support.so /usr/lib/libkrb5support.so

----------------------



# cd /usr/local/src

# wget http://ftp.ntu.edu.tw/tmp/php/distributions/php-5.3.8.tar.gz


# tar -zvxf php-5.3.8.tar.gz


# cd php-5.3.8


# ./configure --prefix=/usr/local/php --with-apxs2=/usr/local/apache/bin/apxs        

--enable-mod-charset --with-config-file-path=/usr/local/apache/conf                     

--enable-sigchild --enable-magic-quotes                           

--with-libxml-dir                                 

--with-openssl --with-zlib --with-zlib-dir --with-bz2        

--enable-calendar --with-curl --enable-dba   

--with-gdbm --enable-exif --enable-ftp                    

--with-gd --with-jpeg-dir --with-png-dir                           

--with-freetype-dir --enable-gd-native-ttf                           

--with-gettext --with-imap --with-imap-ssl                    

--with-kerberos --enable-mbstring --with-mhash               

--with-mcrypt --with-mysql=/usr/local/mysql                     

--enable-sockets --with-regex=php --enable-sysvmsg  

--enable-sysvsem --enable-sysvshm                              

--enable-wddx --enable-zend-multibyte                                




옵션값

--prefix=;; 설치위치지정 , 

--with-apxs2(아파치와연동지원)

--enable-mod-charset :: charset을 위한 변환테이블을 유효하게한다

--with-config-file-path= php.ini를 찾는 패스설정

--enable-sigchild :: php의 독자적인 sigchild장치설정,

--enable-magic-quotes :: (자동으로처리해주는기능)

--with-libxml-dir  ::XML2지원을 위한 libxml2라이브러리 지정

--with-openssl --with-zlib --with-zlib-dir --with-bz  :: openssl, zlib bz2(압축프로그램) 지원 zlib디렉토리 지정

--enable-calendar --with-curl --enable-dba    :: calendar( Calendar Conversion 를 지원합니다.) curl지원 ,

--with-gdbm --enable-exif --enable-ftp           ::  exif(이미지 메타정보표시) ftp지원 

--with-gd --with-jpeg-dir --with-png-dir       ::   gd,jpeg,png그래픽지원, jpeg 디렉토리지정

--with-freetype-dir --enable-gd-native-ttf    :: freetype 폰트 라이브러리 디렉토리 지정, ttf 폰트지원

--with-gettext --with-imap --with-imap-ssl   ::  gettext(php내에 국제화를 위한 프로그램일 지원), imap, imap-ssl 지원

--with-kerberos --enable-mbstring --with-mhash  :: kerberos,mhash,지원

--with-mcrypt --with-mysql=/usr/local/mysql        ::    mcrypt암호화 기능지원, mysql 지원

--enable-sockets --with-regex=php --enable-sysvmsg  :: 소켓함수쓰기위해서 필요, ,System V message 를 지원

--enable-sysvsem --enable-sysvshm   :: System V Semaphore 를 지원, System V shared memory 를 지원.(윈도우 플랫폼 사용불가)

--enable-wddx --enable-zend-multibyte     :: enable-zend-multibyte(멀티바이트코드의 실행을 설정)




# make

# make install

# cp php.ini-development /usr/local/apache/conf/php.in


아파치 설정파일 수정

# vim /usr/local/apache/conf/httpd.conf

ServerName localhost


<Directory /home/*>

Optoins +ExecCGI

AllowOverride All

Allow from all

Order allow,deny

</Directory>


DirectoryIndex index.html index.htm index.php index.php3 index.php4 index.php5 index.phtml index.cgi index.jsp


AddType application/x-httpd-php .html .htm .php .php3 .php4 .php5 .phtml .cgi .inc

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

:wp