여기는 저의 2004~2007년까지의 기록입니다. 이 블로그는 이제 Tistory로 옮겼습니다.
2008년부터의 기록은 http://blog.studioego.info 로 가시기 바랍니다.

StudioEgo's Thoughts, seasonⅡ


APM(Apache+PHP+MySQL최신버전 설치 (작성중)
sungdh86@sungdh86-laptop:~$ sudo ssh 203.249.75.40
Password:
The authenticity of host '203.249.75.40 (203.249.75.40)' can't be established.
RSA key fingerprint is d4:4d:3d:9a:a3:50:24:93:b6:3a:7c:db:e3:8e:4b:e6.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '203.249.75.40' (RSA) to the list of known hosts.
root@203.249.75.40's password:
Last login: Tue Sep 5 19:40:01 2006
Welcome to P.C.R.C. Server!!!
Personal Computer Reserch Club(http://pcrc.hongik.ac.kr)
Please, Be careful your data!
[root@pcrc ~]#


RPM으로 설치된 APM(Apache, PHP, MySQL 제거를 했습니다.
MySQL제거
[root@pcrc ~]# rpm -qa |grep mysql
mysql-connector-odbc-3.51.12-1.2.1
mysql-5.0.18-2.1
libdbi-dbd-mysql-0.8.1a-1.2.1
[root@pcrc ~]# rpm -e mysql-5.0.18-2.1
오류: Failed dependencies:
libmysqlclient.so.15 is needed by (installed) perl-DBD-MySQL-3.0002-2.2.2.i386
libmysqlclient.so.15 is needed by (installed) mysql-connector-odbc-3.51.12-1.2.1.i386
libmysqlclient.so.15 is needed by (installed) libdbi-dbd-mysql-0.8.1a-1.2.1.i386
libmysqlclient.so.15 is needed by (installed) dovecot-1.0-0.beta2.7.i386 libmysqlclient_r.so.15 is needed by (installed) MySQL-python-1.2.0-3.2.2.i386
libmysqlclient_r.so.15 is needed by (installed) mysql-connector-odbc-3.51.12-1.2.1.i386
mysql is needed by (installed) MySQL-python-1.2.0-3.2.2.i386
mysql is needed by (installed) libdbi-dbd-mysql-0.8.1a-1.2.1.i386
[root@pcrc ~]# rpm -e mysql-5.0.18-2.1 --nodeps
[root@pcrc ~]#

Apache제거
[root@pcrc ~]# rpm -qa | grep httpd
httpd-manual-2.2.0-5.1.2
system-config-httpd-1.3.3-1.1
httpd-2.2.0-5.1.2
[root@pcrc ~]# rpm -e httpd-2.2.0-5.12
오류: httpd-2.2.0-5.12 패키지가 설치되어 있지 않습니다
[root@pcrc ~]# rpm -e httpd-2.2.0-5.1.2
오류: Failed dependencies:
httpd-mmn = 20051115 is needed by (installed) mod_perl-2.0.2-5.1.i386
httpd-mmn = 20051115 is needed by (installed) mod_ssl-2.2.0-5.1.2.i386
httpd-mmn = 20051115 is needed by (installed) mod_python-3.2.8-3.i386
webserver is needed by (installed) webalizer-2.01_10-29.2.1.i386
httpd = 0:2.2.0-5.1.2 is needed by (installed) mod_ssl-2.2.0-5.1.2.i386
httpd >= 2.0.40 is needed by (installed) mod_python-3.2.8-3.i386
httpd = 2.2.0-5.1.2 is needed by (installed) httpd-manual-2.2.0-5.1.2.i386
httpd >= 2.2.0 is needed by (installed) gnome-user-share-0.9-3.i386
httpd is needed by (installed) system-config-httpd-1.3.3-1.1.noarch
[root@pcrc ~]# rpm -e httpd-manual-2.2.0-5.1.2
[root@pcrc ~]# rpm -e httpd-2.2.0-5.1.2 --nodeps
[root@pcrc ~]#

PHP제거
[root@pcrc ~]# rpm -qa | grep php
php-ldap-5.1.2-5
php-pear-1.4.6-2
[root@pcrc ~]# rpm -e php-ldap-5.1.2-5
[root@pcrc ~]# rpm -e php-pear-1.4.6-2
[root@pcrc ~]#


MySQL 컴파일 파일 압축 다운로드 받기
여기서는 MySQL를 설치하기 전에 glibc버전을 확인한다.
그 이유는 MySQL을 소스로 컴파일 할때 최적의 상태로 쓰기 위해선 glibc버전이 맞아야 한다.
[root@pcrc ~]# rpm -qa | grep glibc
glibc-common-2.4-4
glibc-2.4-4
glibc-kernheaders-3.0-5.2
glibc-headers-2.4-4
glibc-devel-2.4-4
[root@pcrc ~]#

[root@pcrc ~]# wget http://dev.mysql.com/get/Downloads/MySQL-4.1/mysql-standard-4.1.21-pc-linux-gnu-i686.tar.gz/from/ftp://mysql.byungsoo.net/pub/mysql/
--22:08:09-- http://dev.mysql.com/get/Downloads/MySQL-4.1/mysql-standard-4.1.21-pc-linux-gnu-i686.tar.gz/from/ftp://mysql.byungsoo.net/pub/mysql/
=> `index.html'
Resolving dev.mysql.com... 213.115.162.29, 213.115.162.82, 213.136.52.29, ...
Connecting to dev.mysql.com|213.115.162.29|:80... connected.
HTTP request sent, awaiting response... 302 Found
Location: ftp://mysql.byungsoo.net/pub/mysql/Downloads/MySQL-4.1/mysql-standard-4.1.21-pc-linux-gnu-i686.tar.gz [following]
--22:08:11-- ftp://mysql.byungsoo.net/pub/mysql/Downloads/MySQL-4.1/mysql-standard-4.1.21-pc-linux-gnu-i686.tar.gz
=> `mysql-standard-4.1.21-pc-linux-gnu-i686.tar.gz'
Resolving mysql.byungsoo.net... 218.234.17.87
Connecting to mysql.byungsoo.net|218.234.17.87|:21... connected.
Logging in as anonymous ... Logged in!
==> SYST ... done. ==> PWD ... done.
==> TYPE I ... done. ==> CWD /pub/mysql/Downloads/MySQL-4.1 ... done.
==> PASV ... done. ==> RETR mysql-standard-4.1.21-pc-linux-gnu-i686.tar.gz ... done.
Length: 50,477,915 (48M) (unauthoritative)

100%[====================================>] 50,477,915 9.12M/s ETA 00:00

22:08:20 (9.31 MB/s) - `mysql-standard-4.1.21-pc-linux-gnu-i686.tar.gz' saved [50477915]

[root@pcrc ~]#

Apache 컴파일 파일 압축 다운로드 받기
[root@pcrc ~]# wget http://mirror.apache.or.kr/httpd/httpd-2.0.59.tar.gz
--21:57:36-- http://mirror.apache.or.kr/httpd/httpd-2.0.59.tar.gz
=> `httpd-2.0.59.tar.gz'
Resolving mirror.apache.or.kr... 211.53.110.2
Connecting to mirror.apache.or.kr|211.53.110.2|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 6,122,149 (5.8M) [application/x-gzip]

100%[====================================>] 6,122,149 1.14M/s ETA 00:00

21:57:41 (1.14 MB/s) - `httpd-2.0.59.tar.gz' saved [6122149/6122149]

[root@pcrc ~]#

PHP 컴파일 파일 압축 다운로드 받기
http://www.php.net/downloads.php에서 다운로드를 받았다.
[root@pcrc ~]# wget http://kr2.php.net/get/php-5.1.6.tar.gz/from/kr.php.net/mirror
--22:10:17-- http://kr2.php.net/get/php-5.1.6.tar.gz/from/kr.php.net/mirror
=> `mirror'
Resolving kr2.php.net... 211.43.210.124
Connecting to kr2.php.net|211.43.210.124|:80... connected.
HTTP request sent, awaiting response... 302 Found
Location: http://kr.php.net/distributions/php-5.1.6.tar.gz [following]
--22:10:22-- http://kr.php.net/distributions/php-5.1.6.tar.gz
=> `php-5.1.6.tar.gz'
Resolving kr.php.net... 222.122.132.215
Connecting to kr.php.net|222.122.132.215|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 8,187,896 (7.8M) [application/x-gzip]

100%[====================================>] 8,187,896 3.76M/s

22:10:29 (3.75 MB/s) - `php-5.1.6.tar.gz' saved [8187896/8187896]

[root@pcrc ~]#


우선 MySQL를 설치를 하기로 하였다.
그다음 Apache, PHP를 깔기로 하였다. zlib, gd는 PHP를 깔고 나서 깔기로 하였다.
압축된 MySQL파일을 풀기
[root@pcrc ~]# tar xvfz mysql-standard-4.1.21-pc-linux-gnu-i686.tar.gz -C /home1

./configure 명령을 실행하여 컴파일 환경을 설정한다.
[root@pcrc mysql-standard-4.1.21-pc-linux-gnu-i686]# ./configure --prefix=/usr/local/mysql --localstatedir=/var/lib/mysql --with-charset=euckr --with-mysql-user=mysql --sysconfdir=/etc
NOTE: This is a MySQL binary distribution. It's ready to run, you don't
need to configure it!

To help you a bit, I am now going to create the needed MySQL databases
and start the MySQL server for you. If you run into any trouble, please
consult the MySQL manual, that you can find in the Docs directory.

Installing all prepared tables
Fill help tables

To start mysqld at boot time you have to copy support-files/mysql.server
to the right place for your system

PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
To do so, start the server, then issue the following commands:
./bin/mysqladmin -u root password 'new-password'
./bin/mysqladmin -u root -h pcrc.hongik.ac.kr password 'new-password'
See the manual for more instructions.

NOTE: If you are upgrading from a MySQL <= 3.22.10 you should run
the ./bin/mysql_fix_privilege_tables. Otherwise you will not be
able to use the new GRANT command!

You can start the MySQL daemon with:
cd . ; ./bin/mysqld_safe &

You can test the MySQL daemon with the benchmarks in the 'sql-bench' directory:
cd sql-bench ; perl run-all-tests

Please report any problems with the ./bin/mysqlbug script!

The latest information about MySQL is available on the web at
http://www.mysql.com
Support MySQL by buying support/licenses at http://shop.mysql.com
Starting the mysqld server. You can test that it is up and running
with the command:
./bin/mysqladmin version
[root@pcrc mysql-standard-4.1.21-pc-linux-gnu-i686]# chown: `mysql': 잘못된 사용자
Starting mysqld daemon with databases from /home1/mysql-standard-4.1.21-pc-linux-gnu-i686/data
STOPPING server from pid file /home1/mysql-standard-4.1.21-pc-linux-gnu-i686/data/pcrc.hongik.ac.kr.pid
060905 23:01:05 mysqld ended


[root@pcrc mysql-standard-4.1.21-pc-linux-gnu-i686]#

MySQL 설치도중 이 문제가 생겨서 큰일이 일어났다.
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (111)

이 문제를 해결하는 방법
user를 추가해주시고요
#groupadd mysql
#useradd -g mysql mysql

그리고 나서 mysql의 데이타가 들어있는 디렉토리를 수정해주세요
#chown -R root "mysql 디렉토리"
#chown -R mysql "mysql의 데이타가 들어있는 디렉토리"
#chgrp -R mysql "mysql 디렉토리"

make명령을 실향하여 MySQL를 컴파일함
[root@pcrc mysql-standard-4.1.21-pc-linux-gnu-i686]# make
# make install


그리고 나서 소프트 링크를 해준다.
# ln -s /tmp/mysql.sock /var/lib/mysql/mysql.sock
# ln -s /usr/local/mysql/bin/mysql /usr/bin/mysql

압축된 Apache파일을 풀기
[root@pcrc ~]# tar xvfz httpd-2.0.59.tar.gz -C /home1

./configure 명령으로 다음과 같이 컴파일 환경을 설정한다.
[root@pcrc httpd-2.0.59]# ./configure --prefix=/usr/local/apache2 --enable-mods-shared=all --with-mpm=worker --enable-ssl --with-ssl --enable-so

make 명령으로 컴파일 한다. 오류 없이 컴파일이 끝나면 make install 명령을 실행하여 컴파일 환경시 --prefix= 옵션으로 지정된 위치로 컴파일 파일들이 설치되도록 한다
[root@pcrc httpd-2.0.59]# make
[root@pcrc httpd-2.0.59]# make install

/etc/ld.so.conf 파일에 /usr/local/apache2/lib과 /usr/local/apache2/modules 경로를 다음과 같이 추가한 후 ldconfig명령을 실행한다.
vi /etc/ld.so.conf

/usr/local/apache2/lib
/usr/local/apache2/modules

# ldconfig

압축된 PHP파일을 풀기
[root@pcrc ~]# tar xvfz php-5.1.6.tar.gz -C /home1

출처 :http://netsystem.dnip.net/board4/bbs/board.php?bo_table=linux&wr_id=3
PHP깔기전에 설치 먼저 할 것이 있다.
[root@pcrc ~]# wget http://ftp.superuser.co.kr/pub/etc/libpng-1.2.5.tar.gz
--02:12:26-- http://ftp.superuser.co.kr/pub/etc/libpng-1.2.5.tar.gz
=> `libpng-1.2.5.tar.gz'
Resolving ftp.superuser.co.kr... 222.97.189.5
Connecting to ftp.superuser.co.kr|222.97.189.5|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 505,988 (494K) [application/x-tar]

100%[====================================>] 505,988 3.12M/s

02:12:26 (3.10 MB/s) - `libpng-1.2.5.tar.gz' saved [505988/505988]

[root@pcrc ~]# wget http://ftp.superuser.co.kr/pub/etc/freetype-2.1.5.tar.gz
--02:12:33-- http://ftp.superuser.co.kr/pub/etc/freetype-2.1.5.tar.gz
=> `freetype-2.1.5.tar.gz'
Resolving ftp.superuser.co.kr... 222.97.189.5
Connecting to ftp.superuser.co.kr|222.97.189.5|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 1,127,474 (1.1M) [application/x-tar]

100%[====================================>] 1,127,474 3.27M/s

02:12:34 (3.26 MB/s) - `freetype-2.1.5.tar.gz' saved [1127474/1127474]

[root@pcrc ~]# wget http://ftp.superuser.co.kr/pub/etc/jpegsrc.v6b.tar.gz
--02:12:39-- http://ftp.superuser.co.kr/pub/etc/jpegsrc.v6b.tar.gz
=> `jpegsrc.v6b.tar.gz'
Resolving ftp.superuser.co.kr... 222.97.189.5
Connecting to ftp.superuser.co.kr|222.97.189.5|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 613,261 (599K) [application/x-tar]

100%[====================================>] 613,261 3.20M/s

02:12:40 (3.18 MB/s) - `jpegsrc.v6b.tar.gz' saved [613261/613261]

[root@pcrc ~]# rpm -qa | grep libpng
libpng-1.2.8-2.2.1
libpng-devel-1.2.8-2.2.1
[root@pcrc ~]# rpm -qa | grep freetype
freetype-2.1.10-5.2.1
freetype-devel-2.1.10-5.2.1
[root@pcrc ~]# rpm -qa | grep libjpeg
libjpeg-devel-6b-36.2.1
libjpeg-6b-36.2.1
[root@pcrc ~]# rpm -e --nodeps libpng-1.2.8-2.2.1 freetype-2.1.10-5.2.1 libjpeg-6b-36.2.1
[root@pcrc ~]#
by Ego君 | 2006/09/05 22:17 | 리눅스 | 트랙백 | 덧글(4)
트랙백 주소 : http://sungdh86.egloos.com/tb/2677729
☞ 내 이글루에 이 글과 관련된 글 쓰기 (트랙백 보내기) [도움말]
Commented by 정태영 at 2006/09/07 02:05
흠... 이런 소리 하면 약간 기분 나쁠 지는 모르겠지만, pcrc 에는 리눅스를 "제대로" 쓰는 사람이 별로 없나요?

1. libjpeg, libpng 이런 것들은 관리하기에도 그렇고 보안상으로도 그렇고 그냥 있는 패키지 쓰는 게 유리합니다. (기본으로 있는 패키지들을 쓰면서 yum 등을 이용해서 최신 버젼으로 유지시키세요.) freetype 의 경우는 바이트코드 인터프리터가 특허에 걸려서 레드햇 등의 배포판에선 기본으로 적용이 되지 않기 때문에 "관련 옵션을 넣고" 빌드를 할 경우 약간의 향상이 있을 수 있습니다. 하지만 이것도 그냥 소스를 가져다가 수동으로 빌드하는 게 옳다는 얘기는 아닙니다. (해보고 싶으시다면 src.rpm 을 이용하세요.)
2. Mysql 은 소스코드를 가져다가 빌드해서 얻을 수 있는 게 많지 않습니다. 기본으로 설치된 것을 사용하고 language 관련된 설정들은 my.cnf 에서 풀어나가세요. (innodb 나 berkley db 를 써보고 싶었던 게 아니라면)
Commented by 정태영 at 2006/09/07 02:05

3. /tmp/mysql.sock 문제는 심볼릭 링크가 아니라 my.cnf 로 풀어야 합니다. tmpwatch 가 심볼릭링크를 언제 제거할 지 모릅니다.
4. php 의 경우 기본으로 enable/disable 된 기능들 중 맘에 안드는 게 있으면 src.rpm 을 가져다가 spec 파일을 고치고 리빌드 하세요.
5. --nodeps 옵션으로 패키지를 제거하는 건 저렇게 함부로 하면 안됩니다. 위에서 의미없이 던진 명령어들로 인해 perl, python 등에선 mysql 을 사용할 수 없도록 만들었습니다. 의존성 체크라는 게 어찌보면 불편해보일 수 있지만 다 의미가 있어서 존재하는 기능입니다.

소스를 가져다가 수동으로 빌드한다고 좋아지는 건 없습니다. 정말 써보고 싶은 기능들이 있는데 그게 기본 패키지에서 지원하지 않는 경우라면 src.rpm 을 가져다가 spec 파일을 고치고 rpmbuild 를 이용해서 패키지를 만든 다음에 사용하세요.

그리고 정말 빌드를 해서 설치하고 싶다면 젠투를 설치하시기 바랍니다.
Commented by Ego君 at 2006/09/07 02:31
정태영 // 제대로 쓰시는 분들은 다 졸업하셨습니다-_-;; 남아있는 사람들은 이 쪽에 하나도 관심도 없고 영상처리, 컴퓨터 그래픽스쪽만 사람들이 관심이 있어서 걱정이 태산이네요.
조언 감사드립니다 :D
Commented by cypher at 2006/09/11 20:46
정태영님의 의견에 한표 추가. 소스로 컴파일해서 설치했을 경우..나중에 시간이 지나면 주체를 할 수 없더군요. -_-; 전 무조건 패키지로, 필요할 경우 리빌드를, 아예 없으면 패키지를 빌드해서 설치합니다.

:         :

:

비공개 덧글

< 이전페이지 다음페이지 >