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+xcache completes the specified service

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

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

(1) CentOS 7, apm+xcache, rpm package, php module

A) one virtual host provides phpMyAdmin and the other virtual host provides wordpress

B) provide https services for phpMyAdmim

(2) CentOS 7, amp + xcache, rpm package, php-fpm

A) httpd, php, and mariadb are deployed on a separate host

B) one virtual host provides phpMyAdmin and the other virtual host provides wordpress

C) provide https services for phpMyAdmim

(3) CentOS 7, amp + xcache, compilation and installation, php-fpm

A) depth: httpd and php,mariadb are deployed on a separate host, and they are all on the same host

B) one virtual host provides phpMyAdmin and the other virtual host provides wordpress

C) provide https services for phpMyAdmim

(4) do stress tests on all the above deployments, compare the test results, and write a test report

Install mariadb database, httpd service, php-xcache service in turn

Yum install mariadb-service

Vim / etc/my.conf

In [mysql]

Innodb_file_per_table = ON

Skip_name_resolve = ON

After restarting the service, check that the process and port are running

Systemctl reatart mariadb.service

Ps aux

Ss-ntl

Check to see if the database is available

$mysql

Install httpd services and dependency packages

Yum install http php php-gd php-mysql php-mbstringphp-xml

The default configuration can meet the requirements we need.

Restart the service

Sysctemctl restart httpd.service

Check to see if the service is running and the port is open

Ps aux

Ss-ntl

Check whether the httpd service can be parsed

Vim / var/www/html/index.php

Check whether the mysql database can be parsed

$vim / var/www/html/index.php

Install php-xccahe

Yum install php-xcache

Edit configuration file

Vim / etc/httpd/xcache.ini

Reload the service

Systemctl httpd reload

Check whether it can be parsed

Vim / var/www/hmtl/index.php

After completing the amp installation, create a virtual machine based on the ip address

Ip addr add 172.16.55.8/16 dev eno16777736

Ip a l

Among them, 172.16.55.7 provides WordPress

Edit the configuration file for the virtual host 172.16.55.7

Vim / etc/httpd/conf.d/vhost1.conf

Download the WordPress.zip installation package and extract it

Move the unzipped installation package to / data/vhosts/www1/ directory

Rename wp-config-sample.php to wp-config.php

When creating a wpdb database

# mysql > GRANT ALL ON wpdb.* TO 'wpuser'@'172.16.%.$' IDENTIFIED BY' wppass'

# mysql > CREATE DATABASE wpdb

# mysql > exit

Editing WordPress's configuration file

Vim wp-config.php

Fill in the database file information in the corresponding location

NAME wpdb

USER wpuser

PASSWORD wppass

HOST 172.16.55.7

Vim / data/vhosts/www1/index.php

Restarting the service, browser 172.16.55.7

Provide phpMyAdmin services on 172.16.55.8

Vim / etc/httpd/conf.d/vhost2.conf

Install phpMyAdmin

Yum install phpMyAdmin

Edit its configuration file

Vim / etc/httpd/conf.d/phpMyAdmin

Under Apache [2.4]

All point to 172.16.

Require ip 172.16

(b)

Yum install mod_ssl

172.16.55.6 CA

Cd / etc/pki/CA

(umask 07710 OpenSSL genrsa-out private/cakey.pem 2048)

Openssl req-new-x509-key private/cakesy.pem-outcacert.pem

[CN Beijing Beijing magedu opsmagedu.com @ admin.com]

/ etc/httpd/ssl

(umask 07710 OpenSSL genrsa-out private/httpd.key 1024)

Openssl req-new-key httpd.key-out httpd.csr

Scp httpd.csr 172.16.55.6:/tmp

[CA]

Openssl ca-in / tmp/httpd.csr-out/etc/pki/certs/httpd.crt

Scp certs/httpd.crt 172.16.55.7:/etc/httpd/ssl

Vim / etc/httpd/conf.d/ssl.conf

ServerName www2.magedu.com:443

DocumentRoot "/ data/vhosts/www2"

ServerName www2.mageducom/phpmyadmin/:443

SSLCertifcateFile / etc/httpd/ssl/httpd.crt

SSLCertifcateKeyFile / etc/httpd/ssl/httpd.key

Systemctl httpd reload

Ss-ntl

172.16.55.11 http

172.16.55.12 php-fpm

172.16.55.13 mariadb

Yum-y instal httpd

Vim / etc/httpd/conf.d/vhost1.conf

ServerName www1.magedu.com

DocumentRoot "/ data/vhost/www1"

ProxyRequests on

DirectoryIndex index.php

ProxyPassMatch ^ / (. *\ .php) $fcgi://172.16.55.12:9000/data/vhost/www1/$1

Options None

AllowOverride None

Require all granted

Vim / etc/httpd/conf.d/vhost2.conf

ServerName www2.magedu.com

DocumentRoot "/ data/vhost/www2"

ProxyRequests on

DirectoryIndex index.php

ProxyPassMatch ^ / (. *\ .php) $fcgi://172.16.55.12:9000/data/vhost/www2/$1

Options None

AllowOverride None

Require all granted

Vim / etc/resolv.conf

DNS=172.16.55.11

Nameserver 172.16.0.1

Vim / etc/hosts

172.16.55.11 www1.magedu.com www2.magedu.com

Mkdir-pv / data/vhost/www {1pr 2}

Vim / data/vhost/www1/index.html

Http111111

Vim / data/vhost/www2/index.html

Http222222

# 172.16.55.12#

Yuminstall php-fpm

Vim / etc/php-fpm.d/www.conf

Listen = 172.16.55.129000

Listen.allowed_clients = 172.16.55.12

Mkdir-pv / data/vhost/www {1,2}

Vim / data/vhost/www1/index.php

Php

Unzipwordpress-4.3.1-zh_CN.zip

Mv wordpress / data/vhost/www1

Cd / data/vhost/www1/wordpress/

Mv wp-config-sample.php wp-config.php

Vim wp-config.php

Define ('DB_NAME',' wpdb')

Define ('DB_USER',' wpuser')

Define ('DB_PASSWORD',' wppass')

Define ('DB_HOST',' 172.16.55.13')

Unzip phpMyAdmin-4.4.14.1-all-languages.zip

Mv phpMyAdmin-4.4.14.1-all-languages / data/vhost/www2/

Cd / data/vhost/www2/

Ln-s phpMyAdmin-4.4.14.1languages myadmin

Cd myadmin/

Ln-s config.sample.inc.php config.inc.php

Openssl rand-base64 10

Vim config.inc.php

$cfg ['blowfish_secret'] =' 4pnJU4R8p4WaQxDuring; / * YOU MUST FILL IN THIS FOR COOKIE AUTH! * /

/ *

* Servers configuration

, /

$I = 0

/ *

* First server

, /

$iTunes +

/ * Authentication type * /

$cfg ['Servers'] [$I] [' auth_type'] = 'cookie'

/ * Server parameters * /

$cfg ['Servers'] [$I] [' host'] = '172.16.55.13'

$cfg ['Servers'] [$I] [' connect_type'] = 'tcp'

$cfg ['Servers'] [$I] [' compress'] = false

$cfg ['Servers'] [$I] [' AllowNoPassword'] = false

# 172.16.55.13#

Yuminstall mariadb-server

Systemctlstart mariadb.service

Mysql > GRANT ALL ONwpdb.* TO 'wpuser'@'172.16.%.%' IDENTIFIED BY' wppass'

Mysql > CREATE DATABASE wpdb

172.16.55.12

Cd / etc/pki/CA/

(umask 077; openssl genrsa-out private/cakey.pem 2048)

Openssl req-new-x509-key private/cakey.pem-out cacert.pem

CN

Beijing

Beijing

Magedu

Ops

Ca.magedu.com

Mageedu@admin.com

Touch index.txt

Echo 01 > serial

172.55.16.11

Yuminstall mod_ssl

Mkdirssl

Cdssl

(umask 077; openssl genrsa-out httpd.key 1024)

Openssl req-new-key httpd.key-out httpd.csr

CN

Beijing

Beijing

Magedu

Ops

Www2.magedu.com

Magedu@admin.com

Scp httpd.csr 172.16.55.12:/tmp

Openssl ca-in / tmp/httpd.csr-out / etc/pki/CA/certs/httpd.crt

Scp certs/httpd.crt 172.16.55.11:/etc/httpd/ssl/

Vim / etc/httpd/conf.d/ssl.conf

DocumentRoot "/ data/vhost/www2/myadmin"

ServerName www2.magedu.com:443

SSLCertificateFile / etc/httpd/ssl/httpd.crt

SSLCertificateKeyFile / etc/httpd/ssl/httpd.key

ProxyPassMatch ^ / (. *\ .php) $fcgi://172.16.55.12:9000/data/vhost/www2/$1

Openssl s_client-connect 172.16.55.11 CAfile 443 / etc/pki/CA/cacert.pem

Ab-c 100-n 1000 http://www1.magedu.com/data/vhost/www1/index.html static data

Time per request: 22.433 [ms] (mean) Time per request: 0.231 [ms] (mean, across all concurrent requests)

Transfer rate: 1855.00 [Kbytes/sec] received

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