LANP how to build Discuz Forum
Editor to share with you how to build LANP Discuz forum, I believe that most people do not know much about it, so share this article for your reference, I hope you can learn a lot after reading this article, let's go to know it!
LAMP= "Linux Apache Mysql PHP/Python"
Linux often refers to a system, but there is no specified version, such as CentOS/Ubuntu/Debian can be used as a server system
Apache is the Web parsing engine, which is used to process web page source code files into browser-convertible page files.
MySQL database, MySQL is a relational database that stores data in the form of tables, where data is stored in rows and columns
PHP is a web scripting language that is used to generate page frames and cannot be used alone. It is generally used as a language extension of Apache (so that Apache can support more page languages).
-customize the host-only mode and mount the CD
Upload the source code package to the virtual machine
[root@localhost ~] # vim / etc/sysconfig/network-scripts/ifcfg-ens33 # static IPBOOTPROTO=staticONBOOT=yesIPADDR=192.168.18.6NETMASK=255.255.255.0GATEWAY=192.168.18.0:wq # exit [root@localhost ~] # mkdir / media/dvd # CD [root@localhost ~] # mount / dev/cdrom / media/dvd/mount: / dev/sr0 is write-protected Mounting read-only [root@localhost ~] # mkdir / yum.repo.bak [root@localhost ~] # mv / etc/yum.repos.d/* / yum.repo.bak/ [root@localhost ~] # vim / etc/yum.repos.d/yum.repo [localyum] name=yumbaseurl= file:///media/dvdenabled=1gpgcheck=0 virtual WQ # exit
HTTP installation:
Configure local yum on the server side
[root@localhost ~] # mkdir / media/dvd [root@localhost ~] # mount / dev/cdrom / media/dvd/ mount: / dev/sr0 is write-protected Mounting read-only [root@localhost ~] # cd / etc/yum.repos.d/ [root@localhost yum.repos.d] # mkdir / yum.repo.bak [root@localhost yum.repos.d] # mv * / yum.repo.bak/ [root@localhost yum.repos.d] # ls [root@localhost yum.repos.d] # vim yum.repo [localyum] name=yum # name baseurl= file:/// Media/dvd # specify the path enabled=1 gpgcheck=0 [root@localhost ~] # yum-y install gcc gcc-c++ # install the compilation tool
Upload the source package of httpd to the virtual machine
[root@localhost ~] # tar zxf httpd-2.2.17.tar.gz-C / usr/src # extract to / usr/src [root@localhost ~] # cd / usr/src/httpd-2.2.17 [root@localhost httpd-2.2.17] #. / configure-- prefix=/usr/local/httpd-- enable-so-- enable-rewrite-- enable-charset-lite-- enable-cgi # configuration
[root@localhost httpd-2.2.17] # make & & make install # compilation
[root@localhost ~] # ln-s / usr/local/httpd/bin/* / usr/local/bin # optimize path [root@localhost httpd-2.2.17] # cp / usr/local/httpd/bin/apachectl / etc/init.d/httpd # add system service [root@localhost ~] # vim / etc/init.d/httpd # add content to line 3, line 4 #! / bin/sh##chkconfig:35 25 25 # line 3 35 For boot sequence 25, run level # description: # 4 comment on why: wq # exit [root@localhost ~] # chkconfig-- add httpd
Mysql installation:
Rpm-Q mysql-server mysql # check whether there is a built-in mysql package package mysql-server is not installedpackage mysql is not installed# there is no mkdir / media/dvd # mount CD mount / dev/cdrom / media/dvd/mount: / dev/sr0 is write-protected Mounting read-onlycd / media/dvd/Packages/ # Software required for installation rpm-ivh ncurses-devel-5.9-13.20130511.el7.x86_64.rpm warning: ncurses-devel-5.9-13.20130511.el7.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID f4a80eb5: NOKEYPreparing... # # [100%] Updating / installing... 1:ncurses-devel-5.9-13.20130511.el7## [100%] cdls # find the directory where the cmakepackage and mysql package are installed anaconda-ks.cfg cmake-2.8.6.tar.gz initial-setup-ks.cfg mysql-5.5.22.tar.gz tar zxf cmake-2.8.6.tar.gz-C / Usr/ # specifies that cd / etc/yum.repos.d/ # needs to download compilation tools under the / usr directory, so first configure yum mkdir / yum.repo.bak # to create a directory where the original yum packages are stored mv * / yum.repo.bak/ # move all packages to the new directory ls # check that there is no vim yum.repo # configure yum [localyum] name=yum # name baseurl=file:/ / / media/dvd # path enabled=1gpgcheck=0:wq yum-y install gcc gcc-c++ # install Complete! Cd / usr/cmake-2.8.6/. / configure
Gmake & & gmake install
Groupadd mysql useradd-M-s / sbin/nologin mysql- g mysql cd tar zxf mysql-5.5.22.tar.gz-C / usr/src/ cd / usr/src/mysql-5.5.22/ cmake-DCMAKE_INSTALL_PREFIX=/usr/local/mysql-DSYSCONFIGDIR=/etc/-DDEFAULT_CHARSET=utf8-DDEFAULT_COLLATION=utf8_general_ci-DWITH_EXTRA_CHARSET=all
1 specify the installation directory
2 specify the initialization parameter file directory,
3 specify the character set encoding used by default
4 specify character set revision specification
Additional character set encoding for utf8_general_ci
Make-j 2 & & make install-j 2
Chown-R mysql:mysql / usr/local/mysql/ rm-rf / etc/my.cnf cp support-files/my-medium.cnf / etc/my.cnf / usr/local/mysql/scripts/mysql_install_db-- user=mysql-- basedir=/usr/local/mysql-- datadir=/usr/local/mysql/data
# stands for success
Echo "PATH=$PATH:/usr/local/mysql/bin" > > / etc/profile. / etc/profile #. There is a space cp support-files/mysql.server / etc/rc.d/init.d/mysqld chmod aquix / etc/rc.d/init.d/mysqld chkconfig-- add mysqld after the dot.
PHP installation:
[root@localhost] # rpm-e php php-cli php-ldap php-commom php-mysql-- nodeps error: package php is not installed error: package php-cli is not installed error: package php-ldap is not installed error: package php-commom is not installed error: package php-mysql is not installed [root@localhost ~] # cd / media/dvd/Packages/ [root@localhost Packages] # rpm-ivh libxml2-2.9.1-6.el7_2.3.x86 _ 64.rpm warning: libxml2-2.9.1-6.el7_2.3.x86_64.rpm: Header V3 RSA/SHA256 Signature Key ID f4a80eb5: NOKEY Preparing... # # [100%] package libxml2-2.9.1-6.el7_2.3.x86_64 is already installed [root@localhost Packages] # rpm-ivh zlib-devel-1.2.7-17.el7.x86_64.rpm warning: zlib-devel-1.2.7-17.el7.x86_64.rpm: Header V3 RSA/SHA256 Signature Key ID f4a80eb5: NOKEY Preparing... # # [100%] Updating / installing... 1:zlib-devel-1.2.7-17.el7 # # [root@localhost Packages] # rpm-ivh xz-devel-5.2.2-1.el7.x86_64.rpm warning: xz-devel-5.2.2-1.el7.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID f4a80eb5: NOKEY Preparing... # # [100%] Updating / installing... 1:xz-devel-5.2.2-1.el7 # # [root@localhost Packages] # rpm-ivh libxml2-devel-2.9.1-6.el7_2.3.x86_64.rpm warning: libxml2-devel-2.9.1-6.el7_2.3.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID f4a80eb5: NOKEY Preparing... # # [100%] Updating / installing... 1:libxml2-devel-2.9.1-6.el7_2.3 # # [root@localhost Packages] # cd [root@localhost ~] # tar zxf libmcrypt-2.5.8.tar.gz-C / usr/src/ [root@localhost ~] # cd / usr/src/libmcrypt-2.5.8/ [root@localhost libmcrypt-2.5.8] # / configure & & make & & make install [root@localhost libmcrypt-2.5.8] # ln-s / usr/local/lib/libmcrypt.* / usr/src/ [root@localhost libmcrypt-2.5.8] # cd [root@localhost ~] # tar zxf mhash-0.9.9.9.tar.gz-C / usr/src/ [root@localhost ~] # cd / usr/src / mhash-0.9.9.9/ [root@localhost mhash-0.9.9.9] #. / configure & & make & & make install [root@localhost] # tar zxf mcrypt-2.6.8.tar.gz-C / usr/src/ [root@localhost ~] # cd / usr/src/mcrypt-2.6.8/
Direct configuration will report an error, so modify the environment variable first.
[root@localhost mcrypt-2.6.8] # export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_ path [root @ localhost mcrypt-2.6.8] #. / configure [root@localhost mcrypt-2.6.8] # make-j 2 & & make install-j 2 [root@localhost mcrypt-2.6.8] # cd [root@localhost] # tar zxf php-5.3.28.tar.gz-C / usr/src/ [root@localhost ~] # Cd / usr/src/php-5.3.28/ [root@localhost php-5.3.28] # ln-s / usr/local/libmhash.* / usr/lib [root@localhost php-5.3.28] #. / configure-prefix=/usr/local/php5-with-mcrypt-with-apxs2=/usr/local/httpd/bin/apxs-with-mysql=/usr/local/mysql-with-config-file-path=/usr/local/php5-enable-mbstring -- prefix=/usr/local/php5 # path-- with-mcrypt-- with-apxs2=/usr/local/httpd/bin/apxs--with-mysql=/usr/local/mysql # mysql path-- with-config-file-path=/usr/local/php5 # configuration file path-- enable-mbstring # enable string creating main/internal_functions.ccreating main/internal_functions_cli.c
+-- +
| | License: |
| | This software is subject to the PHP License, available in this |
| distribution in the file LICENSE. By continuing this installation |
| process, you are bound by the terms of this license agreement. | |
| | If you do not agree with the terms of this license, you must abort |
| the installation process at this point. | |
+-- +
Thank you for using PHP.
[root@localhost php-5.3.28] # make & & make install
[root@localhost php-5.3.28] # cp / usr/src/php-5.3.28/php.ini-development / usr/local/php5/php.ini [root@localhost php-5.3.28] # vim / usr/local/php5/php.inivim Modification 226short_open_tag = on # Open 782; PHP's default character set is set to empty.783 Http://php.net/default-charset784 default_charset = "utf-8" # remove comments and change to "utf-8": wq exits [root@localhost ~] # tar zxf ZendGuardLoader-php-5.3-linux-glibc23-x86_64.tar.gz-C / usr/src/ [root@localhost ~] # cd / usr/src/ZendGuardLoader-php-5.3-linux-glibc23-x86_64/php-5.3.x/ [root@localhost php-5.3 .x] # cp ZendGuardLoader.so / usr/local/php5/lib/php/ [root@localhost php-5.3.x] # vim / usr/local/php5/php.ini
Add the following two lines
Zend_extension=/usr/local/php5/lib/php/ZendGuardLoader.sozend_loader.enable=1:wq # exit [root@localhost php-5.3.x] # vim / usr/local/httpd/conf/httpd.conf54 and 168lines to add and modify 51 # Example:52 # LoadModule foo_module modules/mod_foo.so53 LoadModule php5_module modules/libphp5.so54 AddType application/x-httpd-php. Php # blank line to add a new line 55 # 163164164 # DirectoryIndex: sets the file that Apache will serve If a directory165 # is requested.166 # 167168 DirectoryIndex index.html index.php # add to this line: wq # exit [root@localhost php-5.3.x] # systemctl restart httpd [root@localhost php-5.3.x] # systemctl restart mysqld [root@localhost php-5.3.x] # cd [root@localhost ~] # vim / usr/local/httpd/htdocs/index.php:wq # exit [root@localhost ~] # firefox 192.168.18.6/index.php
Access successful
[root@localhost ~] # cd [root@localhost ~] # tar zxf phpMyAdmin-4.2.5-all-languages.tar.gz-C / usr/src/ [root@localhost ~] # cd / usr/src/ [root@localhost src] # mv phpMyAdmin-4.2.5-all-languages/ / usr/local/httpd/htdocs/phpMyAdmin [root@localhost src] # cd / usr/local/httpd/htdocs/phpMyAdmin/ [root@localhost phpMyAdmin] # cp Config.sample.inc.php config.inc.php [root@localhost phpMyAdmin] # mysqladmin-u root-p password '123' Enter password: [root@localhost phpMyAdmin] # 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.5.22-log Source distribution Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. Type 'help;' or'\ h' for help. Type'\ c'to clear the current input statement. Mysql > exit Bye
Log in and execute a bit.
[root@localhost ~] # vim / usr/local/httpd/htdocs/test.php:wq # exit [root@localhost ~] # firefox 192.168.18.6/test.php
[root@localhost ~] # unzip Discuz_7.2_FULL_SC_ UTF8.zip [root @ localhost ~] # mv upload/ / usr/local/httpd/htdocs/bbs [root@localhost ~] # chown-R daemon:daemon / usr/local/httpd/htdocs/bbs/ [root@localhost ~] # systemctl restart httpd [root@localhost ~] # systemctl start httpd [root@localhost ~] # firefox 192.168.18.6/bbs/install
[root@localhost ~] # netstat-anput | grep httpdtcp6 0 0: 80: * LISTEN 81067/httpd
# if the above phenomenon occurs in the exit, perform the following steps
[root@localhost ~] # firefox 192.168.18.6/bbs
The difference between nginx and apache
Nginx:
Advantages: lightweight, good handling of static files and high concurrency
Disadvantages: problems may occur when dealing with dynamic files
Nginx can't process the php file, but he can get help with it.
Apache:
Advantages: good handling of dynamic files, stability and security
Disadvantages: bloated service and low operation efficiency
The above is all the contents of this article "LANP how to build Discuz Forum". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!