linux服務器用lighttpd+mysql5+php5+SupeSite/X-Space+discuz構建社區門戶

一、安裝系統環境
1、系統:centos5
2、測試在vm5.5
準備軟件
lighttpd-1.4.18
下載地址
mysql-5.0.41
part1下載地址
part2下載地址
part3下載地址
php-5.2.3
下載地址
SupeSite/X-Space
part1下載地址
part2下載地址
part3下載地址
discuz
下載地址
二、搭建web服務器安裝過程
1、mysql5安裝
$ tar zxvf mysql-5.0.27.tar.gz
$ cd mysql-5.0.27
# groupadd mysql          
# useradd -g mysql mysql  
# ./configure --prefix=/data/apps/mysql
# make
# make install
# cp support-files/my-medium.cnf /etc/my.cnf
# cd /data/apps/mysql
# bin/mysql_install_db --user=mysql
# chown -R root .
# chown -R mysql var
# chgrp -R mysql .
# bin/mysqld_safe --user=mysql &

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

2、lighttpd安裝
# tar -zxvf lighttpd-1.4.18.tar.gz
# cd lighttpd-1.4.18
# ./configure --prefix=/data/apps/lighttpd
# make
# make install
# mkdir /data/apps/lighttpd/conf
# mkdir /data/apps/lighttpd/log
# mkdir /data/apps/lighttpd/htdocs
#mv ./doc/lighttpd.conf /data/apps/lighttpd/conf/
編輯配置  /data/apps/lighttpd/conf/lighttpd.conf 文件
#nano /data/apps/lighttpd/conf/lighttpd.conf
修改下面紅色標註處
--------------------------------------------------------------------------------------------------------
server.modules         = (
                    "mod_rewrite",          (去掉前面的#號)
                    "mod_redirect",
                    "mod_access",
                    "mod_fastcgi",
                    "mod_simple_vhost",
                    "mod_compress",
                    "mod_accesslog" )
註釋下面三行
#$HTTP["url"] =~ "/.pdf$" {
#server.range-requests = "disable"
#}

server.document-root = "/data/apps/lighttpd/htdocs"
server.errorlog = "/data/apps/lighttpd/log/lighttpd.error.log"
accesslog.filename = "/data/apps/lighttpd/log/access.log"

去掉下面的#號開始php功能
fastcgi.server             = ( ".php" =>
                               ( "localhost" =>
                                 (
                                   "socket" => "/data/apps/lighttpd/php-fastcgi.socket",
                                   "bin-path" => "/data/apps/php-fcgi/bin/php-cgi"
                                 )
                               )
                            )

$HTTP["host"] == "www.test.com" {
server.document-root = "/data/apps/lighttpd/htdocs/ss"
index-file.names = ( "index.shtml", "index.html",
"index.htm", "default.htm", "index.php" )
}

$HTTP["host"] == "bbs.test.com" {
server.document-root = "/data/apps/lighttpd/htdocs/bbs"
index-file.names = ( "index.shtml", "index.html",
"index.htm", "default.htm", "index.php" )
}


------------------------------------------------------------------------------------------------------------------------
#/data/apps/lighttpd/sbin/lighttpd -f /data/apps/lighttpd/conf/lighttpd.conf (用這個命令來啓動lighttpd服務,現在還沒有安裝php所以會報錯)

++++++++++++++++++++++++++++++++++++++++++++++++++++++++
3、php5安裝
.# tar -zxvf php-5.2.3.tar.gz
# cd php-5.2.3
#./configure --divfix=/data/apps/php-fcgi --enable-fastcgi --with-mysql=/data/apps/mysql --enable-zend-multibyte --with-config-file-path=/data/apps/php-fcgi/conf --enable-discard-path --enable-force-cgi-redirect
# make
# make install
#mkdir /data/apps/php-fcgi/conf
#cp php.ini-dist /data/apps/php-fcgi/confphp.ini

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
我們現在測試一下php
在/data/apps/lighttpd/htdocs
新建一個名字爲phpinfo.php文件
<?php
echo phpinfo();
?>
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

我們把下載的SupeSite/X-Space和discuz都是解壓,注意我們我上傳文件時一定要注意用二進制上傳

我們把upload目錄都上傳到  /data/apps/lighttpd/
把SupeSite/X-Space的upload目錄改名爲ss
把discuz的upload目錄改名爲bbs
現在我們把自己host寫入 把www.test.com和bbs.test.com  解析到你服務器地址
我們用遊覽器打開http://bbs.test.com/install.php開始安裝
安裝前還需要把一些目錄的權限賦777權限
discuz的是
chmod 777 ./templates /
chmod 777 ./templates/default /
chmod 777 ./templates/default/*.* /
chmod 777 ./attachments /
chmod 777 ./customavatars /
chmod 777 ./forumdata /
chmod 777 ./forumdata/cache /
chmod 777 ./forumdata/templates /
chmod 777 ./forumdata/threadcaches /
chmod 777 ./forumdata/logs /
SupeSite/X-Space的是
chmod 777 ./config.php /
chmod 777 ./attachment /
chmod 777 ./archiver /
chmod 777 ./cache/tpl /
chmod 777 ./channel /
chmod 777 ./channel/*.* /
chmod 777 ./data /
chmod 777 ./data/robot /
chmod 777 ./data/temp /
chmod 777 ./data/system /
chmod 777 ./html /
chmod 777 ./log /
chmod 777 ./styles /
chmod 777 ./templates/
chmod 777 ./templates/default /
chmod 777 ./templates/default/*.* /
chmod 777 ./user /
chmod 777 ./video /
chmod 777 ./video/*.* /

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