2009년 4월 17일 금요일

APM 설치 - yum 이용

CentOS 에서 LAMP 설치..

Yum 을 사용해 설치시..

Apache2+PHP 설치
sudo yum groupinstall "Web Server"

아파치 시작
sudo /etc/init.d/httpd start

에러 메시지
Starting httpd: httpd: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName

Apache Config 수정
sudo nano /etc/httpd/conf/httpd.conf

Line 265 에
#ServerName www.example.com:80

호스트이름으로 바꿔야한다... (그리구 #을 지우고..)
ServerName demo

그리구 아파치 다시 시작
sudo /etc/init.d/httpd restart

서버 제시작할시 Apache를 자동시작하게 추가
sudo /sbin/chkconfig httpd on

확인 방법
sudo /sbin/chkconfig --list httpd

예를 들자면
team1ab @ centos ~ $ sudo /sbin/chkconfig httpd on
team1ab @ centos ~ $ sudo /sbin/chkconfig --list httpd
httpd              0:off    1:off    2:on    3:on    4:on    5:on    6:off


MySQL 설치

sudo yum groupinstall "MySQL Database"

MySQL 시작
sudo /etc/init.d/mysqld start

시작하면. (에러 메시지)
team1ab @ centos ~ $ sudo /etc/init.d/mysqld start
Initializing MySQL database:  Installing MySQL system tables...
OK
Filling help tables...
OK

To start mysqld at boot time you have to copy
support-files/mysql.server to the right place for your system

PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
To do so, start the server, then issue the following commands:
/usr/bin/mysqladmin -u root password 'new-password'
/usr/bin/mysqladmin -u root -h centos password 'new-password'
See the manual for more instructions.
You can start the MySQL daemon with:
cd /usr ; /usr/bin/mysqld_safe &

You can test the MySQL daemon with mysql-test-run.pl
cd mysql-test ; perl mysql-test-run.pl

Please report any problems with the /usr/bin/mysqlbug script!

The latest information about MySQL is available on the web at
http://www.mysql.com
Support MySQL by buying support/licenses at http://shop.mysql.com
                                                                     [  OK  ]
Starting MySQL:                                             [  OK  ]

MySQL Root 비번 설정
sudo /usr/bin/mysqladmin -u root password 'new-password'

Note. "new-password" 에 본인이 비번 설정해준것으로 로그인.

예를 들면
sudo /usr/bin/mysqladmin -u root password 'abcdef'

MySQL 에 접속해보자
mysql -u root -p

예를 들면.
team1ab @ centos ~ $ mysql -u root -p
Enter password:

하면 비밀번호를 입력해주고 Enter, 해주면 저 메시지가 나온다.. 그럼 설치가 된것이다...
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 4
Server version: 5.0.45 Source distribution

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql>

종료할때는 >> \q << 해주면된다...

MySQL를 서버 재시작시 자동으로 실행하구 싶으면.
sudo /sbin/chkconfig mysqld on

해주고 확인시.
sudo /sbin/chkconfig --list mysqld

예를 들면.
team1ab @ centos ~ $ sudo /sbin/chkconfig mysqld on
team1ab @ centos ~ $ sudo /sbin/chkconfig --list mysqld
mysqld             0:off    1:off    2:on    3:on    4:on    5:on    6:off

그럼 설치 끝이다...
이제 잘사용해보세요...

그냥... 쉽게 기본만 설치할시..
Apache2+PHP5+MySQL5
sudo yum install httpd mod_ssl php-common php-gd php-mcrypt php-pear php-pecl-memcache php-mhash php-mysql php-xml mysql-server mysql mysql-devel

설정은 똑같이 위에 것들을 따라 하시면 됩니다.

댓글 없음:

댓글 쓰기