Apache簡單配置(4)搭建Discuz 7.0.0論壇

Apache 簡單配置(4)搭建Discuz 7.0.0論壇
RHEL5.3 基本網絡配置
1、
1 、RHEL5 U3:如圖1
clip_p_w_picpath002
(如圖1)
2 、#hostname //查看當前主機的主機名:如圖2
clip_p_w_picpath003
(如圖2)
3 、#vi /etc/sysconfig/network-scripts/ifcfg-eth0 編輯指定網絡接口配置文件:如圖3
clip_p_w_picpath005
(如圖3)
4 、#vi /etc/sysconfig/network 經過配置文件修改主機名:如圖4
clip_p_w_picpath007
(如圖4)
5 、在終端字符界面修改其字體和中文字體大小:如圖5
clip_p_w_picpath009
(如圖5)
6 、掛載光盤:如圖6
clip_p_w_picpath011
(如圖6)
7 、查看OpenSSH是否安裝:如圖7
clip_p_w_picpath013
(如圖7)
8 #vi /etc/hosts 設置本地 DNS 解析文件: 如圖8
clip_p_w_picpath015
(如圖8)
9 #vi /etc/resolv.conf 指定當前主機的 DNS 服務器,最多可指定三個: 如圖9
clip_p_w_picpath017
(如圖9)
10 、關閉iptables防火牆:如圖10
clip_p_w_picpath018
clip_p_w_picpath020
clip_p_w_picpath022
clip_p_w_picpath024
(如圖10)
2、DNS簡單配置
一、vim /etc/named.conf
clip_p_w_picpath026
二、vim /var/named/benet.com.zone
clip_p_w_picpath028
三、vim /var/named/1.168.192.in-addr.arpa.zone
clip_p_w_picpath030
3、nslookup查看
clip_p_w_picpath031
4、Apache簡單配置
1[root@dns ~]# cd /mnt/dvd/
[root@dns dvd]# ls
70bto70_request_UCHome.zip
Comsenz 核心產品 Discuz! 7_0_0 正式版發佈.mht
Discuz6.0.0SCGBK.zip
Discuz! 6_0_0到Discuz! 7_0_0升級圖文教程.mht
Discuz! 6_1_0到Discuz! 7_0_0升級圖文教程 .mht
Discuz_7.0.0_FULL_SC_GBK
Discuz_7.0.0_FULL_SC_GBK.zip
Discuz_7.0.0_FULL_SC_UTF8.zip
Discuz_7.0.0_SC_GBK
Discuz_7.0.0_SC_GBK.zip
Discuz_7.0.0_SC_UTF8.zip
Discuz!7_0_0 安裝圖文教程 .mht
Discuz!7_0 測試版升級到正式版方法 .mht
Discuzv6.0.0GBK簡體中文版.zip
httpd-2.2.11.tar.gz
mysql-5.1.39-linux-i686-glibc23.tar.gz
php-5.2.11.tar.gz
phpMyAdmin-3.2.2-all-languages.tar.gz
PHPWind_GBK_7.5all.rar
UCenter_1.5.0_SC_GBK
UCenter_1.5.0_SC_GBK.zip
UCenter_1.5.0_SC_UTF8.zip
UCenter_1.5.0_TC_UTF8.zip
ZendOptimizer-3.3.3-linux-glibc23-i386.tar.gz
[root@dns dvd]#
[root@dns dvd]# tar zxvf httpd-2.2.11.tar.gz
clip_p_w_picpath033
[root@dns dvd]# cd httpd-2.2.11
[root@dns httpd-2.2.11]# ./configure --prefix=/usr/local/apache --enable-modules=so
clip_p_w_picpath035
[root@dns httpd-2.2.11]# make
clip_p_w_picpath037
[root@dns httpd-2.2.11]# make install
clip_p_w_picpath039
[root@dns httpd-2.2.11]# /usr/local/apache/bin/apachectl start
[root@dns httpd-2.2.11]# netstat -ntl
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State
tcp 0 0 127.0.0.1:2208 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:111 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:690 0.0.0.0:* LISTEN
tcp 0 0 192.168.1.200:53 0.0.0.0:* LISTEN
tcp 0 0 127.0.0.1:53 0.0.0.0:* LISTEN
tcp 0 0 127.0.0.1:631 0.0.0.0:* LISTEN
tcp 0 0 127.0.0.1:953 0.0.0.0:* LISTEN
tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN
tcp 0 0 127.0.0.1:2207 0.0.0.0:* LISTEN
tcp 0 0 :::80 :::* LISTEN
tcp 0 0 :::22 :::* LISTEN
tcp 0 0 ::1:953 :::* LISTEN
[root@dns httpd-2.2.11]#
測試:
clip_p_w_picpath041
5、Mysql簡單配置
[root@dns ~]# cd /mnt/dvd/
[root@dns dvd]# tar zxvf mysql-5.1.39-linux-i686-glibc23.tar.gz
clip_p_w_picpath043
[root@dns dvd]#
[root@dns dvd]# mv mysql-5.1.39-linux-i686-glibc23 /usr/local/
[root@dns dvd]# cd /usr/local/
[root@dns local]# ln -s mysql-5.1.39-linux-i686-glibc23 mysql
[root@dns local]# groupadd mysql
[root@dns local]# useradd -g mysql mysql
[root@dns local]# /usr/local/mysql/scripts/mysql_install_db (注意會出錯,在/usr/local/mysql/路徑下安裝)
FATAL ERROR: Could not find ./bin/my_print_defaults
If you compiled from source, you need to run 'make install' to
copy the software into the correct location ready for operation.
If you are using a binary release, you must either be at the top
level of the extracted archive, or pass the --basedir option
pointing to that location.
[root@dns local]# cd /usr/local/mysql/
[root@dns mysql]# ./scripts/mysql_install_db
Installing MySQL system tables...
091008 17:35:55 [Warning] Forcing shutdown of 2 plugins
OK
Filling help tables...
091008 17:35:56 [Warning] Forcing shutdown of 2 plugins
OK
To start mysqld at boot time you have to copy
support-files/mysql.server to the right place for your system
PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
To do so, start the server, then issue the following commands:
./bin/mysqladmin -u root password 'new-password'
./bin/mysqladmin -u root -h dns password 'new-password'
Alternatively you can run:
./bin/mysql_secure_installation
which will also give you the option of removing the test
databases and anonymous user created by default. This is
strongly recommended for production servers.
See the manual for more instructions.
You can start the MySQL daemon with:
cd . ; ./bin/mysqld_safe &
You can test the MySQL daemon with mysql-test-run.pl
cd ./mysql-test ; perl mysql-test-run.pl
Please report any problems with the ./bin/mysqlbug script!
The latest information about MySQL is available at http://www.mysql.com/
Support MySQL by buying support/licenses from http://shop.mysql.com/
clip_p_w_picpath045
[root@dns mysql]# chown -R root /usr/local/mysql/
[root@dns mysql]# chown -R mysql /usr/local/mysql/data/
[root@dns mysql]# chown -R mysql /usr/local/mysql/
[root@dns mysql]# /usr/local/mysql/bin/mysqld_safe -user=mysql &
[1] 20120
[root@dns mysql]# 091008 17:48:42 mysqld_safe Logging to '/usr/local/mysql/data/dns.err'.
091008 17:48:42 mysqld_safe Starting mysqld daemon with databases from /usr/local/mysql/data
[root@dns mysql]# /usr/local/mysql/bin/mysqladmin -u root password wishes
[root@dns mysql]# /usr/local/mysql/bin/mysql -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.1.39 MySQL Community Server (GPL)
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> exit
Bye
[root@dns mysql]# netstat -ntl
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State
tcp 0 0 127.0.0.1:2208 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:3306 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:111 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:690 0.0.0.0:* LISTEN
tcp 0 0 192.168.1.200:53 0.0.0.0:* LISTEN
tcp 0 0 127.0.0.1:53 0.0.0.0:* LISTEN
tcp 0 0 127.0.0.1:631 0.0.0.0:* LISTEN
tcp 0 0 127.0.0.1:953 0.0.0.0:* LISTEN
tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN
tcp 0 0 127.0.0.1:2207 0.0.0.0:* LISTEN
tcp 0 0 :::80 :::* LISTEN
tcp 0 0 :::22 :::* LISTEN
tcp 0 0 ::1:953 :::* LISTEN
clip_p_w_picpath047
6、PHP簡單配置
[root@dns mysql]# cd
[root@dns ~]# cd /mnt/dvd/
[root@dns dvd]# tar zxvf php-5.2.11.tar.gz
clip_p_w_picpath049
[root@dns dvd]# cd php-5.2.11
[root@dnsphp-5.2.11]# ./configure --prefix=/usr/local/php --with-apxs2=/usr/local/apache/bin/apxs --with-mysql=/usr/local/mysql
clip_p_w_picpath051
[root@dns php-5.2.11]# make
clip_p_w_picpath053
[root@dns php-5.2.11]# make install
clip_p_w_picpath055
[root@dns php-5.2.11]# cp php.ini-dist /usr/local/lib/php.ini
[root@dns php-5.2.11]# vim /usr/local/apache/conf/httpd.conf
1. 確認PHP模塊已經添加?
LoadModule php5_module modules/libphp5.so
在53行,若是咱們在安裝php時,在參數中跟加了apxs,那麼apache的配置文件中已經存在了此項,如沒添加則手工添加
clip_p_w_picpath057
二、修改98行
clip_p_w_picpath059
三、讓apache識別*.php文件 310行
在apache 配置文件中添加 AddType application/x-httpd-php .php
clip_p_w_picpath061
四、測試apache和php是否整合成功
[root@dns php-5.2.11]# cd /usr/local/apache/htdocs/
You have new mail in /var/spool/mail/root
[root@dns htdocs]# vim index.php
<?php
phpinfo();
?>
~
~
"index.php" [新] 3L, 20C 已寫入
[root@dns htdocs]# /usr/local/apache/bin/apachectl stop (注意會出錯,修改SELinux)
httpd: Syntax error on line 53 of /usr/local/apache/conf/httpd.conf: Cannot load /usr/local/apache/modules/libphp5.so into
server: /usr/local/apache/modules/libphp5.so: cannot restore segment prot after reloc: Permission denied
[root@dns htdocs]#
[root@dns htdocs]# vim /etc/selinux/config
# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
# enforcing - SELinux security policy is enforced.
# permissive - SELinux prints warnings instead of enforcing.
# disabled - SELinux is fully disabled.
SELINUX= disabled
# SELINUXTYPE= type of policy in use. Possible values are:
# targeted - Only targeted network daemons are protected.
# strict - Full SELinux protection.
SELINUXTYPE=targeted
~
~
"/etc/selinux/config" 10L, 447C 已寫入
[root@dns htdocs]# reboot
clip_p_w_picpath063
訪問,在瀏覽器中輸入 http://192.168.1.200/index.php 出現一下界面則說明整合成功
clip_p_w_picpath065
7、ZendOptimizer簡單配置
[root@dns ~]# cd /mnt/dvd/
[root@dns dvd]# tar zxvf ZendOptimizer-3.3.3-linux-glibc23-i386.tar.gz
clip_p_w_picpath067
[root@dns dvd]# cd ZendOptimizer-3.3.3-linux-glibc23-i386
[root@dns ZendOptimizer-3.3.3-linux-glibc23-i386]# ls
data install install-tty LICENSE README-ZendOptimizer
EULA-ZendOptimizer install.sh Inventory.xml md5 zui_files
[root@dns ZendOptimizer-3.3.3-linux-glibc23-i386]# ./intsall.sh
clip_p_w_picpath069
clip_p_w_picpath071
clip_p_w_picpath073
clip_p_w_picpath075
clip_p_w_picpath077
clip_p_w_picpath079
clip_p_w_picpath081
clip_p_w_picpath083
clip_p_w_picpath085
clip_p_w_picpath087
clip_p_w_picpath089
clip_p_w_picpath091
clip_p_w_picpath093
8、安裝phpMyAdmin
[root@dns ~]# cd /mnt/dvd/
[root@dns dvd]# tar zxvf phpMyAdmin-3.2.2-all-languages.tar.gz
clip_p_w_picpath095
[root@dns dvd]# mv phpMyAdmin-3.2.2-all-languages phpmyadmin
[root@dns dvd]# mv phpmyadmin /usr/local/apache/htdocs/
測試:
一、 肯定mysqld和httpd服務啓動(若是沒有啓動服務, phpmyadmin 不能安裝。使用netstat –ntl查看端口
二、 [root@dns dvd]# /usr/local/mysql/bin/mysqld_safe -user=mysql &
[root@dns httpd-2.2.11]# /usr/local/apache/bin/apachectl start
三、[root@dns dvd]# netstat -ntl
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State
tcp 0 0 127.0.0.1:2208 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:3306 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:111 0.0.0.0:* LISTEN
tcp 0 0 127.0.0.1:631 0.0.0.0:* LISTEN
tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:665 0.0.0.0:* LISTEN
tcp 0 0 127.0.0.1:2207 0.0.0.0:* LISTEN
tcp 0 0 :::80 :::* LISTEN
tcp 0 0 :::22 :::* LISTEN
下面開始安裝phpmyadmin,在瀏覽器中輸入 http://192.168.1.200/phpmyadmin/index.php
,會彈出一個對話框,要求輸入用戶名和密碼(超級管理員)
clip_p_w_picpath097
clip_p_w_picpath099
9、UCenter簡單配置
在安裝discuz以前咱們還要安裝UCenter,UCenter是discuz論壇的管理模板
一、新建目錄和更改權限
[root@dns ~]# cd /usr/local/apache/
[root@dns apache]# ls
bin cgi-bin error include logs manual
build conf icons lib man modules
[root@dns apache]# mkdir htdocs
[root@dns apache]# ls
bin cgi-bin error icons lib man modules
build conf htdocs include logs manual
[root@dns apache]# cd htdocs
[root@dns htdocs]# ls
[root@dns htdocs]# ll
總計 0
[root@dns htdocs]# mkdir upload-ucenter
[root@dns htdocs]# ls
upload-ucenter
[root@dns htdocs]# cd
[root@dns ~]# chmod -R 777 /usr/local/apache/htdocs/upload-ucenter/
二、複製UCenter_1.5.0_SC_GBK裏面upload-ucenter文件 到/usr/local/apache/htdocs/upload-ucenter/下
[root@dns ~]# cd /mnt/dvd/
[root@dns dvd]# cd UCenter_1.5.0_SC_GBK
[root@dns UCenter_1.5.0_SC_GBK]# mv upload upload-ucenter
[root@dns UCenter_1.5.0_SC_GBK]# mv /usr/local/apache/htdocs/ upload-ucenter
[root@dns UCenter_1.5.0_SC_GBK]# ls
advanced readme upload-ucenter utilities
[root@dns UCenter_1.5.0_SC_GBK]# cp -r upload-ucenter/* /usr/local/apache/htdocs/upload-ucenter/
[root@dns UCenter_1.5.0_SC_GBK]# cd
[root@dns ~]# cd /usr/local/apache/htdocs/upload-ucenter/
[root@dns upload-ucenter]# ls
admin.php control htdocs install model robots.txt
api crossdomain.xml p_w_picpaths js plugin upgrade
avatar.php data index.php lib release view
三、安裝ucenter,而後給upload/data文件下的這些文件加上777的權限,不然在安裝時沒有權限對數據庫進行寫入
[root@dns ~]# cd /usr/local/apache/htdocs/upload-ucenter/
[root@dns upload-ucenter]# ls
admin.php control htdocs install model robots.txt
api crossdomain.xml p_w_picpaths js plugin upgrade
avatar.php data index.php lib release view
[root@dns upload-ucenter]# chmod 777 ./data/
[root@dns upload-ucenter]# chmod 777 ./data/cache/
[root@dns upload-ucenter]# chmod 777 ./data/view/
[root@dns upload-ucenter]# chmod 777 ./data/avatar/
[root@dns upload-ucenter]# chmod 777 ./data/logs/
[root@dns upload-ucenter]# chmod 777 ./data/backup/
[root@dns upload-ucenter]# chmod 777 ./data/tmp/
四、IE訪問http://192.168.1.200/upload-ucenter/install/index.php 進行UCenter的安裝
clip_p_w_picpath101
clip_p_w_picpath103
clip_p_w_picpath105
clip_p_w_picpath107
clip_p_w_picpath109
clip_p_w_picpath111
clip_p_w_picpath113
10、discuz簡單配置
一、複製Discuz_7.0.0_SC_GBK裏面upload文件 到/usr/local/apache/htdocs/下
[root@dns dvd]# cd Discuz_7.0.0_SC_GBK
[root@dns Discuz_7.0.0_SC_GBK]# ls
readme upload utilities
[root@dns Discuz_7.0.0_SC_GBK]# cp -r upload/* /usr/local/apache/htdocs/
[root@dns Discuz_7.0.0_SC_GBK]# cd
[root@dns ~]# cd /usr/local/apache/htdocs/
[root@dns htdocs]# ls
admin forumdisplay.php modcp sitemap.php
admincp.php frame.php modcp.php space.php
ajax.php htdocs model stats.php
announcement.php p_w_picpaths my.php tag.php
api include plugin task.php
archiver index.php plugin.php templates
p_w_upload.php install plugins topicadmin.php
p_w_uploads invite.php pm.php topic.php
campaign.php ipdata post.php trade.php
config.inc.php js redirect.php uc_client
control leftmenu.php register.php upgrade
crossdomain.xml lib relatekw.php upload-ucenter
data logging.php relatethread.php video.php
discuz_version.php magic.php release view
eccredit.php medal.php robots.txt viewthread.php
faq.php member.php rss.php wap
favicon.ico memcp.php search.php
forumdata misc.php seccode.php
二、htdocs文件下的這些文件加上777的權限,不然在安裝時沒有權限對數據庫進行寫入
[root@dns htdocs]# chmod 777 templates/
[root@dns htdocs]# chmod 777 templates/default/
[root@dns htdocs]# chmod 777 ./p_w_uploads
[root@dns htdocs]# chmod 777 ./config.inc.php
[root@dns htdocs]# chmod 777 ./forumdata/
[root@dns htdocs]# chmod 777 ./forumdata/cache/
[root@dns htdocs]# chmod 777 ./forumdata/templates/
[root@dns htdocs]# chmod 777 ./forumdata/threadcaches/
[root@dns htdocs]# chmod 777 ./forumdata/logs
[root@dns htdocs]# chmod 777 ./uc_client/data/cache/
三、IE訪問http://192.168.1.200/install/index.php 進行discuz的安裝
clip_p_w_picpath115
clip_p_w_picpath117
clip_p_w_picpath107[1]
clip_p_w_picpath109[1]
clip_p_w_picpath121
clip_p_w_picpath123
clip_p_w_picpath125
clip_p_w_picpath127
clip_p_w_picpath129
 
配置文件在附件裏面:
若有不懂的地方,請call我!qq:357714938 mail:hongwish8es@126.com
相關文章
相關標籤/搜索