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년 전 조회 1,044
14년 전 조회 1,767
14년 전 조회 1,774
14년 전 조회 733
14년 전 조회 753
14년 전 조회 3,185
14년 전 조회 2,117
14년 전 조회 1,237
14년 전 조회 756
14년 전 조회 748
14년 전 조회 1,222
14년 전 조회 1,511
14년 전 조회 1,385
14년 전 조회 1,166
14년 전 조회 1,435
14년 전 조회 1,157
14년 전 조회 1,690
14년 전 조회 726
14년 전 조회 1,096
14년 전 조회 726
14년 전 조회 1,187
14년 전 조회 779
14년 전 조회 1,063
14년 전 조회 789
14년 전 조회 1,036
14년 전 조회 1,311
14년 전 조회 2,816
14년 전 조회 1,133
14년 전 조회 4,519
14년 전 조회 2,011
14년 전 조회 1,314
14년 전 조회 1,549
14년 전 조회 1,428
14년 전 조회 1,810
14년 전 조회 1,725
14년 전 조회 1,037
14년 전 조회 1,562
14년 전 조회 926
14년 전 조회 1,035
14년 전 조회 7,017
14년 전 조회 2,386
14년 전 조회 2,025
14년 전 조회 1,056
14년 전 조회 1,345
14년 전 조회 1,197
14년 전 조회 1,857
15년 전 조회 1,609
15년 전 조회 1,155
15년 전 조회 994
15년 전 조회 4,437
15년 전 조회 2,811
15년 전 조회 1,144
15년 전 조회 815
15년 전 조회 1,442
15년 전 조회 1,737
15년 전 조회 1,488
15년 전 조회 916
15년 전 조회 1,922
15년 전 조회 3,228
15년 전 조회 1,391
15년 전 조회 1,309
15년 전 조회 1,122
15년 전 조회 944
15년 전 조회 784
15년 전 조회 863
15년 전 조회 2,032
15년 전 조회 1,095
15년 전 조회 1,458
15년 전 조회 3,643
15년 전 조회 1,362
15년 전 조회 1,519
15년 전 조회 1,232
15년 전 조회 1,220
15년 전 조회 1,815
15년 전 조회 1,586
15년 전 조회 1,140
15년 전 조회 1,485
15년 전 조회 1,471
15년 전 조회 1,648
15년 전 조회 1,479
15년 전 조회 1,278
15년 전 조회 1,864
15년 전 조회 1,132
15년 전 조회 1,089
15년 전 조회 1,052
15년 전 조회 1,210
15년 전 조회 1,513
15년 전 조회 1,287
15년 전 조회 1,592
15년 전 조회 1,491
15년 전 조회 4,021
15년 전 조회 1,732
15년 전 조회 1,263
15년 전 조회 1,357
15년 전 조회 4,048
15년 전 조회 1,917
15년 전 조회 1,084
15년 전 조회 1,487
15년 전 조회 991
15년 전 조회 1,567