APM installation

한국 데비안 사용자 모임
둘러보기로 가기 검색하러 가기

설치 환경

Apache: 2.2.11
Php: 5.3.0
Mysql: 5.0.45
OS: Debian lenny (2.6.26-2)

APM설치

Mysql 설치

Mysql은 아래 주소에서 다운 받을 수 있습니다.
ftp://ftp.mysql.com/pub/mysql/src/

tar명령어를 이용해 압축을 해제합니다.

localhost:/home/westporch# tar zxvf mysql-5.0.45

mysql을 설치하기 위해 환경 설정을 합니다.

localhost:/home/westporch/mysql-5.0.45# ./configure --prefix=/usr/local/mysql --localstatedir=/usr/local/mysql/data --with-charset=euckr

--prefix=/usr/local/mysql : mysql을 설치할 경로
--localstatedir=/usr/local/mysql/data : mysql의 data가 위치할 경로
--with-charset=euckr : 한글지원, euc_kr은 mysql-4.1.x이전의 버전에서 쓰던 환경설정입니다. Mysql-4.1.x이후의 버전에서는 euckr을 이용합니다.

Configure가 끝나면 아래와 같은 메시지를 볼 수 있습니다.

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!


make; make install을 입력합니다.

localhost:/home/westporch/mysql-5.0.45# make; make install


mysql디렉토리로 이동하여 ./mysql_install_db & 명령을 입력합니다.

localhost:/usr/local/mysql/bin#  ./mysql_install_db &


mysql을 실행합니다.

localhost:/usr/local/mysql/bin# ./mysql
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.0.45 Source distribution 
Type 'help;' or '\h' for help. Type '\c' to clear the buffer. mysql>


mysql을 종료하기 위해서 exit명령을 입력합니다.

Mysql> exit
Bye
localhost:/usr/local/mysql/bin#

mysql 설치 완료

Apache설치

apache는 아래 주소에서 다운 받을 수 있습니다.
http://www.apache.org/dyn/closer.cgi

패키지의 압축을 풉니다.

localhost:/home/westporch# tar zxvf http*

apache의 환경설정과 컴파일을 합니다.

localhost:/home/westporch# ./configure --prefix=/usr/local/apache
localhost:/home/westporch# make; make install

apache설치 완료

Php 설치

php는 아래 주소에서 다운 받을 수 있습니다.
http://php.net/

압축 해제

localhost:/home/westporch# tar zxvf php*


php환경설정

localhost:/home/westporch/php-5.3.0# ./configure --with-mysql=/usr/local/mysql --with-apxs2=/usr/local/apache/bin/apxs 
--enable-track-vars=yes --enable-so

--with-mysql=/usr/local/mysql : mysql과 연동합니다.
--enable-track-vars : GET, POST, cookie 변수들이 어디서 왔는지 추적(track)합니다.


make; make install을 입력합니다.

localhost:/home/westporch/php-5.3.0# make; make install


httpd.conf 수정

웹서버를 실행하겠습니다.

localhost:/usr/local/apache/htdocs# ./httpd


웹 브라우저를 실행하고 아래의 주소를 입력합니다.

http://localhost/


서버가 정상적으로 작동하는군요

It works!


웹 문서 디렉토리로 이동하여 php파일을 작성합니다.

localhost:/usr/local/apache/htdocs#  vi test.php


phpinfo()를 통해 php설정을 확인할 수 있습니다.
웹서버를 운영하시는 분이라면 php작동 테스트를 위해 phpinfo()를 사용하시고 나중에 test.php를 삭제해 주세요

보안 상의 문제로 좋지 않습니다.
구글에서 phpinfo()[1]로 검색해봐도 많은 사이트들이 phpinfo()함수를 통해
시스템 정보를 보여주고 있습니다.

/* test.php */

<?
 phpinfo(); 
 ?>


http://localhost/test.php 를 입력하면 소스가 그대로 출력됩니다.
아파치 설정 파일(httpd.conf)파일을 수정하여 *.php파일을 인식하도록 해야합니다.

vi /usr/local/apache/conf/httpd.conf


AddType이라는 항목이 모여있는 곳으로 이동한 뒤 아래와 같이 추가합니다.
vi편집기에서 Esc키를 누른후 물음표(?) 키를 눌러 AddType를 입력하면 빨리 찾을 수 있습니다.

AddType application/x-httpd-php .php .htm .html .inc .php5 .php4
AddType application/x-httpd-php-source .phps


웹서버를 다시 시작하고 http://localhost/test.php 을 실행하면
php환경 설정 파일을 볼 수 있습니다.

APM설치가 모두 끝났습니다.

APM 에러 메시지

그 동안 APM을 설치하면서 해결했던 에러 메시지들을 정리하였습니다.

mysql 에러 메시지

error: Charset ‘euc_kr’ not available.

Checking “character sets”...configure: error: Charset ‘euc_kr’ not available. (
Available are: binary armscii8 ascii big5 cp1250 cp1251 cp1256 cp1257 cp850 cp85
2 cp 866 cp932 dec8 eucjpms euckr gb2312 gbk geostd8 hebrew hp8 keybcs2 koi
8r koi8u latin1 latin2 latin5 latin7 macce macroman sjis swe7 tis620 ucs2 ujis u
tf8).
         See the Installation chapter in the Referrnce Manual.

configure 옵션에서 –with-charset=euc_kr을 --with-charset=euckr로 변경해야 합니다.
mysql 4.1.x부터 –with-charset=euckr로 설정해야 합니다.

error: no acceptable C compiler found in $PATH

checking for gcc... no 
checking for cc... no 
checking for cl.exe... no 
configure: error: in `/home/westporch/mysql-5.0.45': 
configure: error: no acceptable C compiler found in $PATH 
See `config.log' for more details. 

C compiler가 설치되지 않아 발생하는 메시지입니다.
apt-get install gcc명령을 통해 C compiler를 설치합니다.
GCC[2]는 GNU Compiler Collection의 줄임말 입니다.

error: No curses/termcap library found

checking for tgetent in -lncursesw... no 
checking for tgetent in -lncurses... no 
checking for tgetent in -lcurses... no 
checking for tgetent in -ltermcap... no 
checking for tgetent in -ltinfo... no 
checking for termcap functions library... configure: error: No curses/termcap library found 

apt-get install libncurses5-dev
apt-get install libncursesw5-dev
apt-get install elks*
위 패키지를 설치합니다.

bash: make: command not found

 localhost:/home/westporch/mysql-5.0.45# make; make install 

bash: make: command not found bash: make: command not found

mysql의 컨피그를 마치고 make명령을 입력한 후 발생한 에러 메시지. 아래 패키지를 설치합니다. Apt-get install make
apt-get install g++
apt-get install libtool

error: redeclaration of C++ built-in type ‘bool’

source='my_new.cc' object='my_new.o' libtool=no \ 
DEPDIR=.deps depmode=none /bin/sh ../depcomp \ 
g++ -DDEFAULT_BASEDIR=\"/usr/local/mysql\" 
-DDATADIR="\"/usr/local/mysql/data\""
-DDEFAULT_CHARSET_HOME="\"/usr/local/mysql\""
-DSHAREDIR="\"/usr/local/mysql/share/mysql\""
-DDEFAULT_HOME_ENV=MYSQL_HOME
-DDEFAULT_GROUP_SUFFIX_ENV=MYSQL_GROUP_SUFFIX -DDEFAULT_SYSCONFDIR="\"/usr/local/mysql/etc\"" 
-DHAVE_CONFIG_H -I. -I. -I.. -I../zlib -I../include -I../include -I.    -O -DDBUG_OFF    
     -fno-implicit-templates -fno-exceptions -fno-rtti -c -o my_new.o my_new.cc 
In file included from mysys_priv.h:16, 
                from my_new.cc:21: 
../include/my_global.h:982: error: redeclaration of C++ built-in type ‘bool’ 
make[2]: *** [my_new.o] 오류 1 
make[2]: Leaving directory `/home/westporch/mysql-5.0.45/mysys' 
make[1]: *** [all-recursive] 오류 1 
make[1]: Leaving directory `/home/westporch/mysql-5.0.45' 
make: *** [all] 오류 2

Make명령을 내린뒤 g++를 설치했기 때문에 나타나는 메시지 입니다.

make clean
make distclean

reconfigure & compile

STOPPING Server from pid file /usr/local/mysql/data/localhost.pid

Starting mysqld daemon with databases from /usr/local/mysql/data
STOPPING Server from pid file /usr/local/mysql/data/localhost.pid
081207 21:12:29 mysqld ended

소유권 문제로 실행이 안된 것 입니다.
Chown -R mysql.mysql data명령을 통해 data파일의 소유자와 그룹을 모두 변경합니다.

ERROR 2002 (HY000): can’t connect to local MYSQL server

ERROR 2002 (HY000): can’t connect to local MYSQL server
through socket ‘/tmp/mysql.sock’(2)

./mysql_safe –user=root &

apache 에러 메시지

error: user –with-apxs2 with Apache 2.x!

Configuring SAPI modules
Checking for AOL Server support..no
Checking for Apache 1.x module support via DSO through APXS..no
Checking for Apache 1.x module support...configure:error:
user –with-apxs2 with Apache 2.x!

--with-apache옵션은 1.3.x 버전에서 사용하던 옵션입니다.
Apache2.x를 이용한다면 --with-apxs2=/apache_install_dir/bin/apxs옵션을 이용해 주세요.
이때, apache_install_dir은 아파치 소스 디렉토리가 아니라 인스톨 디렉토리입니다.

error: xml2-config not found. Please check your libxml2 installation.

Configuring extensions 
checking size of long... (cached) 8 
checking size of int... (cached) 4 
checking for int32_t... yes 
checking for uint32_t... yes 
checking for sys/types.h... (cached) yes 
checking for inttypes.h... (cached) yes 
checking for stdint.h... (cached) yes 
checking for string.h... (cached) yes 
checking for stdlib.h... (cached) yes 
checking for strtoll... yes 
checking for atoll... yes 
checking for strftime... (cached) yes 
checking which regex library to use... php 
checking whether to enable LIBXML support... yes 
checking libxml2 install dir... no 
checking for xml2-config path... 
configure: error: xml2-config not found. Please check your libxml2 installation. 

apt-get install libxml2-dev

마무리

도스토예프스키[3]란 소설가는 글을 쓸때보다 '글을 어떻게 쓸까?' 구상하는게 더 즐거웠다고 해요.
또한, 자신이 소설을 쓰고나서 소설의 등장 인물이 자신의 친척또는 주변인물 처럼 느껴졌다고 하는군요.

자신의 일에 대한 열정이 느껴지지 않나요?
저 또한 위와 같은 자세로 문서를 작성하려고 노력했답니다.