리눅스 관련팁 게시판입니다.
  • 웹미니 한줄 전광판 영역 입니다.
글 수 49

0

조회 수 : 6015 신고 : 0

작성자 : hhkwoong
포인트 : 282 | 레벨 : 1

오늘은 Linux (CentOS 5.3 64bit) 에서 APM 을 설치해 보도록 하겠습니다.
yum 을 이용한 간단한 설치도 있지만 Linux 버전에 따른 자동 설치 APM 들의 버전들이 다르기 때문에 직접 소스컴파일을 통한 원하는 버전 & 원하는 경로에 설치하여 보도록 하겠습니다.

자세한 설치 버전은 아래와 같습니다. (버전이 틀려도 설치 방법의 거의 비슷합니다.)

 CentOS 5.3 + Apache 2.2.13 + MySQL 4.0.27 + php 4.4.7 + Zend 3.3.3 + phpMyAdmin

설치 순서는 라이브러리설치 => MySQL => Apache => PHP => Zend => phpMyAdmin 순입니다.

1. 관련 라이브러리 확인 & 설치
- 아래 "yum install gcc gcc-c++ cpp-c++ compat-gcc-32-g77 flex libjpeg-devel libpng-devel freetype-devel gd-devel libmcrypt php-ncurses.x86_64 glibc-utils.x86_64 libtiff-devel curl libtermcap-devel" 라는 명령을 통하여 관련된 라이브러리와 하위 라이브러리까지 자동으로 설치를 합니다.

[root@cubetree apm]# yum install gcc gcc-c++ cpp-c++ compat-gcc-32-g77 flex libjpeg-devel libpng-devel freetype-devel gd-devel libmcrypt php-ncurses.x86_64 glibc-utils.x86_64 libtiff-devel curl libtermcap-devel
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: ftp.iij.ad.jp
 * updates: ftp.iij.ad.jp
 * addons: ftp.iij.ad.jp
 * extras: ftp.iij.ad.jp
Setting up Install Process
Parsing package install arguments
No package cpp-c++ available.
No package compat-gcc-32-g77 available.
Resolving Dependencies
--> Running transaction check
---> Package flex.x86_64 0:2.5.4a-41.fc6 set to be updated
---> Package libjpeg-devel.x86_64 0:6b-37 set to be updated
---> Package freetype-devel.x86_64 0:2.2.1-21.el5_3 set to be updated
--> Processing Dependency: zlib-devel for package: freetype-devel
---> Package freetype-devel.i386 0:2.2.1-21.el5_3 set to be updated
---> Package gd-devel.x86_64 0:2.0.33-9.4.el5_1.1 set to be updated
--> Processing Dependency: libXpm-devel for package: gd-devel
--> Processing Dependency: libX11-devel for package: gd-devel
--> Processing Dependency: fontconfig-devel for package: gd-devel
---> Package libpng-devel.x86_64 2:1.2.10-7.1.el5_3.2 set to be updated
---> Package libpng-devel.i386 2:1.2.10-7.1.el5_3.2 set to be updated
---> Package libjpeg-devel.i386 0:6b-37 set to be updated
---> Package gd-devel.i386 0:2.0.33-9.4.el5_1.1 set to be updated
--> Processing Dependency: libgd.so.2 for package: gd-devel
---> Package gcc.x86_64 0:4.1.2-44.el5 set to be updated
--> Processing Dependency: libgomp >= 4.1.2-44.el5 for package: gcc
--> Processing Dependency: glibc-devel >= 2.2.90-12 for package: gcc
---> Package libmcrypt.x86_64 0:2.5.8-4.el5.centos set to be updated
--> Running transaction check
---> Package libXpm-devel.x86_64 0:3.5.5-3 set to be updated
---> Package zlib-devel.x86_64 0:1.2.3-3 set to be updated
---> Package fontconfig-devel.x86_64 0:2.4.1-7.el5 set to be updated
---> Package glibc-devel.x86_64 0:2.5-34.el5_3.1 set to be updated
--> Processing Dependency: glibc-headers = 2.5-34.el5_3.1 for package: glibc-devel
--> Processing Dependency: glibc-headers for package: glibc-devel
---> Package gd.i386 0:2.0.33-9.4.el5_1.1 set to be updated
--> Processing Dependency: libXpm.so.4 for package: gd
---> Package libX11-devel.x86_64 0:1.0.3-9.el5 set to be updated
--> Processing Dependency: xorg-x11-proto-devel >= 7.1-2 for package: libX11-devel
--> Processing Dependency: libXau-devel for package: libX11-devel
--> Processing Dependency: libXdmcp-devel for package: libX11-devel
---> Package libgomp.x86_64 0:4.3.2-7.el5 set to be updated
--> Running transaction check
---> Package glibc-headers.x86_64 0:2.5-34.el5_3.1 set to be updated
--> Processing Dependency: kernel-headers >= 2.2.1 for package: glibc-headers
--> Processing Dependency: kernel-headers for package: glibc-headers
---> Package libXpm.i386 0:3.5.5-3 set to be updated
---> Package libXdmcp-devel.x86_64 0:1.0.1-2.1 set to be updated
---> Package xorg-x11-proto-devel.x86_64 0:7.1-9.el5.centos set to be updated
--> Processing Dependency: mesa-libGL-devel for package: xorg-x11-proto-devel
---> Package libXau-devel.x86_64 0:1.0.1-3.1 set to be updated
--> Running transaction check
---> Package mesa-libGL-devel.x86_64 0:6.5.1-7.7.el5 set to be updated
---> Package kernel-headers.x86_64 0:2.6.18-164.el5 set to be updated
--> Finished Dependency Resolution

Dependencies Resolved

생 략

Complete!
[root@cubetree apm]#



2. MySQL 설치

* 참고
- MySQL 설치시 LinuxThreads 에러가 나면서 configure 가 되지 않는 경우가 있습니다.
  echo "/* Linuxthreads */" >> /usr/include/pthread.h 명령을 통해서 해결하실 수 있습니다.


■ Configure
[root@cubetree mysql-4.0.27]# ./configure --prefix=/home/Product/mysql-4.0.27 --localstatedir=/home/Product/mysql-4.0.27/data --with-charset=euc_kr
(반드시 MySQL 4.0 이하에서는 charset 을 euc_kr 로 해주며, MySQL 4.1 이상부터는 euckr 혹은 utf8 로 설정합니다.)
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking target system type... x86_64-unknown-linux-gnu
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether to enable maintainer-specific portions of Makefiles... no
checking whether build environment is sane... yes
checking whether make sets $(MAKE)... (cached) yes
checking for gawk... (cached) gawk
checking for gcc... gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no

생 략

config.status: creating config.h
config.status: executing depfiles commands
config.status: executing default commands

MySQL has a Web site at http://www.mysql.com/ which carries details on the
latest release, upcoming features, and other information to make your
work or play with MySQL more productive. There you can also find
information about mailing lists for MySQL discussion.

Remember to check the platform specific part of the reference manual for
hints about installing MySQL on your platform. Also have a look at the
files in the Docs directory.

Thank you for choosing MySQL!

[root@cubetree mysql-4.0.27]#

■ Make / Make install
[root@cubetree mysql-4.0.27]# make
[root@cubetree mysql-4.0.27]# make install
(결과 생략)
[root@cubetree /]# cd /home/Product/
[root@cubetree Product]# ls
mysql-4.0.27
[root@cubetree Product]# cd mysql-4.0.27/
[root@cubetree mysql-4.0.27]# ls
bin  include  info  lib  libexec  man  mysql-test  share  sql-bench
[root@cubetree mysql-4.0.27]#

■ MySQL 구성파일 my.cnf 파일 복사
[root@cubetree mysql-4.0.27]# cd share/
[root@cubetree share]# ls
mysql
[root@cubetree share]# cd mysql/
[root@cubetree mysql]# ls
binary-configure  dutch     german     japanese         my-huge.cnf             my-small.cnf      norwegian-ny  russian  ukrainian
charsets          english   greek      korean           my-innodb-heavy-4G.cnf  mysql-log-rotate  polish        slovak
czech             estonian  hungarian  mi_test_all      my-large.cnf            mysql.server      portuguese    spanish
danish            french    italian    mi_test_all.res  my-medium.cnf           norwegian         romanian      swedish
[root@cubetree mysql]# cp my-large.cnf /etc/my.cnf
[root@cubetree mysql]#

■ MySQL 경로 심볼릭 링크 생성
[root@cubetree /]# ln -s /home/Product/mysql-4.0.27 /usr/local/mysql
[root@cubetree /]# cd  /usr/local/
[root@cubetree local]# ls
bin  etc  games  include  lib  lib64  libexec  mysql  sbin  share  src
[root@cubetree local]# ls -al
합계 96
drwxr-xr-x 12 root root 4096  9월 26 16:40 .
drwxr-xr-x 16 root root 4096  9월 25 15:18 ..
drwxr-xr-x  2 root root 4096  3월 12  2009 bin
drwxr-xr-x  2 root root 4096  3월 12  2009 etc
drwxr-xr-x  2 root root 4096  3월 12  2009 games
drwxr-xr-x  2 root root 4096  3월 12  2009 include
drwxr-xr-x  2 root root 4096  3월 12  2009 lib
drwxr-xr-x  2 root root 4096  3월 12  2009 lib64
drwxr-xr-x  2 root root 4096  3월 12  2009 libexec
lrwxrwxrwx  1 root root   26  9월 26 16:40 mysql -> /home/Product/mysql-4.0.27
drwxr-xr-x  2 root root 4096  3월 12  2009 sbin
drwxr-xr-x  4 root root 4096  9월 25 15:15 share
drwxr-xr-x  2 root root 4096  3월 12  2009 src
[root@cubetree local]#


■ MySQL 기본 데이터베이스 생성
[root@cubetree /]# /usr/local/mysql/bin/mysql_install_db
Preparing db table
Preparing host table
Preparing user table
Preparing func table
Preparing tables_priv table
Preparing columns_priv table
Installing all prepared tables
090926 16:42:30 /home/Product/mysql-4.0.27/libexec/mysqld: Shutdown Complete


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:
/home/Product/mysql-4.0.27/bin/mysqladmin -u root password 'new-password'
/home/Product/mysql-4.0.27/bin/mysqladmin -u root -h cubetree password 'new-password'
See the manual for more instructions.

You can start the MySQL daemon with:
cd /home/Product/mysql-4.0.27 ; /home/Product/mysql-4.0.27/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 /home/Product/mysql-4.0.27/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

[root@cubetree /]#

■ MySQL Group/User 생성, 권한 수정
[root@cubetree /]# groupadd mysql
[root@cubetree /]# useradd -g mysql mysql
[root@cubetree /]# chown -R mysql.mysql /usr/local/mysql/data
[root@cubetree /]#

■ MySQL 실행
[root@cubetree /]# /usr/local/mysql/bin/mysqld_safe &
[1] 30262 Starting mysqld daemon with databases from /home/Product/mysql-4.0.27/data
[root@cubetree /]#

■ MySQL profile 등록
[root@cubetree ~]# vi /root/.bash_profile
PATH=$PATH:$HOME/bin:/usr/local/bin:/usr/local/mysql/bin 를 추가하고, shell 재시작

■ MySQL 접속
[root@cubetree ~]# mysql -uroot
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 2 to server version: 4.0.27-log

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql>

■ MySQL root 비밀번호 변경
[root@cubetree ~]# mysqladmin -uroot password 비밀번호
[root@cubetree ~]#

■ MySQL 부팅시 자동실행 등록
[root@cubetree ~]# cp /usr/local/mysql/share/mysql/mysql.server /etc/rc.d/init.d/mysqld
[root@cubetree ~]# chkconfig --add mysqld
[root@cubetree ~]# chkconfig --level 3 mysqld on

1부(MySQL 설치)는 여기까지 이며, 다음 포스팅(2부) 에서는 apache 설치를 진행하도록 하겠습니다.
모든 분들 열공하세요^^

태그
소중한 댓글 부탁드립니다.
추천수 10단위당 메달이 1개씩 노출되고, 추천수에 따라 배경색이 변하며, 일정수의 추천수를 받을시 BEST 아이콘이 붙게됩니다.
추천수에 따른 배경색 보기 본문으로 바로가기
  • 추천수 50개이상
  • 추천수 30개이상
  • 추천수 20개이상
  • 추천수 10개이상
  • 추천수 3개이상
닫기

댓글 '2'

leecher (137721)

2009.12.15 23:23:57

잘 보앗습니다 ....

땡가(551857)

2014.10.07 10:00:56

고맙습니다.

List of Articles
번호 제목 글쓴이 날짜 추천 수 조회 수
9 Linux APM 설치 (Compile) 3부 - PHP & Zend 설치 hhkwoong 2009-10-07   8263
8 Linux APM 설치 (Compile) 2부 - Apache (httpd) 설치 hhkwoong 2009-10-07   5586
7 Linux APM 설치 (Compile) 1부 - MySQL 설치 [2] hhkwoong 2009-10-07   6015
6 vsftpd.conf 의 주요 설정 어드민플레이 2009-09-29   5103
5 하드웨어정보 확인(lshw) file 어드민플레이 2009-09-08   4069
4 리눅스에서 특정 파일을 제외하고 삭제하기 어드민플레이 2009-09-08   7887
3 리눅스 계정 삭제, 접속 차단 어드민플레이 2009-09-08   6090
2 crontab 사용 방법 어드민플레이 2009-09-08   6240
1 Linux에서 로그인 전후 메시지 수정 방법 어드민플레이 2009-09-08 1 4027