LAMP平臺QQ農場

LAMP平臺:
1.準備linux系統:自行安裝
虛擬機上需要掛載光盤
mount -o rw /dev/sr0 /mnt/cdrom (網絡環境不用)
2.安裝httpd、mysql、php
#yum install -y httpd mysql-server php php-mysql
注意: mysql-server是mysql的服務器端;php是用來解析php寫的網頁;php-mysql能Php寫的網頁,連接到Mysql數據庫
3.修改Php的配置文件:
#vim /etc/php.ini
short_open_tag = On (將off修改成爲on)
#vim /etc/httpd/conf/httpd.conf
DirectoryIndex index.php index.html index.html.var

在第1的位置上,添加一個index.php
service httpd restart
重啓服務(php的配置文件,會隨httpd重啓,被重讀)

4.編寫一個測試頁面:
#vim /var/www/html/index.php
<?php
phpinfo();
?>
#firefox http://IP地址/index.php
5.啓動數據庫,添加數據庫用戶並授權:
#service mysqld restart
#mysql 登錄到數據庫管理軟件中
>show databases; 查看都有哪些數據庫
>create database qqfarm; 創建一個數據庫,名稱爲qqfarm(可以任意)
>grant all on qqfarm.* to ‘qq’@‘localhost’ identified by ‘redhat’;
公網的話grant all on qqfarm.* to ‘qq’@‘IP’ identified by ‘redhat’;

用戶授權: all代表了所有的權限;on代表針對於誰;qqfarm.*代表了qqfarm下的所有內容;to代表給哪個人;qq代表了一個用戶;localhost代表本機;identified by代表設定密碼;redhat是密碼
> flush privileges; 重新刷新,讓授權生效
>exit 退出登錄
#mysql -u qq -predhat 登錄驗證一下

6.導入網頁到數據庫:
#unzip ucenter1.5
#mv upload/* /var/www/html
#chmod -R 777 /var/www/html
cd /var/www/html/
#mysql -u qq -predhat qqfarm < qqfarm.sql
#mysql -u qq -predhat qqfarm
> show tables;
能看見內容,就做對了

7.打開瀏覽器進行訪問,並安裝:
#firefox http://IP
把flash包拉到/var/www/html/
rpm安裝
在這裏插入圖片描述
如果出不來setup,看nginx 的html 文件夾下的文件,
如果安裝是install步驟出錯,更改網址
http://IP/install (安裝)
http://IP/home(qq農場)

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章