:: 리눅스 Apache + PHP + MySql + FreeTDS 를 이용한 MSSQL 의 연동 ::
일자 - 2006. 08. 02
작성자 - 조왕언
먼저 APM 을 처음 설치하는 분이라면 리눅스의 소스 컴파일에 대한 정보를 얻고 실행한다. 무작정 따라하는 것은(별 상관은 없지만) 컴터마다 다르므로 예기치 않은 에러로 고생한다.ㅡㅡ;
그러므로 configure // make // make install // make clean 등을 검색해서 어떤 것인지 이해한다
make 와 make install 은
# make; make install ==> 이케 쓸수 있다
# make && make install ==> 이케 쓸수 있다
그렇다면 APM 설치로 들어가보자.
1. Install MySQL client
# tar xvpfz mysql-5.0.22.tar.gz
# cd mysql-5.0.22
# ./configure --prefix=/usr/local/mysql --localstatedir=/usr/local/mysql/data --disable-shared --enable-assembler --with-thread-safe-client --with-mysqld-user="mysql" --with-client-ldflags=-all-static --with-mysqld-ldflags=-all-static --with-readline --without-debug --without-docs --without-bench --with-charset=euckr
* euckr 은 버전에 따라 euc_kr
# make
# make install
# cd mysql-5.0.22
# ./configure --prefix=/usr/local/mysql --localstatedir=/usr/local/mysql/data --disable-shared --enable-assembler --with-thread-safe-client --with-mysqld-user="mysql" --with-client-ldflags=-all-static --with-mysqld-ldflags=-all-static --with-readline --without-debug --without-docs --without-bench --with-charset=euckr
* euckr 은 버전에 따라 euc_kr
# make
# make install
# cd /usr/local/mysql/bin
# mysql_install_db // 위의 configure 에서 localstatedir 로 잡은데다가 db 생성
/////////// # mysqld_safe & 나 safe_mysqld & 명령어가 먹지 않는다면..
/////////// 거진 아래의 것 때문일 것이다. 퍼미션이 필요하다 ////////////////
# chown -R root /usr/local/mysql
# chown -R mysql /usr/local/mysql/data
# chgrp -R mysql /usr/local/mysql
# /usr/local/mysql/bin/mysqladmin -u root password 'xxxxxx' // password 설정
2. Install Apache
# cd /usr/local/src
# wget http://mirror.apache.or.kr/httpd/httpd-2.2.2.tar.bz2
# tar xvpfj httpd-2.2.2.tar.bz2
# cd httpd-2.2.2
# ./configure --prefix=/usr/local/apache --enable-modules=so --enable-so --enable-mods-shared=most --with-mpm=worker --with-charset=euc_kr
# wget http://mirror.apache.or.kr/httpd/httpd-2.2.2.tar.bz2
# tar xvpfj httpd-2.2.2.tar.bz2
# cd httpd-2.2.2
# ./configure --prefix=/usr/local/apache --enable-modules=so --enable-so --enable-mods-shared=most --with-mpm=worker --with-charset=euc_kr
<옵션설명>
--prefix=/usr/local/apache
apache가 설치될 경로
--enable-mods-shared=most --enable-modules=so
DSO방식으로 PHP모듈을 사용하도록 하기위한 옵션, 데이터처리 및 확장성이 용이
--with-mpm=worker
다중프로세스모듈(Multi Process Module)중 worker 모듈을 지원하기 윈한 옵션
--prefix=/usr/local/apache
apache가 설치될 경로
--enable-mods-shared=most --enable-modules=so
DSO방식으로 PHP모듈을 사용하도록 하기위한 옵션, 데이터처리 및 확장성이 용이
--with-mpm=worker
다중프로세스모듈(Multi Process Module)중 worker 모듈을 지원하기 윈한 옵션
# make
# make install
# make install
3. Install FreeTDS
# cd /usr/local/src
# wget http://ibiblio.org/pub/Linux/ALPHA/freetds/stable/freetds-stable.tgz
# tar xvpfz freetds-stable.tgz
# cd freetds-0.63
# ./configure --prefix=/usr/local/freetds --with-tdsver=8.0 --disable-odbc --disable-debug --enable-dbmfix --enable-msdblib
# make
# make install
# wget http://ibiblio.org/pub/Linux/ALPHA/freetds/stable/freetds-stable.tgz
# tar xvpfz freetds-stable.tgz
# cd freetds-0.63
# ./configure --prefix=/usr/local/freetds --with-tdsver=8.0 --disable-odbc --disable-debug --enable-dbmfix --enable-msdblib
# make
# make install
4. Install PHP
# cd /usr/local/src
# wget http://kr.php.net/get/php-5.1.3.tar.bz2/from/this/mirror
# tar xvpfj php-5.1.3.tar.bz2
# cd php-5.1.3
# ./configure --with-apxs2=/usr/local/apache/bin/apxs --with-mysql=/usr/local/mysql --with-gd --with-zlib-dir=/usr/lib --with-png-dir=/usr/lib --with-jpeg-dir=/usr/lib --with-config-file-path=/usr/local/apache/conf --with-exec-dir=/usr/local/apache/bin --enable-track-vars --enable-trands-sid --with-charset=euc_kr --enable-so --with-mysql-sock=/tmp/ --with-mysqli=/usr/local/mysql/bin/mysql_config --enable-ftp --with-mssql=/usr/local/freetds --with-sybase=/usr/local/freetds --with-freetype-dir=/usr/local/freetype
<옵션설명>
--with-apxs2=/usr/local/apache2/bin/apxs
apache2 경로
--with-mysql=/usr/local/mysql
mysql 경로
--with-config-file-path=/usr/local/apache2/conf
php.ini 파일경로
--with-exec-dir/usr/local/apache2/bin
아파치데몬 파일경로
--enable-track-vars
--enable-trands-sid
# wget http://kr.php.net/get/php-5.1.3.tar.bz2/from/this/mirror
# tar xvpfj php-5.1.3.tar.bz2
# cd php-5.1.3
# ./configure --with-apxs2=/usr/local/apache/bin/apxs --with-mysql=/usr/local/mysql --with-gd --with-zlib-dir=/usr/lib --with-png-dir=/usr/lib --with-jpeg-dir=/usr/lib --with-config-file-path=/usr/local/apache/conf --with-exec-dir=/usr/local/apache/bin --enable-track-vars --enable-trands-sid --with-charset=euc_kr --enable-so --with-mysql-sock=/tmp/ --with-mysqli=/usr/local/mysql/bin/mysql_config --enable-ftp --with-mssql=/usr/local/freetds --with-sybase=/usr/local/freetds --with-freetype-dir=/usr/local/freetype
<옵션설명>
--with-apxs2=/usr/local/apache2/bin/apxs
apache2 경로
--with-mysql=/usr/local/mysql
mysql 경로
--with-config-file-path=/usr/local/apache2/conf
php.ini 파일경로
--with-exec-dir/usr/local/apache2/bin
아파치데몬 파일경로
--enable-track-vars
--enable-trands-sid
# make
# make install
# cp php.ini-recommended /usr/local/lib/php.ini
# make install
# cp php.ini-recommended /usr/local/lib/php.ini
## freetds 는 port 확인이 필요하다 freetds.conf 수정요함
char set = EUC-KR => 에러시 ver 8.0 => 4.2 로 수정
--- configure 중 에러 발생 하면 ---
<configure: error: libxml2 version 2.6.11 or greater required. 에러 발생시>
# tar xvfz libxml2-2.6.16.tar.gz
# cd libxml2-2.6.16
# ./configure
# make
# make install
<configure: error: libjpeg.(a|so) not found. 에러 발생시>
# wget http://graphics.cs.uni-sb.de/NMM/Download/external/jpegsrc.v6b.tar.gz
# tar xvfz jpegsrc.v6b.tar.gz
# cd jpeg-6b
# ./configure --enable-shared --enable-static
# make
# make test
# make install
# tar xvfz jpegsrc.v6b.tar.gz
# cd jpeg-6b
# ./configure --enable-shared --enable-static
# make
# make test
# make install
<configure: error: libpng.(a|so) not found. 에러 발생시>
# wget ftp://ftp.superuser.co.kr/etc/libpng-1.2.5.tar.gz
# tar zxvf libpng-1.2.5.tar.gz
# cd libpng-1.2.5
# cp script-xs/makefile.linux makefile
# make test
# make install
# tar zxvf libpng-1.2.5.tar.gz
# cd libpng-1.2.5
# cp script-xs/makefile.linux makefile
# make test
# make install
<configure: error: gd(a|so) not found. 에러 발생시>
# ./configure --prefix=/usr/local/gd
# make && make install
# make && make install
<configure: error: freetype(a|so) not found. 에러 발생시>
# ./configure --prefix=/usr/local/freetype
# make && make install
# make && make install
//// php install 시 --with-mssql=/usr/local/freetds 옵션을 주었다면 모듈 설치는 안해도 ////
5. Install MS-SQL module
# cd /usr/local/src/php-5.1.3/ext/mssql
# phpize
# ./configure --with-mssql=/usr/local/freetds
# make
# make install
# vi /usr/local/lib/php.ini
# phpize
# ./configure --with-mssql=/usr/local/freetds
# make
# make install
# vi /usr/local/lib/php.ini
extension_dir = "/usr/local/lib/php/extensions/no-debug-non-zts-20050922/"
extension=mssql.so
extension=mssql.so
설정파일 손보기
<httpd.conf, php.ini 파일>
--바꿔야할 내용들..--
<php.ini>
register_globals = On
<php.ini>
register_globals = On
<httpd.conf>
혹시안되면...확인..
LoadModule php5_module modules/libphp5.so
LoadModule php5_module modules/libphp5.so
<Directory />
Options FollowSymLinks
AllowOverride None
# Order deny,allow ==> 두줄 주석처리..
# Deny from all
</Directory>
Options FollowSymLinks
AllowOverride None
# Order deny,allow ==> 두줄 주석처리..
# Deny from all
</Directory>
<Directory "/usr/local/apache2/htdocs">
AddType application/x-tar .tgz
AddType application/x-httpd-php .php .php3 .inc .htm .html .js
AddType application/x-httpd-php-source .phps
AddType application/x-httpd-php .php .php3 .inc .htm .html .js
AddType application/x-httpd-php-source .phps
<IfModule dir_module>
DirectoryIndex index.html index.php ==> index.php 추가
</IfModule>
DirectoryIndex index.html index.php ==> index.php 추가
</IfModule>
--주석삭제--
Include conf/extra/httpd-languages.conf
Include conf/extra/httpd-languages.conf
Include conf/extra/httpd-userdir.conf
Include conf/extra/httpd-default.conf
퍼온URL: http://servergoogle.net/566
댓글 없음:
댓글 쓰기