RPM apm - 해당되는 글 2건

1. apache 설치(httpd)
yum install httpd*

2. mysql 설치
yum install mysql*
yum install mysql-server

3. php 설치

yum install php*

4. php-mysql 연동 설치
yum install php-mysql


홈폴더에 test.php 만들고 브라우저로 테스트~
<?php
phpinfo();
?>

==========================================================
설정관련 참고사항

아파치 2.2.15
실행 : /etc/init.d OR service httpd start
설정파일 : /etc/httpd/conf ,  /etc/httpd/conf.d/php.conf

UserDir public_html (372)
Starting httpd: httpd: apr_sockaddr_info_get() failed for test
=> 276라인   ServerName 지정해주면 나타나지 않음

372라인  UserDir public_html
401라인  DirectoryIndex index.html index.html.var 확인
758라인  AddDefaultCharset UTF-8

* AddType application/x-httpd-php .php .htm .php3 .html
* AddType application/x-httpd-php-source .phps
 => PHP인식 위에 2가지 옵션을 적었는데 6.3 버전 RPM구성시 적지 않아도
    자동으로 PHP인식 확인(httpd.conf가 아닌 php.conf에 설정되어 있는것 같음)

홈폴더 : /var/www/html
기본 index.html

 

|

CentOS 5.0 기준

아파치 2.2.3
실행 : /etc/init.d OR service httpd start
설정파일 : /etc/httpd/conf
 - 747라인 AddDefaultCharset UTF-8
 - 391라인 디렉토리 인덱스 확인

AddType application/x-httpd-php .php .htm .php3 .html
AddType application/x-httpd-php-source .phps

UserDir public_html (362)

<Directory /home/*/public_html> (370-381)

홈폴더 : /var/www/html
기본 index.html

Mysql 5.0.45
실행 : /etc/init.d OR service mysqld start
DB파일위치 : /var/lib/mysql
소켓위치 : /var/lib/mysql/mysql.sock
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid
기타관련 파일 위치 : /usr/bin
mysqladmin도 여기에 위치함

[root@firewall bin]# service mysqld start
MySQL 데이타베이스를 초기화하는 중:  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 firewall 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  ]
MySQL (을)를 시작 중:                            [  OK  ]

=>처음 데몬을 실행하면 DB을 초기한다.

[root@firewall bin]# mysql -u root -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 3
Server version: 5.0.45 Source distribution
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql> quit
=>초기는 root 암호없이도 접속가능

[root@firewall ~]# mysqladmin -u root password '암호'   => 암호설정
[root@firewall ~]# mysql -u root -p => 연결
Enter password:


PHP 5.1.6
설정파일 : /etc/php.ini


참고로 최신 CentOS 5.5 버전은
PHP 5.1.6
mysql 5.0.77
아파치 2.2.3


출처:본인글

|

샹콤홍쓰's Blog is powered by Daum & tistory