手记

Apache简单配置(3)搭建Discuz 6.0.0论坛

Apache简单配置(3)搭建Discuz 6.0.0论坛

案例:

企业需求

公司要为自己网站搭建一个论坛来实现广大用户的在线交流,内网采用的IP地址为192.168.1.200,要求服务器满足1000人同时在线访问,管理员邮箱设置root@benet.com,首页设置index.php。Apache根目录和文档保持默认设置/var/www/html/bbs

RHEL5.3 基本网络配置

一、

1、RHEL5 U3:如图1

clip_image002

(如图1)

2、#hostname //查看当前主机的主机名:如图2

clip_image003

(如图2)

3、#vi /etc/sysconfig/network-scripts/ifcfg-eth0 编辑指定网络接口配置文件:如图3

clip_image005

(如图3)

4、#vi /etc/sysconfig/network 通过配置文件修改主机名:如图4

clip_image007

(如图4)

5、在终端字符界面修改其字体和中文字体大小:如图5

clip_image009

(如图5)

6、挂载光盘:如图6

clip_image011

(如图6)

7、查看OpenSSH是否安装:如图7

clip_image013

(如图7)

8、#vi /etc/hosts 设置本地DNS解析文件:如图8

clip_image015

(如图8)

9、#vi /etc/resolv.conf 指定当前主机的DNS服务器,最多可指定三个:如图9

clip_image017

(如图9)

10、关闭iptables防火墙:如图10

clip_image018

clip_image020

clip_image022

clip_image024

(如图10)

二、DNS简单配置

1、vim /etc/named.conf

clip_image026

2、vim /var/named/benet.com.zone

clip_image028

3、vim /var/named/1.168.192.in-addr.arpa.zone

clip_image030

三、nslookup查看

clip_image031

四、Apache简单配置

1、HTTPD安装

httpd-2.2.3-11.el5.i386.rpm

httpd-devel-2.2.3-11.el5.i386.rpm

httpd-manual-2.2.3-11.el5.i386.rpm

system-config-httpd-1.3.3.1-1.el5.noarch.rpm

[root@dns Server]# ls -l | grep httpd

-r--r--r-- 55 root root 1270589 2008-12-11 httpd-2.2.3-22.el5.i386.rpm

-r--r--r-- 63 root root 151651 2008-12-11 httpd-devel-2.2.3-22.el5.i386.rpm

-r--r--r-- 55 root root 852783 2008-12-11 httpd-manual-2.2.3-22.el5.i386.rpm

-r--r--r-- 148 root root 611542 2007-11-27 system-config-httpd-1.3.3.3-1.el5.noarch.rpm

[root@dns Server]# rpm -ivh --aid httpd-2.2.3-22.el5.i386.rpm

warning: httpd-2.2.3-22.el5.i386.rpm: Header V3 DSA signature: NOKEY, key ID 37017186

Preparing... ########################################### [100%]

1:httpd ########################################### [100%]

[root@dns Server]# rpm -ivh --aid httpd-devel-2.2.3-22.el5.i386.rpm

warning: httpd-devel-2.2.3-22.el5.i386.rpm: Header V3 DSA signature: NOKEY, key ID 37017186

error: Failed dependencies:

apr-devel is needed by httpd-devel-2.2.3-22.el5.i386

apr-util-devel is needed by httpd-devel-2.2.3-22.el5.i386

[root@dns Server]# rpm -ivh --aid apr-devel-1.2.7-11.i386.rpm

warning: apr-devel-1.2.7-11.i386.rpm: Header V3 DSA signature: NOKEY, key ID 37017186

Preparing... ########################################### [100%]

1:apr-devel ########################################### [100%]

[root@dns Server]# rpm -ivh --aid apr-util-devel-1.2.7-7.el5.i386.rpm

warning: apr-util-devel-1.2.7-7.el5.i386.rpm: Header V3 DSA signature: NOKEY, key ID 37017186

Preparing... ########################################### [100%]

1:apr-util-devel ########################################### [100%]

[root@dns Server]# rpm -ivh --aid httpd-devel-2.2.3-22.el5.i386.rpm

warning: httpd-devel-2.2.3-22.el5.i386.rpm: Header V3 DSA signature: NOKEY, key ID 37017186

Preparing... ########################################### [100%]

1:httpd-devel ########################################### [100%]

[root@dns Server]# rpm -ivh --aid httpd-manual-2.2.3-22.el5.i386.rpm

warning: httpd-manual-2.2.3-22.el5.i386.rpm: Header V3 DSA signature: NOKEY, key ID 37017186

Preparing... ########################################### [100%]

1:httpd-manual ########################################### [100%]

[root@dns Server]# rpm -ivh --aid system-config-httpd-1.3.3.3-1.el5.noarch.rpm

warning: system-config-httpd-1.3.3.3-1.el5.noarch.rpm: Header V3 DSA signature: NOKEY, key ID 37017186

error: Failed dependencies:

libxslt-python is needed by system-config-httpd-1.3.3.3-1.el5.noarch

[root@dns Server]# rpm -ivh --aid libxslt-python-1.1.17-2.el5_2.2.i386.rpm

warning: libxslt-python-1.1.17-2.el5_2.2.i386.rpm: Header V3 DSA signature: NOKEY, key ID 37017186

Preparing... ########################################### [100%]

1:libxslt-python ########################################### [100%]

[root@dns Server]# rpm -ivh --aid system-config-httpd-1.3.3.3-1.el5.noarch.rpm

warning: system-config-httpd-1.3.3.3-1.el5.noarch.rpm: Header V3 DSA signature: NOKEY, key ID 37017186

Preparing... ########################################### [100%]

1:system-config-httpd ########################################### [100%]

[root@dns Server]# cd /var/www/html/

[root@dns html]# ls -l

总计 0

[root@dns html]# echo hello.This is my web! > index.html

[root@dns html]# ls -l

总计 8

-rw-r--r-- 1 root root 22 09-27 17:28 index.html

[root@dns html]# chkconfig --level 35 httpd on

[root@dns html]# chkconfig --list httpd

httpd 0:关闭 1:关闭 2:关闭 3:启用 4:关闭 5:启用 6:关闭

clip_image033

clip_image035

2、MYSQL安装:

安装MySQL的时候,特别要注意安装顺序哈~否则MySQL无法正常安装成功,参考以下安装顺序就可以顺序完成安装

安装第一个软件包:perl-DBI-1.52-1.fc6.i386.rpm 

安装第二个软件包:mysql-5.0.22-2.1.0.1.i386.rpm 

安装第三个软件包:perl-DBD-MySQL-3.0007-1.fc6.i386.rpm 

安装第四个软件包:mysql-server-5.0.22-2.1.0.1.i386.rpm

安装第五个软件包:mysql-devel-5.0.22-2.1.0.1.i386.rpm

[root@dns Server]# ls -l | grep mysql

-r--r--r-- 91 root root 16035 2008-10-14 freeradius-mysql-1.1.3-1.4.el5.i386.rpm

-r--r--r-- 99 root root 17668 2007-01-19 libdbi-dbd-mysql-0.8.1a-1.2.2.i386.rpm

-r--r--r-- 99 root root 22570 2007-01-19 mod_auth_mysql-3.0.0-3.1.i386.rpm

-r--r--r-- 117 root root 4347498 2008-04-02 mysql-5.0.45-7.el5.i386.rpm

-r--r--r-- 99 root root 525622 2008-04-02 mysql-bench-5.0.45-7.el5.i386.rpm

-r--r--r-- 99 root root 144863 2007-01-19 mysql-connector-odbc-3.51.12-2.2.i386.rpm

-r--r--r-- 113 root root 2508069 2008-04-02 mysql-devel-5.0.45-7.el5.i386.rpm

-r--r--r-- 99 root root 10143466 2008-04-02 mysql-server-5.0.45-7.el5.i386.rpm

-r--r--r-- 99 root root 3522524 2008-04-02 mysql-test-5.0.45-7.el5.i386.rpm

-r--r--r-- 69 root root 86519 2008-12-01 php-mysql-5.1.6-23.el5.i386.rpm

-r--r--r-- 99 root root 28166 2007-01-18 qt4-mysql-4.2.1-1.i386.rpm

-r--r--r-- 55 root root 11457 2008-12-02 rsyslog-mysql-2.0.6-1.el5.i386.rpm

[root@dns Server]# rpm -ivh --aid perl-DBI-1.52-2.el5.i386.rpm

warning: perl-DBI-1.52-2.el5.i386.rpm: Header V3 DSA signature: NOKEY, key ID 37017186

Preparing... ########################################### [100%]

1:perl-DBI ########################################### [100%]

[root@dns Server]# rpm -ivh --aid mysql-5.0.45-7.el5.i386.rpm

warning: mysql-5.0.45-7.el5.i386.rpm: Header V3 DSA signature: NOKEY, key ID 37017186

Preparing... ########################################### [100%]

1:mysql ########################################### [100%]

[root@dns Server]# rpm -ivh --aid perl-DBD-MySQL-3.0007-2.el5.i386.rpm

warning: perl-DBD-MySQL-3.0007-2.el5.i386.rpm: Header V3 DSA signature: NOKEY, key ID 37017186

Preparing... ########################################### [100%]

1:perl-DBD-MySQL ########################################### [100%]

[root@dns Server]# rpm -ivh --aid mysql-server-5.0.45-7.el5.i386.rpm

warning: mysql-server-5.0.45-7.el5.i386.rpm: Header V3 DSA signature: NOKEY, key ID 37017186

Preparing... ########################################### [100%]

1:mysql-server ########################################### [100%]

[root@dns Server]# rpm -ivh --aid mysql-devel-5.0.45-7.el5.i386.rpm

warning: mysql-devel-5.0.45-7.el5.i386.rpm: Header V3 DSA signature: NOKEY, key ID 37017186

Preparing... ########################################### [100%]

1:mysql-devel ########################################### [100%]

clip_image037

3、启动mysqld

[root@dns Server]# service mysqld restart

停止 MySQL: [失败]

初始化 MySQL 数据库: Installing MySQL system tables...

OK

Filling help tables...

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:

/usr/bin/mysqladmin -u root password 'new-password'

/usr/bin/mysqladmin -u root -h dns password 'new-password'

See the manual for more instructions.

You can start the MySQL daemon with:

cd /usr ; /usr/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 /usr/bin/mysqlbug script!

The latest information about MySQL is available on the web at

http://www.mysql.com

Support MySQL by buying support/licenses at http://shop.mysql.com

[确定]

启动 MySQL: [确定]

[root@dns Server]# mysqladmin -u root password wishes

[root@dns Server]# mysql -u root -p

Enter password:

Welcome to the MySQL monitor. Commands end with ; or \g.

Your MySQL connection id is 3

Server version: 5.0.45 Source distribution

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> exit

Bye

[root@dns Server]

[root@dns Server]# chkconfig --level 35 mysqld on

[root@dns Server]# chkconfig --list mysqld

mysqld 0:关闭 1:关闭 2:关闭 3:启用 4:关闭 5:启用 6:关闭

clip_image039

4、安装PHP

安装PHP软件包

安装第一个软件包:php-common-5.1.6-15.el5.i386.rpm 

安装第二个软件包:php-cli-5.1.6-15.el5.i386.rpm 

安装第三个软件包:php-5.1.6-15.el5.i386.rpm 

安装第四个软件包:php-pdo-5.1.6-15.el5.i386.rpm 

安装第五个软件包:php-mysql-5.1.6-15.el5.i386.rpm

[root@dns Server]# ls -l | grep php

-r--r--r-- 69 root root 1210093 2008-12-01 php-5.1.6-23.el5.i386.rpm

-r--r--r-- 69 root root 33834 2008-12-01 php-bcmath-5.1.6-23.el5.i386.rpm

-r--r--r-- 69 root root 2217057 2008-12-01 php-cli-5.1.6-23.el5.i386.rpm

-r--r--r-- 69 root root 156876 2008-12-01 php-common-5.1.6-23.el5.i386.rpm

-r--r--r-- 69 root root 41051 2008-12-01 php-dba-5.1.6-23.el5.i386.rpm

-r--r--r-- 35 root root 524983 2008-12-01 php-devel-5.1.6-23.el5.i386.rpm

-r--r--r-- 69 root root 118420 2008-12-01 php-gd-5.1.6-23.el5.i386.rpm

-r--r--r-- 69 root root 54031 2008-12-01 php-imap-5.1.6-23.el5.i386.rpm

-r--r--r-- 69 root root 36215 2008-12-01 php-ldap-5.1.6-23.el5.i386.rpm

-r--r--r-- 69 root root 993525 2008-12-01 php-mbstring-5.1.6-23.el5.i386.rpm

-r--r--r-- 69 root root 86519 2008-12-01 php-mysql-5.1.6-23.el5.i386.rpm

-r--r--r-- 69 root root 40825 2008-12-01 php-ncurses-5.1.6-23.el5.i386.rpm

-r--r--r-- 69 root root 52937 2008-12-01 php-odbc-5.1.6-23.el5.i386.rpm

-r--r--r-- 69 root root 64933 2008-12-01 php-pdo-5.1.6-23.el5.i386.rpm

-r--r--r-- 148 root root 364195 2007-10-05 php-pear-1.4.9-4.el5.1.noarch.rpm

-r--r--r-- 69 root root 68137 2008-12-01 php-pgsql-5.1.6-23.el5.i386.rpm

-r--r--r-- 69 root root 29155 2008-12-01 php-snmp-5.1.6-23.el5.i386.rpm

-r--r--r-- 69 root root 139586 2008-12-01 php-soap-5.1.6-23.el5.i386.rpm

-r--r--r-- 69 root root 97237 2008-12-01 php-xml-5.1.6-23.el5.i386.rpm

-r--r--r-- 69 root root 57298 2008-12-01 php-xmlrpc-5.1.6-23.el5.i386.rpm

[root@dns Server]# rpm -ivh --aid php-common-5.1.6-23.el5.i386.rpm

warning: php-common-5.1.6-23.el5.i386.rpm: Header V3 DSA signature: NOKEY, key ID 37017186

Preparing... ########################################### [100%]

1:php-common ########################################### [100%]

[root@dns Server]# rpm -ivh --aid php-cli-5.1.6-23.el5.i386.rpm

warning: php-cli-5.1.6-23.el5.i386.rpm: Header V3 DSA signature: NOKEY, key ID 37017186

Preparing... ########################################### [100%]

1:php-cli ########################################### [100%]

[root@dns Server]# rpm -ivh --aid php-5.1.6-23.el5.i386.rpm

warning: php-5.1.6-23.el5.i386.rpm: Header V3 DSA signature: NOKEY, key ID 37017186

Preparing... ########################################### [100%]

1:php ########################################### [100%]

[root@dns Server]# rpm -ivh --aid php-pdo-5.1.6-23.el5.i386.rpm

warning: php-pdo-5.1.6-23.el5.i386.rpm: Header V3 DSA signature: NOKEY, key ID 37017186

Preparing... ########################################### [100%]

1:php-pdo ########################################### [100%]

[root@dns Server]# rpm -ivh --aid php-mysql-5.1.6-23.el5.i386.rpm

warning: php-mysql-5.1.6-23.el5.i386.rpm: Header V3 DSA signature: NOKEY, key ID 37017186

Preparing... ########################################### [100%]

1:php-mysql ########################################### [100%]

[root@dns Server]#

[root@dns Server]# vim /var/www/html/index.php

<?php

phpinfo();

?>

~

~

~

~

~

~

~

~

~

~

~

~

~

~

~

~

~

~

~

~

"/var/www/html/index.php" [新] 3L, 20C 已写入

[root@dns Server]# cat /var/www/html/index.php

<?php

phpinfo();

?>

[root@dns Server]# service httpd restart

停止 httpd: [确定]

启动 httpd: [确定]

clip_image041

clip_image043

五、编辑Apache配置文件httpd.conf

2、vim /etc/httpd/conf/httpd.conf

(1)修改主配置文件httpd.conf

设置Apache的根目录为/etc/httpd

设置客户端访问超时时间为120秒

这两个设置为系统默认——57行和68行

clip_image045

(2)设置客户端最大连接数为1000——104、105行

clip_image047

(3)设置httpd监听端口80,默认——134行

clip_image049

(4)设置管理员E-mail地址为root@benet.com——251行

设置WEB服务器的主机名和监听端口为www.benet.com:80——265行

clip_image051

(5)设置文档目录为/var/www/html/bbs——281行

clip_image053

(6)允许所有人访问/var/www/html/bbs目录——306、333行

clip_image055

clip_image057

(7)设置主页文件为index.php——391行

clip_image059

(8)设置服务器的默认编码为GB2312——747行

clip_image061

(9)重新启动httpd

[root@dns Server]# mkdir /var/www/html/bbs (重要一步,不然不能启动)

[root@dns Server]# service httpd restart

停止 httpd: [确定]

启动 httpd: [确定]

[root@dns Server]#

[root@dns Server]# mkdir /var/www/html/bbs/

[root@dns Server]# chmod -R 777 /var/www/html/bbs/

[root@dns Server]# ls -l /var/www/html/

总计 24

drwxrwxrwx 2 root root 4096 09-28 01:54 bbs

-rw-r--r-- 1 root root 22 09-28 01:43 index.html

-rw-r--r-- 1 root root 20 09-28 01:52 index.php

[root@dns Server]#

[root@dns ~]# cp -r /root/upload/* /var/www/html/bbs/

[root@dns ~]# cd /var/www/html/bbs/

[root@dns bbs]# ls -l

总计 804

drwxr-xr-x 2 root root 4096 09-27 17:48 admin

-rw-r--r-- 1 root root 4026 09-27 17:48 admincp.php

-rw-r--r-- 1 root root 6601 09-27 17:48 ajax.php

-rw-r--r-- 1 root root 2497 09-27 17:48 announcement.php

drwxr-xr-x 3 root root 4096 09-27 17:48 api

drwxr-xr-x 3 root root 4096 09-27 17:48 archiver

-rw-r--r-- 1 root root 7779 09-27 17:48 attachment.php

drwxr-xr-x 2 root root 4096 09-27 17:48 attachments

-rw-r--r-- 1 root root 1950 09-27 17:48 campaign.php

-rw-r--r-- 1 root root 2661 09-27 17:48 config.inc.php

-rw-r--r-- 1 root root 106 09-27 17:48 crossdomain.xml

-rw-r--r-- 1 root root 2544 09-27 17:48 digest.php

-rw-r--r-- 1 root root 147 09-27 17:48 discuz_version.php

-rw-r--r-- 1 root root 8045 09-27 17:48 eccredit.php

-rw-r--r-- 1 root root 2613 09-27 17:48 faq.php

-rw-r--r-- 1 root root 25214 09-27 17:48 favicon.ico

drwxr-xr-x 6 root root 4096 09-27 17:48 forumdata

-rw-r--r-- 1 root root 19721 09-27 17:48 forumdisplay.php

-rw-r--r-- 1 root root 1262 09-27 17:48 frame.php

drwxr-xr-x 21 root root 4096 09-27 17:48 images

drwxr-xr-x 6 root root 4096 09-27 17:48 include

-rw-r--r-- 1 root root 10081 09-27 17:48 index.php

drwxr-xr-x 3 root root 4096 09-27 17:48 install

-rw-r--r-- 1 root root 5457 09-27 17:48 invite.php

drwxr-xr-x 2 root root 4096 09-27 17:48 ipdata

-rw-r--r-- 1 root root 1548 09-27 17:48 leftmenu.php

-rw-r--r-- 1 root root 9496 09-27 17:48 logging.php

-rw-r--r-- 1 root root 18839 09-27 17:48 magic.php

-rw-r--r-- 1 root root 2619 09-27 17:48 medal.php

-rw-r--r-- 1 root root 13889 09-27 17:48 member.php

-rw-r--r-- 1 root root 34446 09-27 17:48 memcp.php

-rw-r--r-- 1 root root 39326 09-27 17:48 misc.php

drwxr-xr-x 2 root root 4096 09-27 17:48 modcp

-rw-r--r-- 1 root root 4201 09-27 17:48 modcp.php

-rw-r--r-- 1 root root 30398 09-27 17:48 my.php

-rw-r--r-- 1 root root 908 09-27 17:48 plugin.php

drwxr-xr-x 2 root root 4096 09-27 17:48 plugins

-rw-r--r-- 1 root root 3156 09-27 17:48 pm.php

-rw-r--r-- 1 root root 11655 09-27 17:48 post.php

-rw-r--r-- 1 root root 3285 09-27 17:48 redirect.php

-rw-r--r-- 1 root root 15034 09-27 17:48 register.php

-rw-r--r-- 1 root root 3434 09-27 17:48 relatekw.php

-rw-r--r-- 1 root root 5688 09-27 17:48 relatethread.php

-rw-r--r-- 1 root root 734 09-27 17:48 robots.txt

-rw-r--r-- 1 root root 5899 09-27 17:48 rss.php

-rw-r--r-- 1 root root 10104 09-27 17:48 search.php

-rw-r--r-- 1 root root 2038 09-27 17:48 seccode.php

-rw-r--r-- 1 root root 3521 09-27 17:48 sitemap.php

-rw-r--r-- 1 root root 7393 09-27 17:48 space.php

-rw-r--r-- 1 root root 38488 09-27 17:48 stats.php

-rw-r--r-- 1 root root 6043 09-27 17:48 tag.php

drwxr-xr-x 6 root root 4096 09-27 17:48 templates

-rw-r--r-- 1 root root 23248 09-27 17:48 topicadmin.php

-rw-r--r-- 1 root root 1015 09-27 17:48 topic.php

-rw-r--r-- 1 root root 9800 09-27 17:48 trade.php

drwxr-xr-x 6 root root 4096 09-27 17:48 uc_client

-rw-r--r-- 1 root root 976 09-27 17:48 video.php

-rw-r--r-- 1 root root 27586 09-27 17:48 viewthread.php

drwxr-xr-x 3 root root 4096 09-27 17:48 wap

[root@dns bbs]# cd

[root@dns ~]# chmod -R 777 /var/www/html/bbs/

[root@dns ~]# service httpd restart

停止 httpd: [确定]

启动 httpd: [确定]

[root@dns ~]#

[root@dns Server]# cd /var/www/html/bbs/

[root@dns bbs]# chmod -R 777 templates/

[root@dns bbs]# chmod -R 777 attachments/

[root@dns bbs]# chmod -R 777 customavatars/

[root@dns bbs]# chmod -R 777 forumdata/

[root@dns bbs]# chmod -R 777 forumdata/templates/

[root@dns bbs]# chmod -R 777 forumdata/cache/

[root@dns bbs]# chmod -R 777 forumdata/threadcaches/

[root@dns bbs]# chmod -R 777 forumdata/logs/

[root@dnsbbs]#chmod-R777config.inc.php

clip_image063

clip_image065

六、下载DISCUZ 6.0.0论坛源码并使用SSH客户端软件(上传或下载)

官方地址:http://www.discuz.net

1、使用SSH软件(如图1

复制uploads目录里所有文件到/var/www/html/bbs目录

clip_image066

如图1

clip_image067

如图2

clip_image069

如图3

clip_image071

clip_image073

clip_image075

2、更改目录权限

chmod -R 777 /var/www/html/bbs/

clip_image076

3、安装动网论坛

(1)IE输入http://bbs.benet.com/install.php

clip_image078

(2)点击我同意

clip_image080

clip_image082

(3)点击下一步

clip_image084

(4)输入:数据库密码,并下一步

clip_image086

(5)点击下一步

clip_image088

(6)设置邮箱和密码并点击下一步

clip_image090

(7)点击下一步

clip_image092

clip_image094

(8)点击完成

clip_image096

clip_image098

clip_image100

clip_image102

配置文件在附件里面:

如有不懂的地方,请call我!qq:357714938 mail:hongwish8es@126.com

附件:http://down.51cto.com/data/2354145

©著作权归作者所有:来自51CTO博客作者hongwish8es的原创作品,如需转载,请注明出处,否则将追究法律责任

职场论坛Apachelinux系列


0人推荐
随时随地看视频
慕课网APP