CentOS 5.5 + httpd-2.2.17 + MySql 5.0.92+ php 5.2.16 소스 컴파일 설치

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

댓글 7개

혹시 ssh 상위폴더 제한 하는거 정보 좀 가지고 있으신지요?
/home/1,2,3,4,5

이렇게 서비스가 되고 있을때,

1의 서비스 받는 유저가 /home 의 디렉토리를 못보게 할려면?

chmod 711 /home 하면 됩니다.

웹페이지 서비스에는 지장이 없습니다.
도움 많이 되었습니다
APM 설치 후에...

yum -y install yum-fastestmirror

이거 한번씩들 하세요 가까운 미러 사이트 자동으로 갱신해줍니다
다시 php에 발을 담그는데 많은 도움이 되네요...감사합니다.^^
이 버젼대로 하면 그누보드 설치 가능할까요??
네 설치해서 잘 쓰고 있습니다....^^
댓글을 작성하시려면 로그인이 필요합니다.

프로그램

태그 필터 (최대 3개) 전체 개발자 소스 기타 mysql 팁자료실 javascript php linux flash 정규표현식 jquery node.js mobile 웹서버 os 프로그램 강좌 썸네일 이미지관련 도로명주소 그누보드5 기획자 견적서 계약서 기획서 마케팅 제안서 seo 통계 서식 통계자료 퍼블리셔 html css 반응형 웹접근성 퍼블리싱 표준화 반응형웹 홈페이지기초 부트스트랩 angularjs 포럼 스크린리더 센스리더 개발자톡 개발자팁 퍼블리셔톡 퍼블리셔팁 기획자톡 기획자팁 프로그램강좌 퍼블리싱강좌
+
제목 글쓴이 날짜 조회
14년 전 조회 960
14년 전 조회 1,680
14년 전 조회 1,686
14년 전 조회 652
14년 전 조회 673
14년 전 조회 3,106
14년 전 조회 2,038
14년 전 조회 1,156
14년 전 조회 673
14년 전 조회 666
14년 전 조회 1,142
14년 전 조회 1,436
14년 전 조회 1,299
14년 전 조회 1,090
14년 전 조회 1,343
14년 전 조회 1,073
14년 전 조회 1,600
14년 전 조회 644
14년 전 조회 1,018
14년 전 조회 644
14년 전 조회 1,107
14년 전 조회 712
14년 전 조회 972
14년 전 조회 698
14년 전 조회 947
14년 전 조회 1,221
14년 전 조회 2,741
14년 전 조회 1,057
14년 전 조회 4,429
14년 전 조회 1,928
14년 전 조회 1,223
14년 전 조회 1,458
14년 전 조회 1,338
14년 전 조회 1,730
14년 전 조회 1,636
14년 전 조회 954
14년 전 조회 1,479
14년 전 조회 846
14년 전 조회 940
14년 전 조회 6,932
14년 전 조회 2,296
14년 전 조회 1,942
14년 전 조회 972
14년 전 조회 1,265
14년 전 조회 1,111
14년 전 조회 1,766
14년 전 조회 1,520
14년 전 조회 1,075
14년 전 조회 915
14년 전 조회 4,358
14년 전 조회 2,722
14년 전 조회 1,043
14년 전 조회 728
14년 전 조회 1,360
14년 전 조회 1,647
14년 전 조회 1,407
14년 전 조회 833
14년 전 조회 1,835
14년 전 조회 3,149
14년 전 조회 1,301
14년 전 조회 1,224
14년 전 조회 1,041
15년 전 조회 859
15년 전 조회 702
15년 전 조회 785
15년 전 조회 1,952
15년 전 조회 1,026
15년 전 조회 1,379
15년 전 조회 3,552
15년 전 조회 1,284
15년 전 조회 1,426
15년 전 조회 1,144
15년 전 조회 1,143
15년 전 조회 1,725
15년 전 조회 1,495
15년 전 조회 1,048
15년 전 조회 1,412
15년 전 조회 1,388
15년 전 조회 1,568
15년 전 조회 1,391
15년 전 조회 1,186
15년 전 조회 1,770
15년 전 조회 1,036
15년 전 조회 993
15년 전 조회 973
15년 전 조회 1,133
15년 전 조회 1,430
15년 전 조회 1,205
15년 전 조회 1,505
15년 전 조회 1,400
15년 전 조회 3,931
15년 전 조회 1,647
15년 전 조회 1,185
15년 전 조회 1,262
15년 전 조회 3,964
15년 전 조회 1,839
15년 전 조회 998
15년 전 조회 1,413
15년 전 조회 895
15년 전 조회 1,484