rpm으로 설치 mysql, php, httpd를 삭제
mysql-5.0.22-2.2.el5_1.1 <-- 설치되어 있음
[root@localhost]# rpm -qa httpd
[root@localhost]# rpm -qa php
rpm으로 설치된 mysql, php, httpd 가 있다면 삭제
[root@localhost]# rpm -e --nodeps php
[root@localhost]# rpm -e --nodeps httpd
mysql 다운로드
--23:25:16-- ftp://ftp.superuser.co.kr/mysql/mysql-5.0.37.tar.gz
=> `/tmp/mysql-5.0.37.tar.gz'
Resolving ftp.superuser.co.kr... 210.127.253.100
Connecting to ftp.superuser.co.kr|210.127.253.100|:21... connected.
Logging in as anonymous ... Logged in!
==> SYST ... done. ==> PWD ... done.
==> TYPE I ... done. ==> CWD /mysql ... done.
==> SIZE mysql-5.0.37.tar.gz ... 23239518
==> PASV ... done. ==> RETR mysql-5.0.37.tar.gz ... done.
Length: 23239518 (22M)
apache 다운로드
--23:37:00-- ftp://ftp.superuser.co.kr/apache/httpd-2.2.2.tar.gz
=> `/tmp/httpd-2.2.2.tar.gz'
Resolving ftp.superuser.co.kr... 210.127.253.100
Connecting to ftp.superuser.co.kr|210.127.253.100|:21... connected.
Logging in as anonymous ... Logged in!
==> SYST ... done. ==> PWD ... done.
==> TYPE I ... done. ==> CWD /apache ... done.
==> SIZE httpd-2.2.2.tar.gz ... 6282043
==> PASV ... done. ==> RETR httpd-2.2.2.tar.gz ... done.
Length: 6282043 (6.0M)
php 다운로드
--23:38:15-- ftp://ftp.superuser.co.kr/php/php-5.2.5.tar.gz
=> `/tmp/php-5.2.5.tar.gz'
Resolving ftp.superuser.co.kr... 210.127.253.100
Connecting to ftp.superuser.co.kr|210.127.253.100|:21... connected.
Logging in as anonymous ... Logged in!
==> SYST ... done. ==> PWD ... done.
==> TYPE I ... done. ==> CWD /php ... done.
==> SIZE php-5.2.5.tar.gz ... 9972372
==> PASV ... done. ==> RETR php-5.2.5.tar.gz ... done.
Length: 9972372 (9.5M)
zendoptimizer 다운로드
--23:40:46-- ftp://ftp.superuser.co.kr/ZendOptimizer/ZendOptimizer-3.0.1-linux-glibc21-i386.tar.gz
=> `/tmp/ZendOptimizer-3.0.1-linux-glibc21-i386.tar.gz'
Resolving ftp.superuser.co.kr... 210.127.253.100
Connecting to ftp.superuser.co.kr|210.127.253.100|:21... connected.
Logging in as anonymous ... Logged in!
==> SYST ... done. ==> PWD ... done.
==> TYPE I ... done. ==> CWD /ZendOptimizer ... done.
==> SIZE ZendOptimizer-3.0.1-linux-glibc21-i386.tar.gz ... 6358090
==> PASV ... done. ==> RETR ZendOptimizer-3.0.1-linux-glibc21-i386.tar.gz ... done.
Length: 6358090 (6.1M)
2. 압축풀기
[root@localhost ~]# tar xvf httpd-2.2.2.tar.gz
[root@localhost ~]# tar xvf php-5.2.5.tar.gz
3. 부가 프로그램 확인 및 설치
yum install gcc
yum install gcc-c++
yum install termcap
yum install libtermcap
yum install libtermcap-devel
yum install gdbm-devel
yum install zlib*
yum install libxml*
yum install freetype*
yum install libpng*
yum install libjpeg*
yum install iconv
4. Mysql 설치
mysql 유저 생성 및 설치
[root@localhot mysql-5.0.37~]# ./configure --prefix=/usr/local/mysql --localstatedir=/usr/local/mysql/data --with-charset=utf8 --with-extra-charsets=all --enable-thread-safe-client
--enable-thread-safe-client 는 mysqli를 위한 옵션
[root@localhot mysql-5.0.37~]# make
[root@localhot mysql-5.0.37~]# make install
mysql 설정
/tmp/mysql-5.0.37
[root@localhost mysql-5.0.37]# cp support-files/my-huge.cnf /etc/my.cnf
[root@localhost mysql-5.0.37]# cp support-files/mysql.server /etc/init.d/mysqld
[root@localhost mysql-5.0.37]#
[root@localhost mysql-5.0.37]# chmod 755 /etc/init.d/mysqld
[root@localhost mysql-5.0.37]# chkconfig --add mysqld
[root@localhost mysql-5.0.37]# chkconfig --list mysqld
mysqld 0:해제 1:해제 2:활성 3:활성 4:활성 5:활성 6:해제
[root@localhost mysql-5.0.37]# chkconfig --level 24 mysqld off
[root@localhost mysql-5.0.37]# chkconfig --list mysqld
mysqld 0:해제 1:해제 2:해제 3:활성 4:해제 5:활성 6:해제
[root@localhost mysql-5.0.37]# cd /usr/local/mysql/
[root@localhost mysql]# chown -R mysql .
[root@localhost mysql]# chgrp -R mysql .
[root@localhost mysql]# ./bin/mysql_install_db --user=mysql
Installing all prepared tables
Fill help tables
to the right place for your system
To do so, start the server, then issue the following commands:
/usr/local/mysql/bin/mysqladmin -u root password 'new-password'
/usr/local/mysql/bin/mysqladmin -u root -h localhost.localdomain password 'new-password'
See the manual for more instructions.
cd /usr/local/mysql ; /usr/local/mysql/bin/mysqld_safe &
cd sql-bench ; perl run-all-tests
http://www.mysql.com
Support MySQL by buying support/licenses at http://shop.mysql.com
[root@localhost mysql]# chown -R mysql .
[root@localhost mysql]# chgrp -R mysql .
[root@localhost mysql]# /etc/rc.d/init.d/mysqld start
Starting MySQL[ OK ]
[root@localhost mysql]# ./bin/mysql -uroot
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.0.37-log Source distribution
mysql >
mysql > exit;
mysql 설치시 이전의 데이타가 남아 있거나, 이미 실행이 되어 있는 경우 아래와 같이 에러가 난다.
./bin/mysql: error while loading shared libraries: libmysqlclient.so.15: cannot open shared object file: No such file or directory
이런 경우에는
mysql 이 실행되어 있다면 모두 종료하고
/etc/ld.so.conf 파일에 /usr/lib/mysql 을 추가하거나, 두 줄인 경우에는 한줄을 삭제하고
/sbin/ldconfig 을 실행한다.
[root@localhost mysql]# vi /etc/ld.so.conf
/usr/lib/mysql
/usr/lib/mysql <--- 삭제
[root@localhost mysql]# /sbin/ldconfig
./bin/mysql -uroot
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.0.37-log Source distribution
Bye
mysql 의 root 암호를 변경한다.
[root@localhost mysql]# ./bin/mysql -uroot -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 4
Server version: 5.0.37-log Source distribution
Query OK, 2 rows affected (0.00 sec)
mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)
mysql>exit;
[root@localhost mysql]#
5. Apache 설치
Apache 소스가 있는 곳으로 이동하여 Apache 설치
[root@localhost httpd-2.2.2]# make
[root@localhost httpd-2.2.2]# make install
아파치 설정 파일 복사 및 시작
[root@localhost httpd-2.2.2]# /etc/rc.d/init.d/apachectl start
6. php 설치
php 소스가 있는 곳으로 이동하여 php 설치
[root@localhost php-5.2.5]# make
[root@localhost php-5.2.5]# make install
[root@localhost php-5.2.5]# cp php.ini-dist /usr/local/php/lib/php.ini
php 설치시 에러가 발생하면 해당 모듈을 yum을 통해서 설치해 주면 된다.
7. ZendOptimizer 설치
zendOptimizer 소스 경로로 이동하여 설치
인스톨 화면에서 안내에 따라 php.ini 파일의 경로를 설정해 주면 자동으로 zendoptimizer가 설치된다.
8. Apache 및 PHP 설정
/usr/local/apache/conf/httpd.conf 파일과 /usr/local/php/lib/php.ini 파일은 사용자에 맞게 수정한다.