使用yum安裝LAMP的方法
使用yum安裝LAMP的方法:
1、yum update 檢查一下系統(tǒng)更新 初次安裝可能更新的時間會比較長,請耐心等待。
2、yum install gcc gcc-c++ ;安裝gcc軟件編譯環(huán)境。
3、yum erase httpd ;卸載系統(tǒng)自帶的httpd (apache2.2.3)
4、yum install zlib-devel libtool ncurses-devel libxml2-devel
(zlib-devel 安裝apache需要,否則出錯 .libtool安裝mysql時候需要.同時附帶了autoconf automake imake 編譯mysql 5.1.48時候會出錯 需要autoconf重新配置一下)
以上為一些準備工作,使用yum安裝LAMP的前提準備。接下開始安裝各個組件。
apache
- yum install httpd httpd-devel
安裝好之后啟動apache:/etc/init.d/httpd start
mysql
- yum install mysql msql-sever mysql-devel
啟動mysql服務:/etc/init.d/mysqld start
設置mysql密碼:
直接使用"mysql"進入數(shù)據(jù)庫模式,
- mysql> USE mysql;
- mysql> UPDATE user SET Password=PASSWORD('newpassword') WHERE user='root';
- mysql> FLUSH PRIVILEGES;
登陸
mysql -u root -p
Enter Password:
創(chuàng)建一個用戶管理數(shù)據(jù)庫
- mysql > create database demo
- mysql >GRANT ALL PRIVILEGES ON demo.* TO 'guest'@'localhost' IDENTIFIED BY 'guest' WITH GRANT OPTION;
- mysql> UPDATE user SET Password=PASSWORD('guest') WHERE user='guest';
php
- yum install php php-mysql php-common php-gd php-mbstring php-mcrtpt php-devel php-xml
安裝好php之后重啟httpd : /etc/init.d/httpd restart
設置成開機啟動:
- chkconfig httpd on
- chkconfig mysqld on
最后需要安裝squid組件
- yum -y install squid
【編輯推薦】