【MySQL 安裝】

首先安裝 MySQL
# yum -y install mysql-server
安裝好 MySQL 後就設定 /etc/my.cnf
[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
# Default to using old password format for compatibility with mysql 3.x
# clients (those using the mysqlclient10 compatibility package).
old_passwords=1
default-character-set = utf8

[mysql.server]
user=mysql
basedir=/var/lib

[mysqld_safe]
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid

[mysql]
default-character-set = utf8
設定 MySQL 服務隨系統一起啟動
# chkconfig mysqld on

確認 MySQL 自動啟動有打開
# chkconfig --list mysqld
如果2--5為on的狀態就OK
mysqld 0:off 1:off 2:on 3:on 4:on 5:on 6:off
啟動 MySQL 服務
# /etc/rc.d/init.d/mysqld start
啟動 MySQL 以後,必須設定 root 的密碼
# mysqladmin -u root password 'Your Password'
【Apache 安裝】

安裝 Apache
# yum -y install httpd

【PHP 安裝】

接下來安裝 PHP
# yum -y install php php-mbstring php-mysql
接下來可以簡單設定一下 httpd.conf ~ 可看此教學的設定

設置 Apache 隨系統自動啟動
# chkconfig httpd on

確認2--5為on的狀態就OK
# chkconfig --list httpd
httpd 0:off 1:off 2:on 3:on 4:on 5:on 6:off

啟動 Apache 服務
# /etc/rc.d/init.d/httpd start
[1] 用 Apache 構建 HTTP 服務器
[2] 構建 MySQL 數據庫服務器
arrow
arrow
    全站熱搜

    Bojack 發表在 痞客邦 留言(2) 人氣()