Building Discuz Forum under Lamp environment

Source: Internet
Author: User
Tags forum software

Discuz! is a common Community forum software system, users can build on the Internet with the perfect function, strong load capacity and highly customizable forum service, on the basis of not needing any programming, through simple setup and installation. discuz! 's infrastructure, implemented in the world's most popular web programming portfolio, is a well-designed and efficient forum system solution for a variety of server environments, Php+mysql.


1. Download discuz! installation package Create www directory to hold discuz installation file

[[email protected] src]# mkdir/data/www[[email protected] src]# cd/data/www/[[email protected] www]# wget Http://downlo Ad.comsenz.com/discuzx/3.2/discuz_x3.2_sc_gbk.zip

Unzip the downloaded package, after decompression there are 3 directories, the Readme is the installation information, utility is the upgrade information, you can delete the 2 directories, only the upload directory.

[Email protected] www]# unzip discuz_x3.2_sc_gbk.zip [[email protected] www]# Lsdiscuz_x3.2_sc_gbk.zip Readme upload u Tility

All files in the upload directory are moved to the current WWW directory

[Email protected] www]# mv upload/*. [Email protected] www]# RM-RF upload/

Launch Apache

[[email protected] www]#/usr/local/apache2/bin/apachectl start

You can make a soft connection to the Apachectl command, and then you don't have to lose the absolute path.

[[email protected] www]# ln-s/usr/local/apache2/bin/apachectl/usr/bin/[[email protected] www]# apachectl-tsyntax OK


2. Configure the virtual host

Edit Apache Master config file # vim/usr/local/apache2/conf/httpd.conf

Find this line

#Include conf/extra/httpd-vhosts.conf

Delete the previous # number, let this configuration file take effect, save exit;


Edit a virtual host profile # vim/usr/local/apache2/conf/extra/httpd-vhosts.conf

A total of 2 paragraphs virtualhost, delete a redundant;

<virtualhost *:80>
ServerAdmin[email protected]#邮箱地址, you can delete this line;
DocumentRoot "/usr/local/apache2/docs/dummy-host.example.com" #存放文件的地址
ServerName dummy-host.example.com #网站域名, can be customized one;
Serveralias www.dummy-host.example.com #网站别名, other domain address;
Errorlog "Logs/dummy-host.example.com-error_log" #错误日志
Customlog "Logs/dummy-host.example.com-access_log" common #自定义的日志;
</VirtualHost>


Change the settings to keep only the following lines:

<virtualhost *:80>

DocumentRoot "/data/www"

ServerName www.123.com

Serveralias www.a.com www.b.com

</VirtualHost>

After saving exit, detect if Apache is working properly, use curl to parse the website, it works! The description was unsuccessful;

[Email protected] www]# apachectl-tsyntax ok[[email protected] www]# curl-x127.0.0.1:80 www.123.com


gracefully restarts Apache, Error: The prompt port is already in use and cannot be bound to the specified port.

[Email protected] www]# Apachectl gracefulhttpd not running, trying to start (98) Address already in Use:make_sock:could  Not bind to address [::]:80 (98) address already in use:make_sock:could not bind to address 0.0.0.0:80no listening sockets Available, shutting downunable to open logs

650) this.width=650; "src="/e/u261/themes/default/images/spacer.gif "style=" border:1px solid rgb (221,221,221); background-position:50% 50%; "alt=" Spacer.gif "/> Solution: PS View httpd process, then kill, kill and then restart again, will not error;

[[Email protected] www]# PS aux |grep httpd[[email protected] www]# killall httpd[[email protected] www]# apachectl GRACEF ULHTTPD not running, trying to start

Curl parses the Web site without any information output, indicating correct. Add-I displays information about the site, prompting for 302 errors, and location is install, stating that parsing is correct.

[Email protected] www]# curl-x127.0.0.1:80 www.123.com[[email protected] www]# curl-x127.0.0.1:80 WWW.123.COM-IHTTP/1 .1 302 founddate:wed, APR 07:37:13 gmtserver:apache/2.2.29 (Unix) DAV/2 Php/5.3.28x-powered-by:php/5.3.28locati On:installcontent-type:text/html


Problem troubleshooting: If the result of the resolution error is 403, you need to make the following error

[Email protected] www]# curl-x127.0.0.1:80 www.123.com-IHTTP/1.1 403 forbiddendate:wed, APR 07:24:34 gmtserver : apache/2.2.15 (CentOS) accept-ranges:bytescontent-length:4954connection:closecontent-type:text/html; Charset=utf-8

A 403 error occurred because you do not have permission to access the Web site and need to edit the Apache configuration file.

[email protected] www]# vim/usr/local/apache2/conf/httpd.conf

<directory/>

Options FollowSymLinks

AllowOverride None

Order Deny,allow

Deny from all

</Directory>

Change to:order Allow,deny

Allow from all

Save after exiting, need to restart Apache, problem resolution;


When Apache is started, if the "namevirtualhost *:80 has no virtualhosts" error occurs, most of the changes to the Apache httpd.conf configuration file will extra/ The vhosts.conf file was introduced into the httpd.conf.

[Email protected] www]# apachectl restart[thu Apr 09:49:15] [warn] namevirtualhost *:80 has no virtualhosts

The virtual host httpd-vhost.conf file has a clause in the configuration statement

Namevirtualhost *:80

Here is a code <> inside to configure and the above statement consistent, there will be no error.

<virtualhost *:80>
DocumentRoot "/data/www"
ServerName www.123.com
</VirtualHost>


In the physical machine C:\Windows\System32\drivers\etc\hosts

Manually add a row 192.168.20.20 www.123.com access to the domain name 123.com is resolved to the local IP;

Open cmd window ping www.123.com is resolved correctly
Ping www.123.com [192.168.20.20] has 32 bytes of data:
Reply from 192.168.20.20: Byte =32 time =6ms ttl=64
Reply from 192.168.20.20: Byte =32 time =2ms ttl=64
Reply from 192.168.20.20: Byte =32 time <1ms ttl=64
Reply from 192.168.20.20: Byte =32 time <1ms ttl=64


Continue to the following operation, open IE browser input www.123.com automatically add/install/appear discuz! The Installation Wizard interface.

650) this.width=650; "src="/e/u261/themes/default/images/spacer.gif "style=" Background:url ("/e/u261/lang/zh-cn/ Images/localimage.png ") no-repeat center;border:1px solid #ddd;" alt= "Spacer.gif"/>650 "this.width=650;" src= "http ://s3.51cto.com/wyfs02/m01/6c/3c/wkiol1vb9lwzdznfaasrw-1bv_w057.jpg "title=" 123com.jpg "alt=" Wkiol1vb9lwzdznfaasrw-1bv_w057.jpg "/>

Click I agree to the next page, the Red fork indicates that the current directory does not exist or is not writable.

650) this.width=650; "src="/e/u261/themes/default/images/spacer.gif "style=" Background:url ("/e/u261/lang/zh-cn/ Images/localimage.png ") no-repeat center;border:1px solid #ddd;" alt= "Spacer.gif"/>650 "this.width=650;" src= "http ://s3.51cto.com/wyfs02/m02/6c/3c/wkiol1vb9aycyba4aakleskbdsy265.jpg "title=" directory. jpg "alt=" Wkiol1vb9aycyba4aakleskbdsy265.jpg "/>

PS aux view httpd process, found Apache running account is daemon

650) this.width=650; "src="/e/u261/themes/default/images/spacer.gif "style=" Background:url ("/e/u261/lang/zh-cn/ Images/localimage.png ") no-repeat center;border:1px solid #ddd;" alt= "Spacer.gif"/>650 "this.width=650;" src= "http ://s3.51cto.com/wyfs02/m02/6c/40/wkiom1vb9g_h940eaapr8d8j4yg160.jpg "title=" PS httpd.jpg "alt=" wKiom1VB9G_ H940eaapr8d8j4yg160.jpg "/>

650) this.width=650; "src="/e/u261/themes/default/images/spacer.gif "style=" Background:url ("/e/u261/lang/zh-cn/ Images/localimage.png ") no-repeat center;border:1px solid #ddd;" alt= "Spacer.gif"/>650 "this.width=650;" src= "http ://s3.51cto.com/wyfs02/m02/6c/3c/wkiol1vb9ltqqwzqaagcskunas8303.jpg "title=" wwwmlu.jpg "alt=" Wkiol1vb9ltqqwzqaagcskunas8303.jpg "/>

According to the prompt, modify the permissions of the corresponding directory, let these directories support Apache running account writable operation;

[Email protected] www]# chown-r daemon data/config/uc_server/data/uc_client/data/

Back to Internet Explorer, press F5 to refresh and find the status writable

650) this.width=650; "src="/e/u261/themes/default/images/spacer.gif "style=" Background:url ("/e/u261/lang/zh-cn/ Images/localimage.png ") no-repeat center;border:1px solid #ddd;" alt= "Spacer.gif"/>650 "this.width=650;" src= "http ://s3.51cto.com/wyfs02/m02/6c/3c/wkiol1vb9nayv-7taacpy3xdx10074.jpg "title=" www directory 2.jpg "alt=" Wkiol1vb9nayv-7taacpy3xdx10074.jpg "/>

Next, select the new Installation discuz! (Ucenter User Center, save user's data information)

650) this.width=650; "src="/e/u261/themes/default/images/spacer.gif "style=" Background:url ("/e/u261/lang/zh-cn/ Images/localimage.png ") no-repeat center;border:1px solid #ddd;" alt= "Spacer.gif"/>650 "this.width=650;" src= "http ://s3.51cto.com/wyfs02/m02/6c/40/wkiom1vb8ytrhrnvaacovqpxatm675.jpg "title=" Installation Discuz.jpg "alt=" Wkiom1vb8ytrhrnvaacovqpxatm675.jpg "/>

Need to fill in database information

650) this.width=650; "src="/e/u261/themes/default/images/spacer.gif "style=" Background:url ("/e/u261/lang/zh-cn/ Images/localimage.png ") no-repeat center;border:1px solid #ddd;" alt= "Spacer.gif"/>650 "this.width=650;" src= "http ://s3.51cto.com/wyfs02/m00/6c/3c/wkiol1vb9pdteykkaae0qheq1si367.jpg "title=" database information. jpg "alt=" Wkiol1vb9pdteykkaae0qheq1si367.jpg "/>


3, configure MySQL, give Discuz! Add an account

Set a password to the MySQL root account, then the command line enters MySQL, creates a new library, and creates a new account with all the permissions for the library:

> Grant all on discuz.* to ' username ' @ ' localhost ' identified by ' 123456 ';

Command explanation: Allow all permissions for all table users of the Discuz library to define the user's password locally


MySQL executes more commands, can be written into the path, or added to the/etc/profile inside.

[Email protected] www]# path= $PATH:/usr/local/mysql/bin/

First give MySQL set a password, the actual environment to set a complex password, security considerations.

[Email protected] www]# mysqladmin-uroot password ' 123456 '

Login with username password, enter the password directly after-p, or enter the password when interacting.

[Email protected] www]# mysql-uroot-p123456[[email protected] www]# mysql-uroot-penter Password:

Use the MySQL command to enter the terminal, create a discuz library, create a discuz database, create a new user and password;

mysql> Create discuz;mysql> CREATE database discuz; Mysql> Grant all on discuz.* to ' Yong ' @ ' localhost ' identified by ' yong123 '; Mysql> quit

Log in with the newly established user MySQL test is normal.

[Email protected] www]# mysql-uyong-pyong123

Fill in the database information, then click Next to install the complete!

650) this.width=650; "src="/e/u261/themes/default/images/spacer.gif "style=" Background:url ("/e/u261/lang/zh-cn/ Images/localimage.png ") no-repeat center;border:1px solid #ddd;" alt= "Spacer.gif"/>650 "this.width=650;" src= "http ://s3.51cto.com/wyfs02/m02/6c/3c/wkiol1vb9y-ifgrjaafn-u4xwa4347.jpg "title=" Database information new.jpg "alt=" Wkiol1vb9y-ifgrjaafn-u4xwa4347.jpg "/>

650) this.width=650; "src="/e/u261/themes/default/images/spacer.gif "style=" Background:url ("/e/u261/lang/zh-cn/ Images/localimage.png ") no-repeat center;border:1px solid #ddd;" alt= "Spacer.gif"/>650 "this.width=650;" src= "http ://s3.51cto.com/wyfs02/m01/6c/3c/wkiol1vb91tinz-7aam2pfuaw5u008.jpg "title=" qq picture 20150429173000.png "alt=" Wkiol1vb91tinz-7aam2pfuaw5u008.jpg "/>

Admin account password login, select Admin Center background, login can be background operation.

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M01/6C/40/wKiom1VB9gSgCN46AAEqWwf8YuE964.jpg "title=" Admin center. jpg "alt=" wkiom1vb9gsgcn46aaeqwwf8yue964.jpg "/>

discuz! Forum set up, forum background settings and function settings have the need for friends to find information on their own to understand.



This article is from the "Model Student's Learning blog" blog, please be sure to keep this source http://8802265.blog.51cto.com/8792265/1641011

Building Discuz Forum under Lamp environment

Related Article

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.