lang/php

CentOS 5.x Yum APM

C/H 2011. 3. 8. 19:47



yum groupinstall "MySQL Database" "Web Server"

yum -y install httpd
yum -y install mysql , mysql-server ,  mysql-connector-odbc , mysql-devel
yum -y install php
# 그 외 나머지 필요한 기능을 모듈별 설치

#mysql 설정
cp /usr/share/mysql/my-large.cnf /etc/my.cnf


# 권한지정
chown -R root /usr/bin/
chgrp -R mysql /usr/bin/
chown -R mysql /var/lib/mysql/


# 콘솔 명력 등록
vi ~/.bash_profile
PATH=$PATH:$HOME/bin:/usr/bin


# 자동 시작 등록
chkconfig  --list | grep mysqld
#mysqld  0:off 1:off 2:off 3:off 4:off 5:off 6:off
chkconfig --level 2345 mysqld on
#mysqld  0:off 1:off 2:on 3:on 4:on 5:on 6:off


# mysql 시작
# /etc/rc.d/init.d/mysqld start
/etc/rc.d/init.d/httpd start


# mysql비밀번호 지정
/usr/bin/mysqladmin -uroot password 비번

# PHP 설정
vi /etc/httpd/conf.d/php.conf


# 2줄 추가
AddHandler php5-script .php .htm .html
AddType application/x-httpd-php-source .phps .php .html .html


# httpd.conf 수정
vi /etc/httpd/conf/httpd.conf
ServerName localhost:80 
AllowOverride All
DirectoryIndex index.html index.htm index.php
# AddType application/x-gzip .gz .tgz 을 찾아 그 다음줄에 아래 두줄  내용 추가
AddType application/x-httpd-php .htm .html .php .ph php3 .php4 .phtml .inc
AddType application/x-httpd-php-source .phps

# 자동시작 등록
chkconfig  --list | grep httpd
httpd  0:off 1:off 2:off 3:off 4:off 5:off 6:off

chkconfig --level 2345 httpd on
httpd  0:off 1:off 2:on 3:on 4:on 5:on 6:off

# 아파치 시작
# /usr/sbin/apachectl start
/etc/rc.d/init.d/httpd start


# 업데이트
yum update

# 리부팅
reboot

반응형