linux下網站平臺的搭建

linux下網站平臺的搭建
實驗環境 VMware 6.5.2+redhat Enterprise 5 AS
clip_p_w_picpath002
我的內核版本
本文實驗基礎環境已經做好了一個dns的解析
本文中的幾個組件均爲源碼包安裝 ,介於可能有版本的不同安裝略有差異
clip_p_w_picpath004
本文大致可以分爲以下步驟
mysql的安裝與簡單配置
apache的安裝與簡單配置
PHP的安裝
論壇的配置
由於之前已經有一篇關於 mysql 源碼包的安裝 所以 再此不在詳細講述
具體請參考
http://yuzeying.blog.51cto.com/644976/154611
下面安裝 apache的源碼包
clip_p_w_picpath006
[root@localhost tmp]# tar zxvf httpd-2.0.58.tar.gz
clip_p_w_picpath008
解壓之後
進入源碼目錄
[root@localhost tmp]# cd httpd-2.0.58
[root@localhost httpd-2.0.58]# ls
ABOUT_APACHE CHANGES InstallBin.dsp os
acconfig.h config.layout LAYOUT README
acinclude.m4 configure libhttpd.dsp README.platforms
Apache.dsp configure.in LICENSE server
Apache.dsw docs Makefile.in srclib
apachenw.mcp.zip emacs-style Makefile.win support
build httpd.spec modules test
BuildBin.dsp include NOTICE VERSIONING
buildconf INSTALL NWGNUmakefile
[root@localhost httpd-2.0.58]#
編譯前的準備
[root@localhost httpd-2.0.58]# ./configure --prefix=/usr/local/apache --enable-module=so
# apache 動態調用mysql
clip_p_w_picpath010
下一步 編譯
[root@localhost httpd-2.0.58]# make
clip_p_w_picpath012
這個過程稍顯緩慢
下一步 編譯安裝
[root@localhost httpd-2.0.58]# make install
clip_p_w_picpath014
安裝完成
啓動一下看看
[root@localhost httpd-2.0.58]#/usr/local/apache/bin/apachectl start

clip_p_w_picpath016
下一步 PHP的安裝
clip_p_w_picpath018
拷貝 或下載 php源碼包
[root@localhost tmp]# tar zxvf php-4.4.9.tar.gz
clip_p_w_picpath020
解壓 完畢 進入源碼目錄
[root@localhost tmp]# cd php-4.4.9
[root@localhost php-4.4.9]# ls
acconfig.h NEWS
acconfig.h.in pear
acinclude.m4 php4.spec.in
aclocal.m4 php.gif
build php.ini-dist
buildconf php.ini-recommended
CODING_STANDARDS README.CVS-RULES
config.guess README.EXTENSIONS
config.sub README.EXT_SKEL
configure README.PARAMETER_PARSING_API
configure.in README.QNX
CREDITS README.SELF-CONTAINED-EXTENSIONS
cvsclean README.STREAMS
ext README.SUBMITTING_PATCH
EXTENSIONS README.TESTING
footer README.UNIX-BUILD-SYSTEM
generated_lists README.Zeus
genfiles regex
header run-tests.php
INSTALL sapi
install-sh scripts
LICENSE server-tests.php
ltmain.sh snapshot
main stamp-h.in
makedist stub.c
Makefile.frag tests
Makefile.global TODO
makerpm TODO_SEGFAULTS
missing TSRM
mkinstalldirs win32
netware Zend
編譯前的準備
[[email protected]]#./configure --prefix=/usr/local/php --with-mysql --with-apxs2=/usr/local/apache/bin/apxs
等待
clip_p_w_picpath022
clip_p_w_picpath024
[root@localhost php-4.4.9]# make
編譯
clip_p_w_picpath026
編譯安裝
[root@localhost php-4.4.9]# make install
Installing PHP SAPI module: cgi
Installing PHP CGI into: /usr/local/bin/
Installing PEAR environment: /usr/local/lib/php/
[PEAR] Archive_Tar - installed: 1.3.2
[PEAR] Console_Getopt - installed: 1.2.1
[PEAR] HTML_Template_IT- installed: 1.1
[PEAR] Net_UserAgent_Detect- installed: 2.0.1
warning: pear/PEAR requires package "pear/Structures_Graph" (recommended version 1.0.2)
pear/PEAR can optionally use package "pear/XML_RPC" (version >= 1.4.0)
[PEAR] PEAR - installed: 1.5.0
Wrote PEAR system config file at: /usr/local/etc/pear.conf
You may want to add: /usr/local/lib/php to your php.ini include_path
[PEAR] Structures_Graph- installed: 1.0.2
Installing build environment: /usr/local/lib/php/build/
Installing header files: /usr/local/include/php/
Installing helper programs: /usr/local/bin/
program: phpize
program: php-config
Installing man pages: /usr/local/man/man1/
page: phpize.1
page: php-config.1
[root@localhost php-4.4.9]#
下一步 複製PHP配置文件,注意路徑
[root@localhost php-4.4.9]# cp /tmp/php-4.4.9/php.ini-dist /usr/local/lib/php.ini
[root@localhost php-4.4.9]#
這裏注意大小寫
修改apache配置文件 使其能夠識別.PHP結尾的網頁文件
[root@localhost php-4.4.9]# vi /usr/local/apache/conf/httpd.conf
clip_p_w_picpath028在末尾添加
AddType application/x-httpd-php .php
注意大小寫和空格
[root@localhost php-4.4.9]# vi /usr/local/apache/htdocs/index.php
clip_p_w_picpath030
回車繼續
clip_p_w_picpath032
這裏呢是一個很簡單的測設語句 注意是以分號結束的
[root@localhost php-4.4.9]#/usr/local/apache/bin/apachectl stop
[root@localhost php-4.4.9]#/usr/local/apache/bin/apachectl start
重啓apache服務
clip_p_w_picpath034
我的ip設置
在瀏覽器裏輸入
clip_p_w_picpath036
如果這裏出現nofound的話 參考以下解決方法
我們先用/usr/local/apache/bin/apachectl start啓動apache服務,起不來的話
[root@localhost ~]# /usr/local/apache/bin/apachectl start
(98)Address already in use: make_sock: could not bind to address [::]:80
no listening sockets available, shutting down
Unable to open logs
[root@localhost ~]# killall -9 httpd
[root@localhost ~]# /usr/local/apache/bin/apachectl start
[root@localhost ~]#
確信步驟沒有錯誤,配置文件沒有其他改動的話
建議把進程結束 在啓動一次
killall -9 httpd
/usr/local/apache/bin/apachectl start
下一步
由於之前的介紹mysql的安裝的文章沒有 設置遠程密碼
所以我們現在需要設置一個給予Mysql數據庫遠程訪問權限
[root@localhost ~]# /usr/local/mysql/bin/mysqladmin -u root password Ccjsj1200
[root@localhost ~]#
我的本地計算機的密碼爲Ccjsj1200 遠程的同樣是這個
不要把遠程密碼設置成別的,不然本地登錄會出問題的,我已經試過了,大家就不用在試了
[root@localhost ~]# /usr/local/mysql/bin/mysql
ERROR 1045: Access denied for user: 'root@localhost' (Using password: NO)
[root@localhost ~]#
如果我們現在這樣登錄的話是會出現錯誤的,所以要這樣登錄
[root@localhost ~]# /usr/local/mysql/bin/mysql -u root -p
Enter password:
####註釋一下這裏輸入你的密碼Ccjsj1200
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 4 to server version: 4.0.27-log
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql>
這時我們成功登陸數據庫
設置MySQL遠程管理員密碼,在MySQL提示符中輸入
mysql> grant all on *.* to root@'%' identified by 'Ccjsj1200' with grant option;
Query OK, 0 rows affected (0.00 sec)
mysql>
clip_p_w_picpath038
MySQL庫中建立phpbb數據庫
mysql> create database phpbb;
####注意以分號結尾
Query OK, 1 row affected (0.00 sec)
mysql>
mysql> show databases;
+----------+
| Database |
+----------+
| mysql |
| phpbb |
| test |
+----------+
3 rows in set (0.00 sec)
mysql>
clip_p_w_picpath040
把語言包和論壇源代碼拷貝至/tmp目錄下
mysql>quit
Bye
[root@localhost ~]# cd /tmp
[root@localhost tmp]# ls
gconfd-root scim-bridge-0.3.0.lockfile-0@localhost:0.0
httpd-2.0.58 scim-bridge-0.3.0.socket-0@localhost:0.0
httpd-2.0.58.tar.gz scim-helper-manager-socket-root
keyring-hVSZal scim-panel-socket:0-root
lang_chinese_simplified.tar.gz scim-socket-frontend-root
mapping-root sealert.log
mysql-4.0.27 ssh-fRrzDL3480
mysql-4.0.27.tar.gz virtual-root.Xh7y9O
mysql.sock VMwareDnD
orbit-root vmware-root
php-4.4.9 VMwareTools-7.8.4-126130.tar.gz
php-4.4.9.tar.gz vmware-tools-distrib
[root@localhost tmp]# tar zxvf lang_chinese_simplified.tar.gz
clip_p_w_picpath042
[root@localhost tmp]# tar zxvf phpBB-2.0.20.tar.gz
複製語言包內容到phpBB2language目錄下
[root@localhost tmp]# cp -r /tmp/lang_chinese_simplified /tmp/phpBB2/language/
[root@localhost tmp]#
複製論壇安裝源代碼包內容到apache主頁目錄下
[root@localhost tmp]# cp -r /tmp/phpBB2 /usr/local/apache/htdocs
[root@localhost tmp]#
這裏注意你安裝的目錄即可
開始安裝phpbb
瀏覽器裏輸入
clip_p_w_picpath044 clip_p_w_picpath046
填寫相關信息
之後選擇開始安裝
clip_p_w_picpath048
您 的系統設定檔無法寫入, 您可以點擊下方按鈕下載設定文件, 再將這個文件上傳至 phpBB 2 論壇的資料夾. 在完成後您必須使用管理員帳號跟密碼登陸並進入系統管理控制面板 (在您登陸後, 下方將出現一個進入"系統管理控制面板"的鏈接) 檢查您的基本配置設定. 最後感謝您選擇使用安裝 phpBB 2 論壇系統.
clip_p_w_picpath050
clip_p_w_picpath052
我們打開看一下
clip_p_w_picpath054
用新下載的config.conf文件覆蓋原有的舊config.conf文件
[root@localhost ~]# cd /root/Desktop
[root@localhost Desktop]#
[root@localhost Desktop]# cp config.php /usr/local/apache/htdocs/phpBB2
cp:是否覆蓋“/usr/local/apache/htdocs/phpBB2/config.php”? y
[root@localhost Desktop]#
####是否覆蓋這裏選擇y
進入到phpBB2目錄下,刪除安裝文件contribinstall,以便正常訪問
[root@localhost Desktop]# cd /usr/local/apache/htdocs/phpBB2
[root@localhost phpBB2]# ll
總計 432
drwxr-xr-x 2 root root 4096 08-23 17:35 admin
drwxr-xr-x 2 root root 4096 08-23 17:35 cache
-rw-r--r-- 1 root root 6660 08-23 17:35 common.php
-rw-r--r-- 1 root root 273 08-23 19:00 config.php
drwxr-xr-x 2 root root 4096 08-23 17:35 contrib
drwxr-xr-x 2 root root 4096 08-23 17:35 db
drwxr-xr-x 2 root root 4096 08-23 17:35 docs
-rw-r--r-- 1 root root 810 08-23 17:35 extension.inc
-rw-r--r-- 1 root root 3643 08-23 17:35 faq.php
-rw-r--r-- 1 root root 45807 08-23 17:35 groupcp.php
drwxr-xr-x 4 root root 4096 08-23 17:35 p_w_picpaths
drwxr-xr-x 2 root root 4096 08-23 17:35 includes
-rw-r--r-- 1 root root 14706 08-23 17:35 index.php
drwxr-xr-x 3 root root 4096 08-23 17:35 install
drwxr-xr-x 4 root root 4096 08-23 17:35 language
-rw-r--r-- 1 root root 9492 08-23 17:35 login.php
-rw-r--r-- 1 root root 12208 08-23 17:35 memberlist.php
-rw-r--r-- 1 root root 39011 08-23 17:35 modcp.php
-rw-r--r-- 1 root root 34911 08-23 17:35 posting.php
-rw-r--r-- 1 root root 73811 08-23 17:35 privmsg.php
-rw-r--r-- 1 root root 3428 08-23 17:35 profile.php
-rw-r--r-- 1 root root 43661 08-23 17:35 search.php
drwxr-xr-x 3 root root 4096 08-23 17:35 templates
-rw-r--r-- 1 root root 23154 08-23 17:35 viewforum.php
-rw-r--r-- 1 root root 7233 08-23 17:35 viewonline.php
-rw-r--r-- 1 root root 45235 08-23 17:35 viewtopic.php
[root@localhost phpBB2]#
[root@localhost phpBB2]# rm -rf contrib
[root@localhost phpBB2]# rm -rf install
[root@localhost phpBB2]#
再次訪問改論壇
登陸一下
clip_p_w_picpath058
clip_p_w_picpath060
clip_p_w_picpath062clip_p_w_picpath064
clip_p_w_picpath066
後面的這些創建 就變得很簡單了,就不在此詳細的描述了,截幾個圖大家看看吧
clip_p_w_picpath068
這是仿照maxpda 做的粗糙的頁面,反正有那麼點意思
clip_p_w_picpath070
這個是註冊用戶的時候的畫面
clip_p_w_picpath072
這是回覆帖子的畫面
clip_p_w_picpath074
參考兩篇博文
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章