메뉴 건너뛰기

2014.02.27 11:06

APM 소스 설치

조회 수 8068 추천 수 0 댓글 0
?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄
?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄

♧ 버전 정보

- os : centOS 5.3

- Apache 2.2.3

- Php 5.2.1

- Mysql 5.0.33

- ZendOptimizer 3.3.3


APM이란?

- Apache + php + Mysql

Apache : 정적 파일의 웹 서비스를 담당하는 웹 서비스

Php : 웹 스크립트 언어

Mysql : 데이터베이스


[설치 전 작업]


OS 설치 이후 rpm으로 설치된 mysql httpd을 검색

root@localhost# rpm –qa mysql

mysql-5.0.45-7.el5

root@localhost# rpm –qa httpd

httpd-2.2.3-22.el5.centos

검색된 mysql httpd 삭제

root@localhost# rpm –e –-nodeps mysql-5.0.45

root@localhost# rpm –e –-nodeps httpd-2.2.3

삭제 후 위의 명령어(rpm -qa)를 이용하여 삭제여부를 확인


root@localhost# vi /etc/selinux/config

SELINUX=disabled 으로 수정


필요한 라이브러리 설치

root@localhost# yum –y install freetype* libjpeg* libpng* gd* libmcrypt*

root@localhost# yum –y install lrzsz*


[APM 설치 작업]


1. 설치 전 아래 경로로 이동하여 다운

root@localhost# cd /usr/local/src

root@src# ls –l

 



2. Tar 명령어를 이용하여 압축 해제

root@src# tar xvfz httpd-2.2.3.tar.gz

root@src# tar xvfz mysql-5.0.33.tar.gz

root@src# tar xvfz php-5.2.1.tar.gz

root@src# tar xvfz Zendoptimizer-3.3.3-linux-glibc23-i386.tar.gz

 


 

3. mysql부터 설치

root@src# cd mysql


root@mysql# ./configure --prefix=/usr/local/mysql-5.0.33 --localstatedir=/usr/local/mysql/var --with-charset=euckr

root@mysql# make && make install


root@mysql# ln –s /usr/local/mysql-5.0.33 /usr/local/mysql

실제로 컴파일 진행 시 ‘--prefix=/usr/local/mysql-5.0.33’ 설치 경로를 잡아주었기 때문에 소프트 링크로 링크를 걸어줍니다.


root@mysql# useradd mysql –g daemon –u 60 –M –s /bin/false –c “mysql server user” –d /usr/local/mysql

Mysql을 실행시킬 계정을 생성합니다.


root@mysql# /usr/local/mysql/bin/mysql_install_db

데이터베이스 생성

root@mysql# chown –R mysql.root /usr/local/mysql/var

데이터베이스가 생성된 디렉토리에 mysql로 소유권을 변경합니다.

root@mysql# /usr/local/mysql/bin/mysqld_safe &

mysql 실행합니다.


4. Apache(httpd) 설치

root@src# cd apache

root@apache# vi server/mpm/prefork/prefork.c

#define DEFAULT_SERVER_LIMIT 2048 여기를 수정


root@apache# vi server/mpm/worker/worker.c

#define DEFAULT_SERVER_LIMIT 128 여기를 수정

컴파일 하기 전에 위의 부분들을 수정하여 접속제한 수를 늘려줍니다.


root@apache# ./configure --prefix=/usr/local/httpd-2.2.3 --with-charset=euckr --enable-so --enable-ssl --with-ssl


root@apache# vi /usr/local/src/httpd-2.2.3/docs/conf/extra/httpd-mpm.conf

MaxClient 2048 여기를 수정

Make 하기 전에 위의 부분을 수정하여 접속제한 수를 늘려줍니다.


root@apache# make && make install


root@apache# ln -s /usr/local/httpd-2.2.3 /usr/local/apache;

실제로 컴파일 진행 시 ‘--prefix=/usr/local/httpd-2.2.3‘ 설치 경로를 잡아주었기 때문에 소프트 링크로 링크를 걸어줍니다.


5. Php 설치

root@src# cd php

root@php# ./configure --with-apxs2=/usr/local/apache/bin/apxs --with-config-file-path=/usr/local/apache/conf --with-mysql=/usr/local/mysql --with-zlib-dir=/usr/lib --with-png-dir=/usr/lib --with-jpeg-dir=/usr/lib --with-gif-dir=/usr/lib --with-gd --with-freetype --with-openssl --with-gettext --with-kerberos --with-mod_charset --with-language=korean --with-charset=euc_kr --with-regex=php --with-dbm --with-gdbm --with-ldap --with-xml --with-ttf --enable-module=so --enable-gd-native-ttf --enable-ftp --enable-sockets --disable-debug --enable-sysvsem --enable-sysvshm --enable-shmop --enable-track-vars --enable-freetype-4bit-antialias-hack --enable-calendar --enable-sigchild --enable-magic-quotes --enable-trans-sid --enable-inline-optimization --enable-bcmath --enable-mbstring=kr --enable-mbstr-enc-trans --enable-force-cgi-redirect


root@php# make && make install

root@php# cp php.ini-dist /usr/local/apache/conf/php.ini

php 환경 설정파일(php.ini) apache의 환경 설정파일이 있는 곳으로 복사합니다.


root@localhost# vi /usr/local/apache/htdocs/info.php

<? Infophp(); ?>

컴파일된 정보를 웹 상으로 볼 수 있도록 php 문서를 작성합니다.


6. Zend 설치

root@src# cd Zend

root@Zend# ./install

install 진행 중 php.ini 파일의 위치를 설정해 주는 부분이 나오면 ‘/usr/local/apache/conf’ 를 입력합니다.


7. Httpd.conf 환경 설정

root@localhost# vi /usr/local/apache/conf/httpd.conf


ServerName localhost:80 또는 127.0.0.1:80 으로 수정

서버 네임을 지정합니다.


DocumentRoot "/usr/local/httpd-2.2.x/htdocs"

웹 페이지의 홈디렉토리를 설정합니다.


DirectoryIndex index.html index.htm index.php main.html 을 추가

웹 메인 페이지 지정합니다.


LoadModule php5_module modules/libphp5.so 없으면 추가

Php 모듈을 사용할 수 있도록 해줍니다.


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

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

Php를 연동시켜줍니다.


추가사항

가상 호스트를 추가하는 방법입니다.

root@localhost# vi /usr/local/apache/conf/httpd.conf

# Virtual hosts

#Include conf/extra/httpd-vhosts.conf

위의 부분의 주석을 제거합니다.


root@localhost# vi /usr/local/apache/conf/extra/httpd-vhosts.conf

<VirtualHost *:80>

ServerAdmin www@ksidc.net 설명

DocumentRoot /home/www 도메인의 홈디렉토리

ServerName ksidc.net 사용하는 도메인

ServerAlias www.ksidc.net 도메인 별칭

ErrorLog logs/dummy-host2.example.com-error_log 로그파일이 생성

CustomLog logs/dummy-host2.example.com-access_log common 로그파일이 생성

</VirtualHost>


8. 자동 실행 설정

root@localhost# vi /etc/rc.d/rc.local

/usr/local/apache/bin/apachectl start >&/dev/null

/usr/local/mysql/bin/mysqld_safe --user=mysql & >&/dev/null

Rc.local 파일에 위의 부분을 추가하여 부팅 시 자동적으로 실행되도록 설정합니다.


9. PATH 설정

root@localhost# echo "/usr/local/apache/lib" >> /etc/ld.so.conf

root@localhost# echo "/usr/local/apache/modules" >> /etc/ld.so.conf

root@localhost# ldconfig

root@localhost# echo 'PATH=$PATH:/usr/local/php/bin:/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/apache/bin:/usr/local/mysql/bin' >> /etc/profile;

root@localhost# echo 'export PATH' >> /etc/profile;



그 외 버전에 따른 컴파일 정보

Mysql

- 4.0 버전

./configure --prefix=/usr/local/mysql-4.0.x --localstatedir=/usr/local/mysql-4.0.x/var --with-charset=euc_kr --enable-assembler --without-readline

- 4.1 버전

./configure --prefix=/usr/local/mysql-4.1.x --localstatedir=/usr/local/mysql-4.1.x/var --with-charset=euckr –enable-assembler --without-readline


Apache

- 1.3 버전

./configure --prefix=/usr/local/apache --enable-rule=SHARED_CORE --enable-module=so --enable-shared=max

- 2.0 버전

./configure --prefix=/usr/local/httpd-2.0.x --enable-ssl=static --with-ssl --with-mpm=prefork --enable-so --disable-ext-filter --enable-mods-shared=all


Php

- Php의 경우 apahce 버전에 따라 컴파일 옵션이 다릅니다.

- Apache 1.x.x 버전일 경우 --with-apxs

- Apache 2.x.x 버전일 경우 --with-apxs2


  1. No Image 27Feb
    by
    2014/02/27 Views 8095 

    ftp passive mode 설정

  2. No Image 27Feb
    by 조쉬
    2014/02/27 Views 8068 

    APM 소스 설치

  3. No Image 27Feb
    by
    2014/02/27 Views 7735 

    APM 소스 설치

  4. No Image 27Feb
    by
    2014/02/27 Views 9258 

    vsftp 이란?

  5. No Image 27Feb
    by
    2014/02/27 Views 9605 

    파일 속성 명령어 : chattr, lsattr

  6. No Image 27Feb
    by
    2014/02/27 Views 7778 

    history 파일 삭제 제한하기

  7. No Image 27Feb
    by
    2014/02/27 Views 7966 

    apache + mysql 자동 실행 방법 (소스설치)

  8. No Image 27Feb
    by
    2014/02/27 Views 7968 

    도메인 포워딩 설정

  9. No Image 27Feb
    by
    2014/02/27 Views 8784 

    리눅스 보안 Tip

  10. No Image 27Feb
    by
    2014/02/27 Views 8248 

    SQL 인젝션 복구 쿼리

  11. No Image 27Feb
    by
    2014/02/27 Views 8013 

    외부에서 apache 정보 못보도록 설정하기

  12. No Image 27Feb
    by
    2014/02/27 Views 7581 

    도메인에 자동으로 www 붙도록 설정하기

  13. No Image 27Feb
    by
    2014/02/27 Views 7136 

    htaccess를 이용한 특정 디렉토리 접근 관리하기

  14. No Image 27Feb
    by
    2014/02/27 Views 9553 

    iptable에서 TCP SYN Flooding 차단 설정

  15. No Image 27Feb
    by
    2014/02/27 Views 7806 

    yum rpmforge 등록하기

  16. No Image 27Feb
    by
    2014/02/27 Views 7861 

    iptables GEOIP 모듈 설치. (국가별 IP 차단)

  17. No Image 27Feb
    by
    2014/02/27 Views 7084 

    tmp 보안 셋팅

  18. No Image 27Feb
    by
    2014/02/27 Views 8218 

    Linux LVM구성하기

  19. No Image 27Feb
    by
    2014/02/27 Views 7103 

    CentOS 32Bit 운영체제에서 메모리 4G인식 시키는 방법

  20. No Image 27Feb
    by
    2014/02/27 Views 8781 

    suPHP로 웹서버 보안을 강화하자

Board Pagination Prev 1 2 3 4 5 6 7 8 9 10 ... 12 Next
/ 12

하단 정보를 입력할 수 있습니다

© k2s0o1d4e0s2i1g5n. All Rights Reserved