Centos 5.5 linux text 로 설치후
APM 소스 컴파일로 설치를 진행해 보자
기존에 설치된 http 또는 mysql을 삭제 하자
[root@localhost]# yum -y remove httpd* php* mysql*
APM 설치전에 필수 라이브러이 먼저 설치
[root@localhost]# yum -y install gcc gcc-c++ compat-gcc-34-g77 flex openssl* termcap libtermcap libtermcap-devel gdbm-devel gd* php-gd zlib* pam* curl* pid* libiconv libmcrypt* libmhash libxml* freetype* ncurses* libpng* libjpeg* bzip2-devel openldap-devel libc-client-devel php5-dev
[ APM 다운로드 ]
[root@localhost]# cd /usr/local/src
[root@localhost src]# wget http://download.softagency.net/MySQL/Downloads/MySQL-5.0/mysql-5.0.92.tar.gz
[root@localhost src]# wget http://apache.naggo.co.kr/httpd/httpd-2.2.17.tar.gz
[root@localhost src]# wget http://kr2.php.net/get/php-5.2.16.tar.gz/from/kr.php.net/mirror
[ APM 설치 ]
- MySQL 설치
[root@localhost src]# tar xvzf mysql-5.0.92.tar.gz
[root@localhost src]# cd mysql-5.0.92
[root@localhost src]# ./configure --prefix=/usr/local/mysql --localstatedir=/usr/local/mysql/data --with-charset=utf8 --with-mysql-user=mysql --with-extra-charsets=all --enable-thread-safe-client --enable-large-files --with-readline --with-innodb --disable-shared --with-client-ldflags=-all-static --with-mysqld-ldflags=-all-static --without-debug --without-docs
[root@localhost src]# make && make install
[root@localhost src]# groupadd mysql
[root@localhost src]# useradd -M -o -r -d /usr/local/mysql -s /sbin/nologin -c "Mysql Server" -u 27 -g mysql mysql >/dev/null 2>&1 || :
[root@localhost src]# chown -R root:mysql /usr/local/mysql
[root@localhost src]# /usr/local/mysql/bin/mysql_install_db
[root@localhost src]# chown -R mysql:mysql /usr/local/mysql/data
[root@localhost src]# /usr/local/mysql/bin/mysqld_safe &
[root@localhost src]# /usr/local/mysql/bin/mysqladmin -u root password 'new-password'
[root@localhost src]# echo /usr/local/mysql/lib/mysql >> /etc/ld.so.conf && ldconfig
[root@localhost src]# cp /usr/local/mysql/share/mysql/mysql.server /etc/init.d/mysqld
[root@localhost src]# chkconfig --add mysqld
[root@localhost src]# chkconfig --level 35 mysqld on (런레벨 35일때 자동 실행 된다)
[root@localhost src]# chkconfig --list | grep mysqld
[root@localhost src]# /etc/init.d/mysqld start
마지막으로 익명접근권한을 삭제하자.. mysql 콘솔에 그냥 접근을 못하게 해야 한다.
root 권한으로 접근하여.. mysql 데이터베이스를 선택한 후 다음 쿼리문을 실행한다.
USE mysql;
delete from user where password = "";
그 후에 mysql을 재시작 한다 일단은 콘솔을 종료하고... 쉘에서..
mysqladmin -u root -p reload
password
다음은 설치파일의 support-files폴더에 있는 my.cnf파일을 복사한다.
cp /usr/local/mysql/share/mysql/my-huge.cnf /etc/my.cnf #### my-huge.cnf (메모리1~2Gbyte)
cp /usr/local/mysql/share/mysql/my-large.cnf /etc/my.cnf #### my-large.cnf (메모리512Mbyte)
cp /usr/local/mysql/share/mysql/my-medium.cnf /etc/my.cnf #### my-medium.cnf (메모리64M~256Mbyte)
cp /usr/local/mysql/share/mysql/my-small.cnf /etc/my.cnf #### my-small.cnf (메모리 64Mbyte보다 작을때)
- Apache 2 설치
[root@localhost src]# tar xvzf httpd-2.2.17.tar.gz
[root@localhost src]# cd httpd-2.2.17
configure 는 아래 둘 중 하나만 사용....^^
[root@localhost src]# ./configure --prefix=/usr/local/apache2 --enable-module=so --with-mpm=worker --enable-dav --enable-so --enable-rewrite --enable-dav=shared --enable-dav-fs=shared --with-included-apr
[root@localhost src]# ./configure --prefix=/usr/local/apache2 --enable-so --enable-auth-digest --enable-authn-dbm --enable-authn-dbd --enable-authz-dbm --enable-dav --enable-dav-fs --enable-dav-lock --enable-deflate --enable-headers --enable-expires --enable-dbd --enable-dumpio --enable-log-forensic --enable-rewrite --enable-cache --enable-file-cache --enable-disk-cache --enable-mem-cache --enable-unique-id --enable-proxy --enable-proxy-connect --enable-proxy-ftp --enable-proxy-http --enable-proxy-ajp --enable-proxy-balancer --enable-ssl --with-z=/usr/local --with-ssl=/usr/local/ssl --with-mpm=worker
[root@localhost src]# make && make install
[root@localhost src]# cp /usr/local/apache2/bin/apachectl /etc/rc.d/init.d/httpd
[root@localhost src]# cd /etc/rc.d/init.d
[root@localhost src]# head -7 network >> httpd
[root@localhost src]# chkconfig --add httpd
[root@localhost src]# ntsysv (httpd 서비스 추가여부 확인)
[root@localhost src]# service httpd start
[root@localhost src]# service httpd restart
아파치 환경설정은 /usr/local/apache2/conf/httpd.conf 에서 하면 된다.
환경설정은 APM 설치후 따로 진행 하겠슴다.
- PHP 5.2.16 설치
[root@localhost src]# tar xvzf php-5.2.16.tar.gz
[root@localhost src]# cd php-5.2.16
[root@localhost src]# ./configure --prefix=/usr/local/php --with-libdir=lib --with-mysql=/usr/local/mysql --with-mysqli=/usr/local/mysql/bin/mysql_config --with-apxs2=/usr/local/apache2/bin/apxs --with-zlib --with-gd --with-ttf --with-png --with-expat-dir=/usr --with-gmp --with-xml --with-charset=utf_8 --disable-debug --disable-rpath --with-iconv --enable-mailparse --enable-safe-mode --enable-magic-quotes --enable-bcmath --enable-dio --enable-gd-native-ttf --enable-sysvsem --enable-sysvshm --enable-wddx --enable-pic --enable-inline-optimization --enable-mbstring --enable-mbregex --enable-mbstr-enc-trans --with-config-file- --enable-ftp --disable-debug --enable-track-vars=yes --with-jpeg-dir --with-freetype-dir --enable-gd-native-ttf --enable-dl --enable-gd-imgstrttf --with-curl --with-xml2 --with-xpm-dir=/usr --with-mcrypt --enable-exif --with-openssl --enable-soap
[root@localhost src]# make && make install
[root@localhost src]# cp /usr/local/src/php-5.2.16/php.ini-dist /usr/local/php/lib/php.ini
[root@localhost src]# vi /usr/local/php/lib/php.ini (PHP 설정)
-> post_max_size=적정수M (적당한 값)
-> upload_max_filesize = 적정수m (적당한 값 ,한번에 올리는 업로드 용량조정)
-> 검색을 통해서 설정방법을 터득하여 수정하세요...^^
[root@localhost src]# vi /usr/local/apache2/conf/httpd.conf
-> LoadModule php5_module modules/libphp5.so (확인)
APM 설치가 끝났다 그런데 몇가지 수정을 해주어야 정상적으로 작동을 한다.
httpd.conf 를 수정해 주어야 한다.
[root@localhost src]# vi /usr/local/apache2/conf/httpd.conf
httpd.conf 를 열고
DirectoryIndex index.html 를 찾아 DirectoryIndex index.html index.htm index.php index.php3 index.cgi index.jsp 로 수정
359번째줄의
AddType application/x-compress .Z
AddType application/x-gzip .gz .tgz
를 아래와 같이 추가 수정 한다.
AddType application/x-compress .Z
AddType application/x-httpd-php .php4 .php3 .php .htm .html .phtml .ph .inc
AddType application/x-httpd-php-source .phps
AddType application/x-gzip .gz .tgz
몇가지 주석 및 제거 - 필요에 따라 더 적용해도 무방함
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
Order deny,allow
#Deny from all <-- 주석처리
</Directory>
[root@localhost src]# vi /usr/local/apache2/conf/extra/httpd-userdir.conf
Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec 를
Options MultiViews SymLinksIfOwnerMatch IncludesNoExec 로
Indexes 를 삭제 한다.
[root@localhost src]# vi /usr/local/apache2/conf/extra/httpd-vhosts.conf
내용을 모두 삭제하고 아래 문구 만 적용후 저장 - 저장방법은 :wq 인 것은 아시죠...^^
NameVirtualHost *:80
<VirtualHost *:80>
DocumentRoot /usr/local/apache2/htdocs/
ServerName *
</VirtualHost>
[root@localhost src]# vi /root/.bash_profile
PATH=$PATH:$HOME/bin 를
PATH=$PATH:$HOME/bin:/usr/local/mysql/bin:/usr/local/apache2/bin 로 수정
이제 APM 작업이 모드 끝났으니
service httpd restart
service mysqld restart
실행하고 서버 테스트를 해보자....^^
위의 작업이 끝난후에도 아래와 같이
리눅스 자체 방화벽(iptables) 최적화 및 ModSecurity 웹방화벽 설치, OpenSSH Chroot 적용, Bind + vsftp + Qmail or Sendmail + Webmail, 포트모니터링, 트래픽 모니터링, 웹로그 분석기, 장애 모니터링, phpmyadmin, WebFTP, 호스팅 컨트롤 판넬 등......
아직 설치 및 설정 할 것이 많이 있다는....에효~~~~
더 많은 정보는 블로그에 포스트 합니다.
퍼가시는것은 자유이나 출처는 남겨 주세요....^^<div class='small'>[이 게시물은 관리자님에 의해 2011-10-31 17:32:05 Linux에서 이동 됨]</div>
APM 소스 컴파일로 설치를 진행해 보자
기존에 설치된 http 또는 mysql을 삭제 하자
[root@localhost]# yum -y remove httpd* php* mysql*
APM 설치전에 필수 라이브러이 먼저 설치
[root@localhost]# yum -y install gcc gcc-c++ compat-gcc-34-g77 flex openssl* termcap libtermcap libtermcap-devel gdbm-devel gd* php-gd zlib* pam* curl* pid* libiconv libmcrypt* libmhash libxml* freetype* ncurses* libpng* libjpeg* bzip2-devel openldap-devel libc-client-devel php5-dev
[ APM 다운로드 ]
[root@localhost]# cd /usr/local/src
[root@localhost src]# wget http://download.softagency.net/MySQL/Downloads/MySQL-5.0/mysql-5.0.92.tar.gz
[root@localhost src]# wget http://apache.naggo.co.kr/httpd/httpd-2.2.17.tar.gz
[root@localhost src]# wget http://kr2.php.net/get/php-5.2.16.tar.gz/from/kr.php.net/mirror
[ APM 설치 ]
- MySQL 설치
[root@localhost src]# tar xvzf mysql-5.0.92.tar.gz
[root@localhost src]# cd mysql-5.0.92
[root@localhost src]# ./configure --prefix=/usr/local/mysql --localstatedir=/usr/local/mysql/data --with-charset=utf8 --with-mysql-user=mysql --with-extra-charsets=all --enable-thread-safe-client --enable-large-files --with-readline --with-innodb --disable-shared --with-client-ldflags=-all-static --with-mysqld-ldflags=-all-static --without-debug --without-docs
[root@localhost src]# make && make install
[root@localhost src]# groupadd mysql
[root@localhost src]# useradd -M -o -r -d /usr/local/mysql -s /sbin/nologin -c "Mysql Server" -u 27 -g mysql mysql >/dev/null 2>&1 || :
[root@localhost src]# chown -R root:mysql /usr/local/mysql
[root@localhost src]# /usr/local/mysql/bin/mysql_install_db
[root@localhost src]# chown -R mysql:mysql /usr/local/mysql/data
[root@localhost src]# /usr/local/mysql/bin/mysqld_safe &
[root@localhost src]# /usr/local/mysql/bin/mysqladmin -u root password 'new-password'
[root@localhost src]# echo /usr/local/mysql/lib/mysql >> /etc/ld.so.conf && ldconfig
[root@localhost src]# cp /usr/local/mysql/share/mysql/mysql.server /etc/init.d/mysqld
[root@localhost src]# chkconfig --add mysqld
[root@localhost src]# chkconfig --level 35 mysqld on (런레벨 35일때 자동 실행 된다)
[root@localhost src]# chkconfig --list | grep mysqld
[root@localhost src]# /etc/init.d/mysqld start
마지막으로 익명접근권한을 삭제하자.. mysql 콘솔에 그냥 접근을 못하게 해야 한다.
root 권한으로 접근하여.. mysql 데이터베이스를 선택한 후 다음 쿼리문을 실행한다.
USE mysql;
delete from user where password = "";
그 후에 mysql을 재시작 한다 일단은 콘솔을 종료하고... 쉘에서..
mysqladmin -u root -p reload
password
다음은 설치파일의 support-files폴더에 있는 my.cnf파일을 복사한다.
cp /usr/local/mysql/share/mysql/my-huge.cnf /etc/my.cnf #### my-huge.cnf (메모리1~2Gbyte)
cp /usr/local/mysql/share/mysql/my-large.cnf /etc/my.cnf #### my-large.cnf (메모리512Mbyte)
cp /usr/local/mysql/share/mysql/my-medium.cnf /etc/my.cnf #### my-medium.cnf (메모리64M~256Mbyte)
cp /usr/local/mysql/share/mysql/my-small.cnf /etc/my.cnf #### my-small.cnf (메모리 64Mbyte보다 작을때)
- Apache 2 설치
[root@localhost src]# tar xvzf httpd-2.2.17.tar.gz
[root@localhost src]# cd httpd-2.2.17
configure 는 아래 둘 중 하나만 사용....^^
[root@localhost src]# ./configure --prefix=/usr/local/apache2 --enable-module=so --with-mpm=worker --enable-dav --enable-so --enable-rewrite --enable-dav=shared --enable-dav-fs=shared --with-included-apr
[root@localhost src]# ./configure --prefix=/usr/local/apache2 --enable-so --enable-auth-digest --enable-authn-dbm --enable-authn-dbd --enable-authz-dbm --enable-dav --enable-dav-fs --enable-dav-lock --enable-deflate --enable-headers --enable-expires --enable-dbd --enable-dumpio --enable-log-forensic --enable-rewrite --enable-cache --enable-file-cache --enable-disk-cache --enable-mem-cache --enable-unique-id --enable-proxy --enable-proxy-connect --enable-proxy-ftp --enable-proxy-http --enable-proxy-ajp --enable-proxy-balancer --enable-ssl --with-z=/usr/local --with-ssl=/usr/local/ssl --with-mpm=worker
[root@localhost src]# make && make install
[root@localhost src]# cp /usr/local/apache2/bin/apachectl /etc/rc.d/init.d/httpd
[root@localhost src]# cd /etc/rc.d/init.d
[root@localhost src]# head -7 network >> httpd
[root@localhost src]# chkconfig --add httpd
[root@localhost src]# ntsysv (httpd 서비스 추가여부 확인)
[root@localhost src]# service httpd start
[root@localhost src]# service httpd restart
아파치 환경설정은 /usr/local/apache2/conf/httpd.conf 에서 하면 된다.
환경설정은 APM 설치후 따로 진행 하겠슴다.
- PHP 5.2.16 설치
[root@localhost src]# tar xvzf php-5.2.16.tar.gz
[root@localhost src]# cd php-5.2.16
[root@localhost src]# ./configure --prefix=/usr/local/php --with-libdir=lib --with-mysql=/usr/local/mysql --with-mysqli=/usr/local/mysql/bin/mysql_config --with-apxs2=/usr/local/apache2/bin/apxs --with-zlib --with-gd --with-ttf --with-png --with-expat-dir=/usr --with-gmp --with-xml --with-charset=utf_8 --disable-debug --disable-rpath --with-iconv --enable-mailparse --enable-safe-mode --enable-magic-quotes --enable-bcmath --enable-dio --enable-gd-native-ttf --enable-sysvsem --enable-sysvshm --enable-wddx --enable-pic --enable-inline-optimization --enable-mbstring --enable-mbregex --enable-mbstr-enc-trans --with-config-file- --enable-ftp --disable-debug --enable-track-vars=yes --with-jpeg-dir --with-freetype-dir --enable-gd-native-ttf --enable-dl --enable-gd-imgstrttf --with-curl --with-xml2 --with-xpm-dir=/usr --with-mcrypt --enable-exif --with-openssl --enable-soap
[root@localhost src]# make && make install
[root@localhost src]# cp /usr/local/src/php-5.2.16/php.ini-dist /usr/local/php/lib/php.ini
[root@localhost src]# vi /usr/local/php/lib/php.ini (PHP 설정)
-> post_max_size=적정수M (적당한 값)
-> upload_max_filesize = 적정수m (적당한 값 ,한번에 올리는 업로드 용량조정)
-> 검색을 통해서 설정방법을 터득하여 수정하세요...^^
[root@localhost src]# vi /usr/local/apache2/conf/httpd.conf
-> LoadModule php5_module modules/libphp5.so (확인)
APM 설치가 끝났다 그런데 몇가지 수정을 해주어야 정상적으로 작동을 한다.
httpd.conf 를 수정해 주어야 한다.
[root@localhost src]# vi /usr/local/apache2/conf/httpd.conf
httpd.conf 를 열고
DirectoryIndex index.html 를 찾아 DirectoryIndex index.html index.htm index.php index.php3 index.cgi index.jsp 로 수정
359번째줄의
AddType application/x-compress .Z
AddType application/x-gzip .gz .tgz
를 아래와 같이 추가 수정 한다.
AddType application/x-compress .Z
AddType application/x-httpd-php .php4 .php3 .php .htm .html .phtml .ph .inc
AddType application/x-httpd-php-source .phps
AddType application/x-gzip .gz .tgz
몇가지 주석 및 제거 - 필요에 따라 더 적용해도 무방함
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
Order deny,allow
#Deny from all <-- 주석처리
</Directory>
[root@localhost src]# vi /usr/local/apache2/conf/extra/httpd-userdir.conf
Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec 를
Options MultiViews SymLinksIfOwnerMatch IncludesNoExec 로
Indexes 를 삭제 한다.
[root@localhost src]# vi /usr/local/apache2/conf/extra/httpd-vhosts.conf
내용을 모두 삭제하고 아래 문구 만 적용후 저장 - 저장방법은 :wq 인 것은 아시죠...^^
NameVirtualHost *:80
<VirtualHost *:80>
DocumentRoot /usr/local/apache2/htdocs/
ServerName *
</VirtualHost>
[root@localhost src]# vi /root/.bash_profile
PATH=$PATH:$HOME/bin 를
PATH=$PATH:$HOME/bin:/usr/local/mysql/bin:/usr/local/apache2/bin 로 수정
이제 APM 작업이 모드 끝났으니
service httpd restart
service mysqld restart
실행하고 서버 테스트를 해보자....^^
위의 작업이 끝난후에도 아래와 같이
리눅스 자체 방화벽(iptables) 최적화 및 ModSecurity 웹방화벽 설치, OpenSSH Chroot 적용, Bind + vsftp + Qmail or Sendmail + Webmail, 포트모니터링, 트래픽 모니터링, 웹로그 분석기, 장애 모니터링, phpmyadmin, WebFTP, 호스팅 컨트롤 판넬 등......
아직 설치 및 설정 할 것이 많이 있다는....에효~~~~
더 많은 정보는 블로그에 포스트 합니다.
퍼가시는것은 자유이나 출처는 남겨 주세요....^^<div class='small'>[이 게시물은 관리자님에 의해 2011-10-31 17:32:05 Linux에서 이동 됨]</div>
댓글 7개
게시글 목록
| 번호 | 제목 |
|---|---|
| 20097 | |
| 20095 | |
| 20093 | |
| 20092 | |
| 20091 | |
| 20089 | |
| 20086 | |
| 20085 | |
| 20084 | |
| 20083 | |
| 20082 | |
| 28358 | |
| 20081 | |
| 20079 | |
| 20078 | |
| 20077 | |
| 20076 | |
| 20075 | |
| 20074 | |
| 20073 |
PHP
php환경 변수 출력 입니다.
|
| 20072 |
PHP
PHP팁 (보안 등) 입니다.
|
| 20071 |
PHP
문자열 자르는 함수 입니다.
|
| 20070 | |
| 20069 | |
| 8148 | |
| 20057 |
정규표현식
파싱 예제입니다.
11
|
| 8141 | |
| 24669 | |
| 20056 | |
| 8138 | |
| 28353 | |
| 20055 | |
| 20054 | |
| 20053 | |
| 20052 | |
| 20051 | |
| 20050 |
JavaScript
지난 시간 경과시간 페이스북 sns 처럼 보여주기 javascript 버전
|
| 20047 | |
| 20046 |
PHP
php환경맞춤 부분 입니다.
|
| 20045 | |
| 20044 | |
| 8111 | |
| 20043 | |
| 20042 | |
| 20040 | |
| 20039 |
JavaScript
구글 맞춤검색 설정 방법, google custom search
|
| 20037 | |
| 20036 | |
| 20035 | |
| 20027 |
MySQL
1000만건 게시판에 도전합니다. 두번째
7
|
| 8107 | |
| 31022 | |
| 20026 |
MySQL
Join 을 이용한 delete
|
| 20025 | |
| 20024 | |
| 20023 |
PHP
미리 정의된 변수들 입니다.
|
| 28350 | |
| 20022 | |
| 20018 |
MySQL
1000만건 게시판에 도전합니다. 첫번째
3
|
| 20017 |
MySQL
select 해서 바로 insert하기
|
| 8099 | |
| 20016 | |
| 20013 | |
| 8090 | |
| 20012 | |
| 20010 | |
| 20009 | |
| 19998 |
PHP
텔레그램 푸쉬 봇
10
|
| 28348 | |
| 28347 | |
| 19997 | |
| 19996 |
OS
파일분할 분할압축 해제
|
| 19995 |
웹서버
리눅스백그라운드실행
|
| 19993 | |
| 8087 | |
| 8065 | |
| 19990 | |
| 8063 | |
| 8056 | |
| 19989 | |
| 19988 | |
| 19987 | |
| 19986 | |
| 19985 | |
| 19984 | |
| 19983 | |
| 19982 |
MySQL
mysql에서 boolean 타입 사용하기
|
| 8054 | |
| 19981 | |
| 19980 | |
| 19979 |
MySQL
mysqladmin 상태 모니터링
|
| 19978 | |
| 19977 | |
| 19976 |
웹서버
리눅스 프로세스 검사, 조회
|
| 19975 |
웹서버
리눅스에서 네트워크 상태 보기
|
| 19974 |
웹서버
리눅스 80 포트 방화벽 열기
|
| 19973 | |
| 19972 |
MySQL
Mysql Table 일괄 삭제 방법.
|
| 19971 | |
| 19970 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기