LAMP Environment Construction C7

Source: Internet
Author: User
Tags configuration php mysql host wordpress database

#LAMP环境搭建Centos 7
        
(1) Install the development Package Group "development Tools" "Server Platform Development"
Yum Groupinstall
Note: Turn off SELinux iptables
(2) Installing amp
(a) yum install httpd php php-mysql mariadb mod_ssl
    
(b) https://xcache.lighttpd.net/download XCache
Tar xvf xcache-3.2.0.tar.gz
Run/usr/bin/phpize
./configure--enable-xcache--with-php-config=/usr/bin/php-config
(c) Unzip WordPress, PhpMyAdmin
(3) Configure the file
(a) module selection
configuration file location:/etc/httpd/conf.modules.d/00-mpm
LoadModule mpm_prefork_module modules/mod_mpm_prefork.so
LoadModule mpm_event_module modules/mod_mpm_event.so
LoadModule mpm_worker_module modules/mod_mpm_worker.so
Note: When selecting the event Worker module, follow the phplib5-zts.so
(b) httpd configuration backup: httpd.conf and Virtual host conf
Configure a domain name that needs to use HTTPS
1) Generate the private key and request a certificate
2) configuration Vhost/etc/httpd/conf.d/ssl.cof
<virtualhost 172.16.174.177:443>
documentroot "/DATA/VHOST/AMP2"
ServerName amp2.magedu.com

SSLCERTIFICATEFILE/ETC/PKI/TLS/CERTS/HTTPD.CRT
Sslcertificatekeyfile/etc/pki/tls/private/httpd.key
Note: amp2.conf do not add new files directly to ssl.conf
listion 172.16.174.177:80
User Apache
Group Apache
<virtualhost 172.16.174.177:80>
ServerName amp1.magedu.com
DOCUMENTROOT/DATA/VHOST/AMP1
Customlog Logs/access_amp1_log Combined
errorlog Logs/error_amp1_log
directoryindex index.php index.html
proxyrequests Off
Proxypassmatch ^/(. *\.php) $ fcgi://127.0.0.1:9000/data/wordpress/$1
            
KeepAlive on
maxkeepaliverequests
KeepAliveTimeout
    
    
Note: prefork default
startservers 7
Minspareservers 4
maxspareservers
Serverlimit
maxclients
Maxrequestsperchild 4000
worker Default
startservers 5
maxclients
minsparethreads
maxsparethreads
Threadsperchild
Maxrequestsperchild 0
        
<directory "/DATA/VHOST/AMP1" >
Options None
allowoverride None
Require All granted
</Directory>
alias/wordpress/"/data/wordpress/"
<directory "/data/wordpress" >
Options None
allowoverride None
Require All granted
</Directory>
</VirtualHost>
(c) mariadb configuration PHP
myql:/etc/my.cnf
php:/etc/php.ini/etc/php.d/*.ini
(d) configuration of wrodpress
CD wordpress CP wp-config-sample.php wp-config.php
//* * MySQL Settings-specific information from the host you are using * *//
/** Name of wordpress database * /
define (' db_name ', ' TestDB ');
                    
/** MySQL Database user name * /
define (' Db_user ', ' testuser ');
                    
/** mysql Database password * /
define (' Db_password ', ' testpass ');
                    
/** MySQL host * /
define (' Db_host ', ' 172.16.174.170 ');
(e) Configuring WordPress
CP config.sample.inc.php config.inc.php
/ * User used to manipulate with storage * /
//$cfg [' Servers '] [$i] [' controlhost '] = ' 172.16.174.177 ';
//$cfg [' Servers '] [$i] [' controlport '] = ' 3306 ';
//$cfg [' Servers '] [$i] [' controluser '] = ' testuser ';
//$cfg [' Servers '] [$i] [' controlpass '] = ' testpass ';

This article is from the "All the Way North" blog, please be sure to keep this source http://centos7.blog.51cto.com/7764677/1827377

LAMP Environment Construction C7

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.