반응형
아파치 2.0.55+mysql 4.0.26+Php 4.4.2 연동
작성자:김주홍 (2006-02-15)
mysql 설치
[root@finebill local]# useradd mysql
[root@finebill local]# groupadd mysql
./configure --prefix=/usr/local/mysql --localstatedir=/usr/local/mysql/data --with-charset=euc_kr
**MySQL 4.1.X 에서는 --with-charset=euckr 으로 해야 합니다
make
make install
cd /usr/local/mysql/bin
**cp /usr/local/mysql/share/mysql/my-medium.cnf /etc/my.cnf
./mysql_install_db
chown -R mysql.mysql /usr/local/mysql/data
./mysqld_safe &
./mysqladmin -u root password '암호명'
./mysql -u root -p ->mysql접속

=======================================================
MySQL 4.0.X 에서 MySQL 4.1.X 달라진점
4.0.X 에선 4.1.X 는 많은 변화들이 있습니다.
1. mysql 4.1의 table 이름은 utf8으로 저장(한글 테이블명을 사용할수 없습니다.)
2. mysql db 에 user 테이블의 password 필드가 더 길어졌습니다.(16->41)
3. password 다루는 방식이 달라졌습니다. 보안을 강하게 하기 위해서 hashing 메커니즘이 바뀌었습니다.
- hashing 이 16바이트에서 41바이트바뀌었습니다. 보이는건 45바이트. 4바이트는? 소금^^;
- 새로운 포멧은 *부터 시작. 예전포멧은 그렇지 않았습니다.
- 예전 포멧을 사용하려면, old_password()함수를 사용해야 합니다.
4. configure 할때 --with-charset=euc_kr 에서 --with-charset=euckr 으로 바뀌었습니다.

*. 더 자세한 것은. ... http://dev.mysql.com/doc/mysql/en/Upgrading-from-4.0.html 참조하세요

*lmysql 셧다운 시키기 -> ./mysqladmin -u root -p shutdown
*mysql 데이타베이스 생성및 데이터 베이스 계정추가..(제로보드 사용시)
- create database zero_board; // 데이타베이스 생성
- 3) zero_board 데이타베이스에 계정 사용자(ID:kjhfull)를 주고 암호(Password:xxxx)까지
   설정해서 한방에 끝내겠습니다.
- GRANT ALL PRIVILEGES ON kjhfull.* TO kjhfull@localhost IDENTIFIED BY '1234' WITH GRANT OPTION;
*계정 등록을 확인해 보겠습니다.
- use mysql; // 참고로 mysql 은 사용자가 등록되는 DB 입니다.root 도 여기등록 됩니다.
- select * from user; // 위에서 만든 kjhfull 이 사용자에 보여야 함
- DELETE FROM user where user='kjhfull'; 사용자 삭제
==========================================================
apache2 설치
./configure --enable-so --prefix=/usr/local/apache2
make
make install

PHP 설치
./configure --prefix=/usr/local/php --with-apxs2=/usr/local/apache2/bin/apxs --with-mysql=/usr/local/mysql --with-charset=euc_kr --with-config-file-path=/usr/local/lib
make
make install
cp php.ini-dist /usr/local/php/lib/php.ini

==아파치 conf 수정추가 작업==
기본언어 설정 한글로
AddDefaultCharset EUC-KR

DirectoryIndex index.html index.html.var index.php index.html -> 395라인
AddType application/x-httpd-php .php .htm .php3 .html 추가 -> 838라인
AddType application/x-httpd-php-source .phps
===================================================================
cd /usr/local/apache/bin
./apachectl start

===test.php===
phpinfo();
?>
===============

시작시 자동실행
echo "/usr/local/mysql/bin/mysqld_safe --language=korean &" >> /etc/rc.d/rc.local
echo "/usr/local/apache/bin/apachectl start" >> /etc/rc.d/rc.local
,