操作系統:RedHatEnterpriseLinuxServer5.6-i386
內核 :2.6.18-238.el5
linux瀏覽器:firefox (不支持中文,就換成win下普通瀏覽器來進行Dicuz論壇的安裝)
安裝包:/root/Desktop/LAMP/httpd-2.0.64.tar.gz
/root/Desktop/LAMP/mysql-5.0.18.tar.gz
/root/Desktop/LAMP/php-5.2.8.tar.bz2
/root/Desktop/LAMP/Discuz_7.2_FULL_SC_GBK.zip
安裝位置:/usr/local/apache
/usr/local/mysql
/usr/local/php
注意 :卸載之前已經安裝過的apache mysql php
Apache
cd /root/Desktop/LAMP/
tar -zxf httpd-2.0.64.tar.gz
cd httpd-2.0.64
./configure --prefix=/usr/local/apache/(會自動生成/usr/local/Apache/這個目錄)
make && make install
/usr/local/apache/bin/apachectlrestart
cd /usr/local/apache/htdocs/
rm -rf *
vi index.html
/usr/local/Apache/bin/apachectl restart
Mysql
cd /root/Desktop/LAMP/
tar -zxf mysql-5.0.18.tar.gz
cd mysql-5.0.18
./configure --help
vi INSTALL-SOURCE
只留如下內容:
chmod 777./INSTALL-SOURCE(權限與開發商議)
./INSTALL-SOURCE
PHP:
cd /root/Desktop/LAMP/
tar -jxf php-5.2.8.tar.bz2
cd php-5.2.8
./configure --prefix=/usr/local/php --with-mysql=/usr/local/mysql/
--with-apxs2=/usr/local/apache/bin/apxs
make && make install
php裝完,再修改apache:
vi /usr/local/apache/conf/httpd.conf
或者:
第844行添加:AddType application/x-httpd-php .php
第395行補上:DirectoryIndex index.html index.html.var index.php
cd /usr/local/apache/htdocs/
rm -rf *
vi index.php
<?php
phpinfo();
?>
/usr/local/apache/bin/apachectl start
測試:在linux-firefox瀏覽器地址欄輸入localhost/index.php
Discuz:
cd /root/Desktop/LAMP/
unzip Discuz_7.2_FULL_SC_GBK.zip
cp -rupload/ /usr/local/apache/htdocs/或直接把安裝包拿到/usr/local/apache/htdocs/下解壓
chmod 777 -R /usr/local/apache/htdocs/upload/
測試:在linux-firefox瀏覽器地址欄輸入http://127.0.0.1/upload/install (本機測試)
或在win-IE瀏覽器地址欄輸入http://xxx.xxx.xxx.xxx/upload/install (支持中文,橋接/NAT模式)
進入Discuz論壇安裝界面
搭建過程中遇到的問題:
1.安裝mysql,執行./INSTALL-SOURCE時,遇到以下兩種情況:
checking for g++... no
checking for c++... no
checking for gpp... no
checking for aCC... no
checking for CC... no
checking for cxx... no
checking for cc++... no
checking for cl... no
checking for FCC... no
checking for KCC... no
checking for RCC... no
checking for xlC_r... no
checking for xlC... No
.................
configure: error: C++ preprocessor "/lib/cpp" fails sanity check
See `config.log' for more details.
原因:未裝gcc等編譯工具
解決:# yum install gcc* -y再./INSTALL-SOURCE
checking for tgetent in -lncurses... no lncurses======>l : lib
checking for tgetent in -lcurses... No ==>ncurses: 庫名(待裝)
checking for tgetent in -ltermcap... no
checking for termcap functions library... configure: error: No curses/termcap library found
make: *** 沒有指明目標並且找不到 makefile。 停止。
make: *** 沒有規則可以創建目標“install”。 停止。
cp: 無法 stat “support-files/my-medium.cnf”: 沒有那個文件或目錄
./INSTALL-SOURCE: line 6: cd: /usr/local/mysql: 沒有那個文件或目錄
./INSTALL-SOURCE: line 7: bin/mysql_install_db: 沒有那個文件或目錄
chown: 無法訪問 “var”: 沒有那個文件或目錄
./INSTALL-SOURCE: line 11: bin/mysqld_safe: 沒有那個文件或目錄
原因:ncurses/curses/termcap 庫沒有安裝
解決:
① 下載一個ncurses-5.6.tar.gz,wget http://ftp.gnu.org/pub/gnu/ncurses/ncurses-5.6.tar.gz
tar zxvf ncurses-5.6.tar.gz
cd ncurses-5.6
./configure –prefix=/usr –with-shared –without-debug
make
make install clean
② 或者yum install ncurses* -y
再./INSTALL-SOURCE