Build a Discuz forum on web1

Source: Internet
Author: User

Address planning:

650) this. width = 650; "src =" http://www.bkjia.com/uploads/allimg/131228/04254LY8-0.png "style =" float: none; "title =" 1.png" alt = "214717192.png"/>

1. Configure the local yum Repository:

#mkdir /media/iso#mount /dev/cdrom /media/iso#vim /etc/yum.repos.d/rhel-source.repo[rhel-source]name=Red Hat Enterprise Linux $releasever - $basearch - Sourcebaseurl=file:///media/isoenabled=1gpgcheck=0gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release


2. Configure the network: # system-config-network

650) this. width = 650; "src =" http://www.bkjia.com/uploads/allimg/131228/04254H507-1.png "style =" float: none; "title =" 2.png" alt = "214718336.png"/>

650) this. width = 650; "src =" http://www.bkjia.com/uploads/allimg/131228/04254M5Q-2.png "style =" float: none; "title =" 3.png" alt = "214719939.png"/>

Restart the network service: # service network restart 3. Install httpd, php, mysqlroot @ web1 ~] # Yum-y install httpd php-mysql-server mysql IV. Set up the Discuz Forum 1. Unzip the prepared installation package and decompress it to the default path. [Root @ web1 ~] # Unzip Discuz_X2.5_ SC _GBK.zip-d/var/www/html/[root @ web1 ~] # Rm/var/www/html/{readme, utility}-rf [root @ web1 ~] # Mv/var/www/html/upload/*/var/www/html/[root @ web1 ~] # Rm/var/www/html/upload/-rf [root @ web1 ~] # Service httpd start2. open the browser and enter http: // IP to display the following page

650) this. width = 650; "src =" http://www.bkjia.com/uploads/allimg/131228/04254G632-3.png "style =" float: none; "title =" 4.png" alt = "214725315.png"/>

650) this. width = 650; "src =" http://www.bkjia.com/uploads/allimg/131228/04254L519-4.png "style =" float: none; "title =" 5.png" alt = "214727281.png"/>

Garbled characters occur because the Discuz we downloaded is GBK encoded, So modify the httpd configuration file: Back up the file before modification: [root @ web1 ~] # Cp/etc/httpd/conf/httpd. conf/etc/httpd/conf/httpd. conf. bak comment out the AddDefaultCharset UTF-8 at the 759 line of the httpd configuration file, copy and change it to adddefadefacharset GBK, save and exit. [Root @ web1 ~] # Vim/etc/httpd/conf/httpd. conf 759 # AddDefaultCharset UTF-8760 adddefadefacharset GBK restart httpd service and make sure it takes effect after restart: [root @ web1 ~] # Service httpd restart
[Root @ web1 ~] # Chkconfig httpd on refresh the browser page and the display is normal:

650) this. width = 650; "src =" http://www.bkjia.com/uploads/allimg/131228/04254JU0-5.png "style =" float: none; "title =" 6.png" alt = "214729900.png"/>

[root@web1 ~]# cat listconfigdatadata/cachedata/avatardata/plugindatadata/downloaddata/addonmd5data/templatedata/threadcachedata/attachmentdata/attachment/albumdata/attachment/forumdata/attachment/groupdata/loguc_client/data/cacheuc_server/data/uc_server/data/cacheuc_server/data/avataruc_server/data/backupuc_server/data/logsuc_server/data/tmpuc_server/data/view[root@web1 ~]# for file in `cat list`; do  chmod o+w /var/www/html/$file;done

3. Configure the database as needed:

650) this. width = 650; "src =" http://www.bkjia.com/uploads/allimg/131228/04254H456-6.png "style =" float: none; "title =" 7.png" alt = "214730405.png"/>

[Root @ web1 ~] # Service mysqld start [root @ web1 ~] # Mysql-e "create database bbs; grant all privileges on bbs. * to root @ localhost identified by 'redhat'; delete from mysql. user where password = ''; flush privileges" is successfully installed:

650) this. width = 650; "src =" http://www.bkjia.com/uploads/allimg/131228/04254G418-7.png "style =" float: none; "title =" 8.png" alt = "214733205.png"/>

5. configure a domain name-based VM
[Root @ web1 httpd] # sed-I's/# NameVirtualHost/'/etc/httpd/conf/httpd. conf is added at the end of the configuration file: <VirtualHost *: 80> DocumentRoot/var/www/html ServerName bbs.sanyu.com ErrorLog logs/bbs.sanyu.com-error_log CustomLog logs/bbs.sanyu.com-access_log common </VirtualHost> [root @ web1 ~] # Service httpd restart


The above process is scripted:

#! /Bin/bashyum-y install httpd php-mysql-server mysql # unzip the prepared installation package to the default path. Unzip Discuz_X2.5_ SC _GBK.zip-d/var/www/html/rm/var/www/html/{readme, utility}-rfmv/var/www/html/upload/*/var/www/html/rm/var/www/html/upload/-rf # Modify permissions for file in' echo 'configdatadata/cachedata/plugin/plugindatadata/downloaddata/plugin/templatedata/threadcachedata/attachmentdata/attachment/plugin/attachment/forumdata/attachment/groupdata/loguc_client/data/upload/data/ uc_server/data/cacheuc_server/data/avataruc_server/data/backupuc_server/data/logsuc_server/data/tmpuc_server/data/view ''dochmod o + w/var/www/html/$ filedonecp /etc/httpd/conf/httpd. conf {,. bak} sed-I's/AddDefaultCharset UTF-8/adddefadefacharset GBK/'/etc/httpd/conf/httpd. confservice httpd startchkconfig httpd on # database initialization service mysqld startmysql-e "create database bbs; grant all privileges on bbs. * to root @ localhost identified by 'redhat'; delete from mysql. user where password = ''; flush privileges" # configure the domain name-based virtual host sed-I's/# NameVirtualHost/'/etc/httpd/conf/httpd. confcat>/etc/httpd/conf/httpd. conf <END <VirtualHost *: 80> DocumentRoot/var/www/html ServerName bbs.sanyu.com ErrorLog logs/bbs.sanyu.com-error_log CustomLog logs/your-access_log common </VirtualHost> ENDservice httpd restart



This article is from the non-Trojan dream blog, please be sure to keep this source http://wumengsheng.blog.51cto.com/7339300/1304066

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.