Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

LAMP compilation and installation + wordpress+discuz

2025-03-31 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

# Software download

# Open source blog Wordpress download address: https://cn.wordpress.org/wordpress-4.7.4-zh_CN.tar.gz

# PHP 7 download address: http://cn2.php.net/distributions/php-7.1.4.tar.gz

# apache download address: http://mirror.bit.edu.cn/apache//httpd/httpd-2.4.25.tar.gz

# Database Mariadb download address: system image (this time yum installation is adopted, compilation and installation reference: Mysql 5.7.17 compilation and installation)

# system environment

[root@KVM_1 ~] # cat / etc/redhat-release CentOS Linux release 7.2.1511 (Core) [root@KVM_1 ~] # ip addr show eno33554960 3: eno33554960: mtu 1500 qdisc pfifo_fast state UP qlen 1000 link/ether 00:0c:29:84:b7:60 brd ff:ff:ff:ff:ff:ff inet 192.168.174.134 scope global dynamic eno33554960 valid_lft 1779sec preferred_lft 1779sec inet6 fe80 24 brd 192.168.174.255 scope global dynamic eno33554960 valid_lft 1779sec preferred_lft 1779sec inet6 fe80: : 20c:29ff:fe84:b760/64 scope link valid_lft forever preferred_lft forever

# turn off the firewall and selinux

[root@KVM_1 ~] # systemctl stop firewalld [root @ KVM_1 ~] # setenforce 0

# YUM Settings

[root@KVM_1 ~] # cat / etc/yum.repos.d/local.repo [local] name=localbaseurl= file:///mnt/cdromgpgcheck=0enabled=1

Apache compilation and installation

# download the software (operate by yourself)

[root@KVM_1 ~] # lshttpd-2.4.25.tar.gz php-7.1.4.tar.gz wordpress-4.7.4-zh_ CN.tar.gz [root @ KVM_1 ~] # tar-xf httpd-2.4.25.tar.gz [root@KVM_1 ~] # cd httpd-2.4.25/# installation dependency package [root@KVM_1 httpd-2.4.25] # yum install-y net-tools pcre-devel zlib- Devel apr apr-devel apr-util apr-util-devel gcc-c++# compilation [root@KVM_1 httpd-2.4.25] #. / configure-- prefix=/usr/local/apache-- with-mysql=/usr/share/mysql-- enable-module=so-- enable-shared=max-- enable-rewrite# the following result indicates that the compilation check is successful configure: summary of build options: Server Version: 2.4.25 Install prefix: / usr/local/apache C compiler: gcc-std=gnu99 CFLAGS:-pthread LDFLAGS: LIBS: CPPFLAGS:-DLINUX-D_REENTRANT-D_GNU_SOURCE C preprocessor: gcc-E # compile and install [root@KVM_1 httpd-2.4.25] # make & & make install

# install the database

# this time it is installed with yum (please refer to Mysql 5.7.17 for compilation and installation)

[root@KVM_1 ~] # yum install-y mariadb mariadb-server [root@KVM_1 ~] # systemctl start mariadb

# initialize the database

[root@KVM_1 ~] # mysql_secure_installation / usr/bin/mysql_secure_installation: line 379: find_mysql_client: command not foundNOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB SERVERS IN PRODUCTION USE! PLEASE READ EACH STEP CAREFULLY!In order to log into MariaDB to secure it, we'll need the currentpassword for the root user. If you've just installed MariaDB, andyou haven't set the root password yet, the password will be blank,so you should just press enter here.Enter current password for root (enter for none): OK, successfully used password, moving on...Setting the root password ensures that nobody can log into the MariaDBroot user without the proper authorisation.Set root password? [yNew password] y # Select yNew password: # set password 123456Re-enter new password: # set password 123456Password updated fulfilled Reloading privilege tables.. ... Success!By default, a MariaDB installation has an anonymous user, allowing anyoneto log into MariaDB without having to have a user account created forthem. This is intended only for testing, and to make the installationgo a bit smoother. You should remove them before moving into aproduction environment.Remove anonymous users? [YBO] y # Select y... Successful normally, root should only be allowed to connect from 'localhost'. Thisensures that someone cannot guess at the root password from the network.Disallow root login remotely? [YBO] n # Select n... Skipping.By default, MariaDB comes with a database named 'test' that anyone canaccess. This is also intended only for testing, and should be removedbefore moving into a production environment.Remove test database and access to it? [YBO] y # Select y-Dropping test database... ... Success!-Removing privileges on test database... ... Success!Reloading the privilege tables will ensure that all changes made so farwill take effect immediately.Reload privilege tables now? [YBO] y # Select y... Success!Cleaning up...All done! If you've completed all of the above steps, your MariaDBinstallation should now be secure.Thanks for using MariaDB!

# create Wordpress database

[root@KVM_1] # mysql-uroot-p123456Welcome to the MariaDB monitor. Commands end with; or\ g.Your MariaDB connection id is 9Server version: 5.5.44-MariaDB MariaDB ServerCopyright (c) 2000, 2015, Oracle, MariaDB Corporation Ab and others.Type 'help;' or'\ h' for help. Type'\ c'to clear the current input statement.MariaDB [(none)] > create database wordpressdb;Query OK, 1 row affected (0.00 sec) MariaDB [(none)] > create user' wordpressuser'@'localhost' identified by '123456 question OK, 0 rows affected (0.00 sec) MariaDB [(none)] > grant all on wordpressdb.* to' wordpressuser'@'localhost';Query OK, 0 rows affected (0.00 sec) MariaDB [(none)] > grant all on wordpressdb.* to 'wordpressuser'@'%' Query OK, 0 rows affected (0.00 sec) MariaDB [(none)] > flush privileges;Query OK, 0 rows affected (0.00 sec) MariaDB [(none)] > exitBye

# PHP7 compilation and installation

# installation of PHP depends on libmcrypt download address ftp://mcrypt.hellug.gr/pub/crypto/mcrypt/libmcrypt/libmcrypt-2.5.6.tar.gz

# download libmcrypt [root@KVM_1 ~] # wget ftp://mcrypt.hellug.gr/pub/crypto/mcrypt/libmcrypt/libmcrypt-2.5.6.tar.gz[root@KVM_1 ~] # tar-xf libmcrypt-2.5.6.tar.gz [root@KVM_1 ~] # cd libmcrypt-2.5.6/ [root@KVM_1 libmcrypt-2.5.6] #. / configure [root@KVM_1 libmcrypt-2.5.6] # make & & make install

# Software download (self-operation)

[root@KVM_1 ~] # ls httpd-2.4.25.tar.gz php-7.1.4.tar.gz wordpress-4.7.4-zh_CN.tar.gz httpd-2.4.25 [root@KVM_1 ~] # tar-xf php-7.1.4.tar.gz [root@KVM_1 ~] # cd php-7.1.4/ [root@KVM_1 php-7.1.4] # yum-y install Libxml2 libxml2-devel openssl openssl-devel curl-devel libjpeg-devel libpng-devel freetype-devel libmcrypt-devel [root@KVM_1 php-7.1.4] #. / configure-prefix=/usr/local/php7-- with-apxs2=/usr/local/apache/bin/apxs\-- with-mcrypt=/usr/include-- enable-mysqlnd-- with-mysqli-- with-pdo-mysql\-- enable-fpm-- with-gd-- with-iconv-- with-zlib-- enable-xml\ -- enable-shmop-- enable-sysvsem-- enable-inline-optimization-- enable-mbregex\-- enable-exif-- enable-mbstring-- enable-ftp-- enable-gd-native-ttf-- with-openssl\-- enable-pcntl-- enable-sockets-- with-xmlrpc-- enable-zip-- enable-soap-- without-pear\-- with-gettext-- enable-session-- with-curl-- with-jpeg-dir\-- with-freetype-dir-- enable-opcache-- -enable-fileinfo#: the following situation indicates that the compilation check is successful +-+ | 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.config.status: creating php7.specconfig.status: creating main/build-defs.hconfig.status: creating scripts/phpizeconfig.status: creating scripts/man1/phpize.1config.status: creating scripts/php- | Configconfig.status: creating scripts/man1/php-config.1config.status: creating sapi/cli/php.1config.status: creating sapi/fpm/php-fpm.confconfig.status: creating sapi/fpm/www.confconfig.status: creating sapi/fpm/init.d.php-fpmconfig.status: creating sapi/fpm/php-fpm.serviceconfig.status: creating sapi/fpm/php-fpm.8config.status: creating sapi/fpm/status.htmlconfig.status: creating sapi/cgi/php-cgi.1config.status: creating ext/ Phar/phar.1config.status: creating ext/phar/phar.phar.1config.status: creating main/php_config.hconfig.status: executing default commands# compilation and installation [root@KVM_1 php-7.1.4] # make & & make install

# Note: both-- enable-fpm and-- with-apxs2 are enabled here

#-with-apxs2 compiles php directly into apache modules, and apachectl-M can view the loaded modules

#-enable-fpm enables php-fpm

# you can cancel the-- with-apxs2 option if you only want to use php-fpm

# Parameter description http://www.jianshu.com/p/0a79847c8151

# for convenience, php-fpm is not used in this article

# modify http configuration file to support php

[root@KVM_1 ~] # vim / usr/local/apache/conf/httpd.conf# modify line 254 to add the following value DirectoryIndex index.php index.html # 392 as follows: AddType application/x-httpd-php .php

# enable the service

[root@KVM_1] # / usr/local/apache/bin/apachectl-k startAH00557: httpd: apr_sockaddr_info_get () failed for KVM_1AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1. Set the 'ServerName' directive globally to suppress this message [root @ KVM_1] # the reason for the two warnings here is that ServerName is not set and the correspondence between hostname and ip is not set in / etc/hosts. [root@KVM_1 ~] # vim / usr/local/apache/conf/httpd.conf# modify line 196 to read the following value ServerName localhost: 80 [root @ KVM_1 ~] # vim / etc/ hosts [root @ KVM_ 1 ~] # cat / etc/hosts127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4::1 localhost localhost.localdomain localhost6 localhost6.localdomain6192.168.174.134 KVM_1 [root@KVM_1 ~] # / usr/local/apache/bin/apachectl-k restart

# add php file

[root@KVM_1 ~] # vim / usr/local/apache/htdocs/ index.php [root @ KVM_1 ~] # rm-f / usr/local/apache/htdocs/index.html [root@KVM_1 ~] # cat / usr/local/apache/htdocs/ index.php [root @ KVM_1 ~] # chown-R daemon:daemon / usr/local/apache

# Test

# set up virtual host

[root@KVM_1 ~] # vim / usr/local/apache/conf/httpd.conf# uncomment line 479 (or add the following configuration on the last line) Include conf/extra/httpd-vhosts.conf [root@KVM_1 ~] # vim / usr/local/apache/conf/extra/httpd-vhosts.conf # add the following configuration (delete the original configuration) DocumentRoot "/ usr/local/apache/htdocs/blog" ServerName "blog.chauncey.com" AllowOverride NoneRequire All granted [root @ KVM_1 ~] # mkdir / usr/local/apache/htdocs/blog

# install the open source blog Wordpress

# Software download (self-operation)

[root@KVM_1 ~] # lsanaconda-ks.cfg httpd-2.4.25.tar.gz libmcrypt-2.5.6.tar.gz php-7.1.4.tar.gz wordpress-4.7.4-zh_CN.tar.gzhttpd-2.4.25 libmcrypt-2.5.6 php-7.1.4 [root@KVM_1 ~] # tar-xf wordpress-4.7.4-zh_CN.tar.gz [root@KVM_ 1 ~] # cp-rf wordpress/* / usr/local/apache/htdocs/blog/ [root @ KVM_1 ~] # chown-R daemon:daemon / usr/local/apache/htdocs/blog# Syntax check [root@KVM_1 ~] # / usr/local/apache/bin/apachectl-tSyntax OK# enable service [root@KVM_1 ~] # / usr/local/apache/bin/apachectl-k start [root @ KVM_1 ~] # netstat-lntup | grep 80tcp 0 0 192.168.174.134 80 0.0.0.0 * LISTEN 3068/httpd [root@KVM_1 ~] #

# set DNS resolution

# window settings hosts file (C:\ Windows\ System32\ drivers\ etc\ hosts) add a line to parse # Linux settings hosts (/ etc/hosts)

# enter blog.chauncey.com

# fill in the relevant data

# fill in the relevant data

# installation is complete. Wordpress is very powerful and rich in plug-ins. You can buy a CVM from Tencent Cloud or Aliyun to build your own personal blog.

# forgot how to retrieve the login password:

WordPress recovery password PHP file download address: https://www.freehao123.com/dl-wordpress-password-php/

Upload to wordpress root directory / usr/local/apache/htdocs/blog

Visit

# Discuz! Forum installation

# Software download address: http://www.discuz.net/forum-10-1.html

# create Discuz! Database

[root@KVM_1] # mysql-uroot-p123456Welcome to the MariaDB monitor. Commands end with; or\ g.Your MariaDB connection id is 80Server version: 5.5.44-MariaDB MariaDB ServerCopyright (c) 2000, 2015, Oracle, MariaDB Corporation Ab and others.Type 'help;' or'\ h' for help. Type'\ c'to clear the current input statement.MariaDB [(none)] > create database discuz;Query OK, 1 row affected (0.00 sec) MariaDB [(none)] > create user' discuzuser'@'localhost' identified by '123456 question OK, 0 rows affected (0.01 sec) MariaDB [(none)] > grant all on discuz.* to' discuzuser'@'localhost';Query OK, 0 rows affected (0.01 sec) MariaDB [(none)] > grant all on discuz.* to 'discuzuser'@'%' Query OK, 0 rows affected (0.00 sec) MariaDB [(none)] > flush privileges;Query OK, 0 rows affected (0.00 sec) MariaDB [(none)] > exitBye

# upload software

[root@KVM_1 ~] # wget http://download.comsenz.com/DiscuzX/3.3/Discuz_X3.3_SC_GBK.zip [root@KVM_1 ~] # yum install-y unzip [root @ KVM_1 ~] # unzip Discuz_X3.3_SC_GBK.zip [root@KVM_1 ~] # mkdir / usr/local/apache/htdocs/bbs/ [root @ KVM_1 ~] # cp-rf upload/* / usr/local/apache/htdocs/bbs/ [root@KVM_1] # chown-R daemon:daemon / usr/local/apache/htdocs/bbs

# add virtual hosts

[root@KVM_1 ~] # vim / usr/local/apache/conf/extra/httpd-vhosts.conf [root@KVM_1 ~] # cat / usr/local/apache/conf/extra/httpd-vhosts.conf # add the following configuration: DocumentRoot "/ usr/local/apache/htdocs/bbs" ServerName "bbs.chauncey.com" AllowOverride NoneRequire all granted

# enable the service

# Syntax check [root@KVM_1 ~] # / usr/local/apache/bin/apachectl-tSyntax OK [root @ KVM_1 ~] # / usr/local/apache/bin/apachectl-k restart

# set DNS resolution

# window settings hosts file (C:\ Windows\ System32\ drivers\ etc\ hosts) add a line to parse # Linux settings hosts (/ etc/hosts)

# start the installation

# start the installation

# check the environment

# set the database

# installation completed

# Test access

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report