天天看點

Linux學習筆記 18 (yum搭建LAMP架構+搭建discuz部落格)搭建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

Linux學習筆記 18 (yum搭建LAMP架構+搭建discuz部落格)搭建LAMP搭建Discuz部落格

搭建成功啦,還是很友善快捷的!!

繼續閱讀