Linux學習筆記 18 (yum搭建LAMP架構+搭建discuz博客)

yum安裝真香~

LAMP指的是Linux+Apache+Mysql+PHP的模式所構成的Web 應用程序

這裏用的是yum安裝方法,簡單快捷直接搭建好,而且比起源碼安裝報錯少

搭建LAMP

(1)安裝

yum  install  httpd  httpd-devel  mysql-server mysql-devel  php php-devel php-mysql –y 

(2)啓動apache,mysql服務

/etc/init.d/httpd start

/etc/init.d/mysqld start

(3)修改http的配置信息

vi /etc/httpd/conf.d/php.conf

#yum的php.conf的路徑相在/etc/httpd/conf.d/下

添加修改如下信息:
LoadModule     php5_module modules/libphp5.so (默認已存在) 
AddType     application/x-httpd-php .php 
DirectoryIndex  index.php index.html (把 index.php 加入 index.html 之前)

(4.)驗證是否安裝配置成功

cd /var/www/html 

touch index.php

vi index.php

輸入如下php代碼

<?php
phpinfo():
?>

(5)輸入192.168.0.100/index查看即可出現php驗證頁面

 

搭建Discuz博客

1.下載 

wget http://download.comsenz.com/DiscuzX/3.1/Discuz_X3.1_SC_UTF8.zip 

2.解壓

unzip Discuz_x3.1.sc_UTF8.zip -d /www/var/html/

3.覆蓋文件

cd /var/www/html/ 

mv upload/* .

4.IP訪問,http://192.168.0.100/index.php ,下一步至給文件授權,賦予 discuz 目錄完全訪問權限

cd /var/www/html/ 
chmod 777 -R data/ uc_server/ config/ uc_client/ 

#data,uc_server,config,uc_client 四個文件授權

5.下一步至前端配置discuz數據庫連接

一直下一步至鏈接數據庫頁面,輸入數據庫名稱,數據庫用戶等信息

然後,返回lunix數據庫內創建對應的數據庫,數據庫用戶信息

create database discuz charset=utf8; 

數據量訪問授權

grant all on discuz.* to root@'IP地址' identified by "123456"; 

6.訪問http://192.168.0.100/index.php

 

 

搭建成功啦,還是很方便快捷的!!

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