RPM 설치 및 설치확인 for Linux

확인을 하시려면 (레드햇 리눅스 기준 설명 입니다.)

# rpm -qi httpd -> apache 가 rpm 으로 설정 되었는지 확인

# rpm -qi php -> php 가 설치 되었는지 확인

# rpm -qi mysql -> mysql 이 설치 되었는지 확인



위의 명령으로 확인하시면 설치가 되어 있으면 버젼과 몇가지 정보를 보여줍니다.

설치가 안되어 있으시면 소스를 컴파일 하시는 방법과 RPM 패키지를 설치 하시는 방법이 있습니다.



RPM 은 설치 CD 에 보시면

httpd- 로 시작하는 웹서버 가 있습니다.

# rpm -ivh http-version.rpm 으로 설치

php- 로 시작하는 php 를 설치 합니다.

# rpm -ivh php-version.rpm

mysql- 로 시작하는 mysqler server

# rpm -ivh mysql-version.rpm



설치 완료후

# /etc/rc.d/init.d/httpd start

-> 웹서버를 시작 합니다.

# /etc/rc.d/init.d/mysqld start

-> mysql 을 시작 합니다.



http://서버IP 하시서 아파치 안내 화면 나오면 정상 입니다.

php 확인은

# vi test.php


phpinfo();

?>

를 웹서버의 웹페이지 디렉토리 아래에 만드시고 http://서버ip/test.php 하시면 됩니다.

(RPM 설치의 웹디렉토리는 /var/www 인것으로 기억합니다.)

(서버마다 약간 차이가 있을수 있습니다. httpd.conf 에 DocumentRoot 를 확인하시면 정확한 위치를 확인 하실 수 있습니다.)

## MySQL 설치

[root@localhost ~]# yum install mysql mysql-* -y

[root@localhost ~]# /etc/init.d/mysqld start
MySQL 데이타베이스를 초기




/**
* Centos 5.2 설치
**/

package Group..
- Editors
- Engineering and Scientific
- Development Tools
- Administration Tools
- System Tools

주의 : selinux 와 iptables 는 모두 꺼둔다.

/**
* mysql 설치
* 버젼 : mysql6.0.6 i686
**/

mysql 을 tar xzvf 로 푼다
압축을 푼 mysql 을 /usr/local/ 로 이동을 하되 디렉토리 명을 mysql 로 변경한다. mv ./mysql-6.~~ /usr/local/mysql
cd /usr/local 로 이동
chown -R root:root mysql 로 권한 유져 및 그룹을 root 로 준다
cd mysql
./scripts/mysql_install_db --user=mysql 명령어로 data 를 생성한다.
chown -R mysql:mysql data 로 권한 유져 및 그룹을 mysql 로 바꿔 준다
cp ./support-files/mysql.server /etc/rc.d/init.d/mysql 복사
vi /etc/rc.d/init.d/mysql 을 연다
basedir=/usr/local/mysql 로 기본 설정이 되어 있다.
datadir=/usr/local/mysql/data 로 기본 설정이 되어 있다.
바이너리 설치 경로가 다르다면 변경 해야 한다.
/etc/rc.d/init.d/mysql start 를 한다
./bin/mysqladmin -uroot password 'slrlal' 로 비밀번호를 설정 해 준다.(난 테스트 섭은 slrlal로 한다)

위 mysql 바이너리 설치는 6.x대가 아니라도 설치 가능하다.

./bin/mysql -uroot 엔터로 mysql 에 잘 접속 되는지 확인해 보자..잘되면 오케이~~~


/**
* apache 설치
* 버젼 : httpd-2.2.9
**/

접속자 수 최대로 올리기
# vi server/mpm/prefork/prefork.c
[EDITOR]#define DEFAULT_SERVER_LIMIT 256 을
[EDITOR]#define DEFAULT_SERVER_LIMIT 1280 으로 수정
저장하고 아웃
# vi server/mpm/worker/worker.c
[EDITOR]#define DEFAULT_SERVER_LIMIT 16 을
[EDITOR]#define DEFAULT_SERVER_LIMIT 20 으로 수정
저장하고 아웃
./configure --prefix=/usr/local/apache2 --enable-so --enable-modules=so --with-mpm=worker --enable-rewrite
make && make install
(머야??이건 뭐 다를바가 없네..ㅇ_ㅇ;;)


/**
* php 설치
* 버젼 : php-5.2.6
**/

최초 설치 yum install php

버전 업데이트는 다음 3줄을 각각 실행

wget http://dev.centos.org/centos/5/CentOS-Testing.repo
mv CentOS-Testing.repo /etc/yum.repos.d/
yum --enablerepo=c5-testing update php

서버 운영중 추가 설치

오류 메세지 : configure: error: xml2-config not found. Please check your libxml2 installation
해결 방법 : yum install libxml2 libxml2-devel -y

오류 메세지 : configure: error: Cannot find OpenSSL's
해결 방법 : yum -y install openssl-devel

오류 메세지 : configure: error: Please reinstall the BZip2 distribution
해결 방법 : yum -y install bzip2-devel

오류 메세지 : configure: error: libjpeg.(a|so) not found.
해결 방법 : yum -y install libjpeg-devel

오류 메세지 : configure: error: libpng.(a|so) not found.
해결 방법 : yum -y install libpng-devel

오류 메세지 : configure: error: freetype.h not found.
해결 방법 : yum -y install freetype-devel

오류 메세지 : configure: error: utf8_mime2text() has new signature, but U8T_CANONICAL is missing. This should not happen. Check config.log for additional information.
해결 방법 : yum -y install libc-client-devel

./configure --enable-bcmath --enable-ftp --enable-filepro --enable-libxml2 --enable-memory-limit --enable-sockets --enable-spl --enable-sysvsem --enable-sysvshm --enable-track-vars --enable-versioning --enable-wddx --disable-cli --disable-debug --disable-dmalloc --disable-posix --disable-rpath --with-apxs2=/usr/local/apache2/bin/apxs --with-bz2 --with-freetype-dir --with-gd --with-gettext --with-imap=shared --with-jpeg-dir --with-kerberos --with-libxml-dir --with-mod-charset --with-mysql=/usr/local/mysql --with-png-dir --with-ttf --with-zlib --with-imap-ssl=/usr/lib --with-openssl


/**
* httpd.conf 설정
**/

cd /usr/local/apache2/conf/extra/
vi httpd-default.conf 를 열어

KeepAlive On
KeepAliveTimeout 2
Timeout 30
수정

vi httpd-mpm.conf 를 열어

StartServers 20
MaxClients 500
MinSpareThreads 25
MaxSpareThreads 500
ThreadsPerChild 25
MaxRequestsPerChild 0

수정

vi httpd.vhosts.conf 를 열어

AddType application/x-httpd-php .php .html .inc .htm
ServerAdmin 관리자 이메일
DocumentRoot 최초 접속할 디렉토리 경로 예)"/home/test"
ServerName 도메인 또는 IP
# php_admin_value auto_prepend_file /home/test/move_url/move_page.html
# RewriteEngine on
# RewriteRule ^/([a-zA-Z0-9]+)$ /home/test/rewrite.html?rewrite=$i
php_admin_flag register_globals On


cd ..
vi httpd.conf
ServerName *:80 으로 변경

DirectoryIndex index.html //index.php 추가

Include conf/extra/httpd-mpm.conf 앞에 # 주석 삭제
Include conf/extra/httpd-vhosts.conf 앞에 # 주석 삭제
Include conf/extra/httpd-default.conf 앞에 # 주석 삭제
#Include conf/extra/httpd-userdir.conf 아래쪽에

Order allow,deny
Allow from all

추가

VirtureHost 에서 지정해 놓은 디렉토리 경로로 이동한 다음 index.html 을 vi 로 만들고 명령어로 php 가 잘 설치 되었는지 확인하면 끝입니다.

vi /etc/sysconfig/i18n 을 열어 모두 삭제한 뒤
LANG="ko_KR,eucKR"
SUPPORTED="ko_KR,UTF-8:ko_KR:ko"
SYSFONT="latarcyrhed-sun16"
를 입력 하고
source /etc/sysconfig/i18n 실행 한다. (vi에서 한글이 깨져 보이기 때문에 설정)

모든 파일 에디터 작업시 vi로 여는거 보단 vim 으로 파일을 열어서 수정