최근에는 패키지로 배포되는 APM이 여러면에서 상당히 편리하므로 컴파일해서 설치할 필요가 없는 편입니다.

이 문서는 개인적인 차원에서 정리하는 것임을 밝혀 둡니다.

 

 

1. PATH 설정

/etc/profile 에 아래 내용 추가

# form Apache located at /usr/local/apache2
if [ –d /usr/local/apache2 ]
  LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/apache2/lib; export LD_LIBRARY_PATH
  PATH=$PATH:/usr/local/apache2/bin; export PATH;
fi

# from MySQL located at /usr/local/mysql
if [ –d /usr/local/mysql ]
  LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/mysql/lib/mysql; export LD_LIBRARY_PATH
  PATH=$PATH:/usr/local/mysql/bin; export PATH;
fi

 

2. MySQL 설정

mysql 사용자 추가

# groupadd mysql
# useradd -d /home/mysql -g mysql –s /bin/false mysql

환경파일 복사

# cp /usr/local/mysql/share/mysql/my-medium.cnf /etc/my.cnf

DB파일 생성

# /usr/local/mysql/bin/mysql_install_db
# chown -R mysql:mysql /usr/local/mysql/var

root 비밀번호 변경

# /usr/local/mysql/share/mysql/mysql.server start
# /usr/local/mysql/bin/mysqladmin –u root password ‘new-password’

 

3. Apache 설정

/usr/local/apache2/conf/httpd.conf 파일 수정

# Dynamic Shared Object (DSO) Support
LoadModule php5_module modules/libphp5.so
AddType application/x-httpd-php .php .htm .html
AddType application/x-httpd-php-source .phps

ServerName 수정

ServerName 192.168.0.1 처럼 IP를 지정하거나 도메인 지정

Include 주석 해제

가장 하단부에 각 설정이 구분된 Include 설정이 있다. 필요한 설정 부분 주석을 해제한다.

# Server-pool management (MPM specific)
Include conf/extra/httpd-mpm.conf

# Multi-language error messages
Include conf/extra/httpd-multilang-errordoc.conf

# Fancy directory listings
Include conf/extra/httpd-autoindex.conf

# Language settings
Include conf/extra/httpd-languages.conf

# User home directories
Include conf/extra/httpd-userdir.conf

# Real-time info on requests and configuration
Include conf/extra/httpd-info.conf

# Virtual hosts
Include conf/extra/httpd-vhosts.conf

# Local access to the Apache HTTP Server Manual
Include conf/extra/httpd-manual.conf

# Distributed authoring and versioning (WebDAV)
Include conf/extra/httpd-dav.conf

# Various default settings
Include conf/extra/httpd-default.conf

# Secure (SSL/TLS) connections
#Include conf/extra/httpd-ssl.conf

+ Recent posts