APM 설치하기
1. -설치된 APM 삭제
# rpm -e --nodeps httpd
# rpm -e --nodeps php
# rpm -e --nodeps mysql
2. Apache
[root@localhost httpd-2.2.4]# ./configure --prefix=/web/httpd // 설치 디렉토리 지정
--enable-module=so // DSO(Dynamic Shared Object) 를 지원, 확장명은 so
--enable-mods-shared=most //모듈 처리 지정
[root@localhost httpd-2.2.4]# make
[root@localhost httpd-2.2.4]# make install
<환경설정>
# vi /etc/ld.so.conf 에 아래 두줄 추가
/web/httpd/lib
/web/httpd/modules
# ldconfig
# cd /web/httpd/bin
# cp apachectl /etc/init.d/httpd2
# vi /etc/init.d/httpd 의 2~3행 쯤에 아래 두줄 추가
(띄어쓰기 주의)
# chkconfig: - 85 15
# description: Apache is a World Wide Web server.
<자동 시작 등록 및 시작>
# chkconfig httpd on
# ntsysv
# /etc/init.d/httpd start
3. mysql
[root@localhost mysql-5.0.44]#
./configure --prefix=/usr/local/mysql --with-charset=euckr
--localstatedir=/var/lib/mysql
// 옵션과 옵션사이는 공백
// 설치할 디렉토리를 지정하고, 한글을 지원하도록 하는 것
//DB파일을 저장할 디렉토리 지정
( 그 외에 내용은 ./configure --help 명령으로 확인 )
[root@localhost mysql-5.0.44]# make
[root@localhost mysql-5.0.44]# make install
<환경설정>
# vi /etc/ld.so.conf 에 아래 추가
/web/mysql/lib/mysql
# ldconfig
# cd /web/mysql/share/mysql
# cp mysql.server /etc/init.d/mysql
<초기화 DB 수동 생성 (mysql, test DB)>
# /web/mysql/bin/mysql_install_db
# ls -l /web/mysql/var //mysq. test 생성 확인
<mysql 사용자 및 그룹 생성 & DB 소유권 변경>
# groupadd mysql
# useradd -M -d /web/mysql -g mysql -s /bin/false -r mysql
(# useradd -g mysql mysql )
# chown -R mysql.mysql /web/mysql/var
<자동 시작 등록 및 시작>
# chkconfig mysql on
# ntsysv
# /etc/init.d/mysql start
(# PATH=$PATH: /web/mysql/bin )
<DB 사용자인 root의 비밀번호 지정>
# mysqladmin -u root password '123456'
// 4.x 이후부터는 mysql이라는 사용자가 root 권한을 가짐
my -u [DB 사용자 이름] -p (등록을 안한경우에는 ./~/mysqladmin ~)
# mysql -u root -p
Enter password: 123456 //원하는 패스워드를 입력한다.
mysql> status
mysql> show databases;
mysql> exit;
<MySQL 데몬이 제대로 동작하는지 확인>
# ps -ef | grep mysql
4. php
[root@localhost php-4.4.7]# ./configure --prefix=/web/mysql
--with-mysql=/web/mysql // DB 디렉토리 지정
--with-apxs2=/web/httpd/bin/apxs // DSO방식 컴파일
--enable-versioning // PHP3,4 호환 제공
--with-config-file-path=/etc // 환경설정파일 위치
--with-openssl // OpenSSL 지원
[root@localhost php-4.4.7]# make
[root@localhost php-4.4.7]# make install
<환경설정>
/web/httpd2/modules/libphp4.so 파일 확인
# cp php.ini-dist /etc/php.ini
<웹 서버 구동시 PHP모듈(libphp4.so) 등록>
# vi /web/httpd2/conf/httpd.conf 에 아래 확인
265행 쯤: LoadModule php4_module modules/libphp4.so
886행 쯤: AddType application/x-httpd-php .php .php4 .php3 .htm .html .inc
<웹서버 재구동>
# /etc/initd.d/httpd2 restart
5. httpd.conf
-기본 설치 위치 : /etc/httpd/conf/httpd.conf
-아파치 본체가 있는 디렉토리 지정
ServerRoot "web/httpd"
-디폴트 한글 지원
770행 쯤 : AddDefaultCharset EUC-KR 로 변경
-서버/클라이언트 오류처리 시간
Timeout 300 네트워크 속도가 좋지 않을 때 높게 변경
-멀티 프로세싱 모듈 중 prefork 사용 (Default)
<IfMoudule prefork.c>
StartServers 5 5개의 데몬을 초기에 구동
MinSpareServers 5 여분의 최소 데몬
MaxSpareServers 10 여분의 최대 데몬
MaxClients 150 최대 접속자수 제한
MaxRequestPerChild 0 하나의 데몬이 몇 개의 서비스를 제공한 후에 소멸될 것인지를 지정 (0은 무제한)
</IfModule>
-관리자 E-Mail
ServerAdmin you@example.com
-서버 이름 및 포트번호 //리눅스 서버가 등록된 DNS 주소를 가지고 있다면 해당 도메인의 주소 입력
ServerName www.example.com:80
-웹서버 최상위(루트) 디렉토리
DocumentRoot “/web/httpd2/htdocs”
-디렉토리 설정
<Directory “/web/httpd2/htdocs”>
Options Indexes FollowSymLinks Indexeds 제거 권장
Order allow,deny 접근설정 우선 순위
Allow From all 모두에게 접근 허용
</Directory>
-디폴트 html 파일
DirectoryIndex index.html
-사용자별 홈 디렉토리
UserDir public_html 각 사용자별 홈 디렉토리
웹 브라우져에서 : http://www.xxx.com/~사용자명/
사용자 디렉토리에 : ~사용자명/public_html/index.html
마지막으로 수정을 한 뒤에 오류 체크를 할려면 아래와 같은 명령을 쳐본다.
# /etc/init.d/httpd configtest
  Try to look on the bright side.

댓글을 달아 주세요