您现在的位置是:首页 > cms教程 > shopxo教程shopxo教程
DNS(主从)+DNAT+LAMP架构部署shopxo
千兰2025-07-28shopxo教程已有人查阅
导读1、机器准备机器大小规格2vcpu 2G 100G2、基础环境配置配置IP地址修改主机名关闭selinux、防火墙3、dns主从部署配置master节点配置
1、机器准备
机器大小规格2vcpu 2G 100G
配置IP地址
master节点配置
通过ping域名也可以解析对应的ip
4、配置DNAT转发
开启ip转发功能
在eth0、eth1、eth2配置好相应ip
清空防火墙规则
mysql版本8.0.26
shopxo版本2.2.3
php版本:7.4
下载安装包
rocky8版本安装php7.4
注意wordpress、shopxo节点 需要指向nat节点10.10.10.250
测试wordpress.ebingou.cn网站解析
shopox.ebingou.cn网站解析
10、 启动windows虚机测试
机器大小规格2vcpu 2G 100G
10.10.10.100lamp-wordpress.chen.org
10.10.10.110lamp-shopxo.chen.org
10.10.10.120lamp-mysql.chen.org
10.10.10.250lamp-nat.chen.org
192.168.247.250 lamp-nat.chen.org
192.168.247.240 lamp-dns-master.chen.org
192.168.247.230 lamp-dns-slave.chen.org
2、基础环境配置配置IP地址
cat network-script.sh
#!/bin/bash
#read -p "Please enter your IP address: " ip
cat >/etc/sysconfig/network-scripts/ifcfg-eth0<<EOF
TYPE=Ethernet
BOOTPROTO=none
DEFROUTE=yes
NAME=eth0
DEVICE=eth0
ONBOOT=yes
IPADDR=10.10.10.$1
PREFIX=24
GATEWAY=10.10.10.250
DNS1=10.10.10.250
EOF
nmcli c reload
nmcli c down eth0
nmcli c up eth0
修改主机名
hostnamectl set-hostname lamp-wordpress.chen.org
hostnamectl set-hostname lamp-shopxo.chen.org
hostnamectl set-hostname lamp-mysql.chen.org
hostnamectl set-hostname lamp-nat.chen.org
hostnamectl set-hostname lamp-nat.chen.org
hostnamectl set-hostname lamp-dns-master.chen.org
hostnamectl set-hostname lamp-dns-slave.chen.org
关闭selinux、防火墙
systemctl stop firewalld && systemctl disable firewalld
sed -i 's/SELINUX=enforcing/SELINUX=disabled/g' /etc/selinux/config
setenforce 0
3、dns主从部署配置master节点配置
yum install bind bind-utils
[root@lamp-dns-master ~]# cat /etc/named.conf
//
// named.conf
//
// Provided by Red Hat bind package to configure the ISC BIND named(8) DNS
// server as a caching only nameserver (as a localhost DNS resolver only).
//
// See /usr/share/doc/bind*/sample/ for example named configuration files.
//
options {
//listen-on port 53 { 127.0.0.1; };
//listen-on-v6 port 53 { ::1; };
directory "/var/named";
dump-file "/var/named/data/cache_dump.db";
statistics-file "/var/named/data/named_stats.txt";
memstatistics-file "/var/named/data/named_mem_stats.txt";
secroots-file"/var/named/data/named.secroots";
recursing-file"/var/named/data/named.recursing";
allow-query { any; };
/*
- If you are building an AUTHORITATIVE DNS server, do NOT enable recursion.
- If you are building a RECURSIVE (caching) DNS server, you need to enable
recursion.
- If your recursive DNS server has a public IP address, you MUST enable access
control to limit queries to your legitimate users. Failing to do so will
cause your server to become part of large scale DNS amplification
attacks. Implementing BCP38 within your network would greatly
reduce such attack surface
*/
recursion yes;
dnssec-enable yes;
dnssec-validation yes;
managed-keys-directory "/var/named/dynamic";
pid-file "/run/named/named.pid";
session-keyfile "/run/named/session.key";
/* https://fedoraproject.org/wiki/Changes/CryptoPolicy */
include "/etc/crypto-policies/back-ends/bind.config";
};
logging {
channel default_debug {
file "data/named.run";
severity dynamic;
};
};
zone "." IN {
type hint;
file "named.ca";
};
include "/etc/named.rfc1912.zones";
include "/etc/named.root.key";
[root@lamp-dns-master ~]#
[root@lamp-dns-master ~]# cat /etc/named.rfc1912.zones
// named.rfc1912.zones:
//
// Provided by Red Hat caching-nameserver package
//
// ISC BIND named zone configuration for zones recommended by
// RFC 1912 section 4.1 : localhost TLDs and address zones
// and https://tools.ietf.org/html/rfc6303
// (c)2007 R W Franks
//
// See /usr/share/doc/bind*/sample/ for example named configuration files.
//
// Note: empty-zones-enable yes; option is default.
// If private ranges should be forwarded, add
// disable-empty-zone "."; into options
//
zone "localhost.localdomain" IN {
type master;
file "named.localhost";
allow-update { none; };
};
zone "localhost" IN {
type master;
file "named.localhost";
allow-update { none; };
};
zone "1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.ip6.arpa" IN {
type master;
file "named.loopback";
allow-update { none; };
};
zone "1.0.0.127.in-addr.arpa" IN {
type master;
file "named.loopback";
allow-update { none; };
};
zone "0.in-addr.arpa" IN {
type master;
file "named.empty";
allow-update { none; };
};
zone "magedu.org" IN {
type master;
file "magedu.org.zone";
};
[root@lamp-dns-master ~]#
[root@lamp-dns-master named]# cat /var/named/magedu.org.zone
$TTL 1D
@IN SOA master admin (
0; serial
1D; refresh
1H; retry
1W; expire
3H ); minimum
NSmaster
masterA 192.168.247.240
wordpress A 192.168.247.250
shopxoA 192.168.247.251
[root@lamp-dns-master named]#
启动dns服务
[root@lamp-dns-master named]# named-checkzone magedu.org.zone /var/named/magedu.org.zone
zone magedu.org.zone/IN: loaded serial 0
OK
[root@lamp-dns-master named]#
[root@lamp-dns-master named]# systemctl enable --now named
Created symlink /etc/systemd/system/multi-user.target.wants/named.service → /usr/lib/systemd/system/named.service.
[root@lamp-dns-master named]# systemctl status named
● named.service - Berkeley Internet Name Domain (DNS)
Loaded: loaded (/usr/lib/systemd/system/named.service; enabled; vendor preset: disabled)
Active: active (running) since Tue 2022-08-30 19:15:24 CST; 1min 10s ago
Main PID: 14710 (named)
Tasks: 5 (limit: 11188)
Memory: 14.8M
CGroup: /system.slice/named.service
└─14710 /usr/sbin/named -u named -c /etc/named.conf
Aug 30 19:15:24 lamp-dns-master.chen.org named[14710]: network unreachable resolving './DNSKEY/IN': 2001:500:200::b#53
Aug 30 19:15:24 lamp-dns-master.chen.org named[14710]: network unreachable resolving './NS/IN': 2001:500:200::b#53
Aug 30 19:15:24 lamp-dns-master.chen.org named[14710]: network unreachable resolving './DNSKEY/IN': 2001:500:2d::d#53
Aug 30 19:15:24 lamp-dns-master.chen.org named[14710]: network unreachable resolving './NS/IN': 2001:500:2d::d#53
Aug 30 19:15:24 lamp-dns-master.chen.org named[14710]: network unreachable resolving './DNSKEY/IN': 2001:500:9f::42#53
Aug 30 19:15:24 lamp-dns-master.chen.org named[14710]: network unreachable resolving './NS/IN': 2001:500:9f::42#53
Aug 30 19:15:24 lamp-dns-master.chen.org named[14710]: network unreachable resolving './DNSKEY/IN': 2001:500:2f::f#53
Aug 30 19:15:24 lamp-dns-master.chen.org named[14710]: network unreachable resolving './NS/IN': 2001:500:2f::f#53
Aug 30 19:15:25 lamp-dns-master.chen.org named[14710]: managed-keys-zone: Key 20326 for zone . acceptance timer complete: key now trusted
Aug 30 19:15:25 lamp-dns-master.chen.org named[14710]: resolver priming query complete
[root@lamp-dns-master named]#
slave节点配置
yum install bind bind-utils -y
[root@lamp-dns-slave ~]# cat /etc/named.conf
//
// named.conf
//
// Provided by Red Hat bind package to configure the ISC BIND named(8) DNS
// server as a caching only nameserver (as a localhost DNS resolver only).
//
// See /usr/share/doc/bind*/sample/ for example named configuration files.
//
options {
//listen-on port 53 { 127.0.0.1; };
//listen-on-v6 port 53 { ::1; };
directory "/var/named";
dump-file "/var/named/data/cache_dump.db";
statistics-file "/var/named/data/named_stats.txt";
memstatistics-file "/var/named/data/named_mem_stats.txt";
secroots-file"/var/named/data/named.secroots";
recursing-file"/var/named/data/named.recursing";
//allow-query { localhost; };
allow-transfer { none; };
/*
- If you are building an AUTHORITATIVE DNS server, do NOT enable recursion.
- If you are building a RECURSIVE (caching) DNS server, you need to enable
recursion.
- If your recursive DNS server has a public IP address, you MUST enable access
control to limit queries to your legitimate users. Failing to do so will
cause your server to become part of large scale DNS amplification
attacks. Implementing BCP38 within your network would greatly
reduce such attack surface
*/
recursion yes;
dnssec-enable yes;
dnssec-validation yes;
managed-keys-directory "/var/named/dynamic";
pid-file "/run/named/named.pid";
session-keyfile "/run/named/session.key";
/* https://fedoraproject.org/wiki/Changes/CryptoPolicy */
include "/etc/crypto-policies/back-ends/bind.config";
};
logging {
channel default_debug {
file "data/named.run";
severity dynamic;
};
};
zone "." IN {
type hint;
file "named.ca";
};
include "/etc/named.rfc1912.zones";
include "/etc/named.root.key";
[root@lamp-dns-slave ~]#
[root@lamp-dns-slave ~]# cat /etc/named.rfc1912.zones
// named.rfc1912.zones:
//
// Provided by Red Hat caching-nameserver package
//
// ISC BIND named zone configuration for zones recommended by
// RFC 1912 section 4.1 : localhost TLDs and address zones
// and https://tools.ietf.org/html/rfc6303
// (c)2007 R W Franks
//
// See /usr/share/doc/bind*/sample/ for example named configuration files.
//
// Note: empty-zones-enable yes; option is default.
// If private ranges should be forwarded, add
// disable-empty-zone "."; into options
//
zone "localhost.localdomain" IN {
type master;
file "named.localhost";
allow-update { none; };
};
zone "localhost" IN {
type master;
file "named.localhost";
allow-update { none; };
};
zone "1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.ip6.arpa" IN {
type master;
file "named.loopback";
allow-update { none; };
};
zone "1.0.0.127.in-addr.arpa" IN {
type master;
file "named.loopback";
allow-update { none; };
};
zone "0.in-addr.arpa" IN {
type master;
file "named.empty";
allow-update { none; };
};
zone "magedu.com" {
type slave;
masters { 192.168.247.240;};
file "slaves/magedu.com.slave";
};
[root@lamp-dns-slave ~]#
启动dns服务
[root@lamp-dns-slave ~]# systemctl enable --now named
Created symlink /etc/systemd/system/multi-user.target.wants/named.service → /usr/lib/systemd/system/named.service.
[root@lamp-dns-slave ~]# systemctl status named
● named.service - Berkeley Internet Name Domain (DNS)
Loaded: loaded (/usr/lib/systemd/system/named.service; enabled; vendor preset: disabled)
Active: active (running) since Tue 2022-08-30 19:27:05 CST; 4s ago
Process: 14287 ExecStart=/usr/sbin/named -u named -c ${NAMEDCONF} $OPTIONS (code=exited, status=0/SUCCESS)
Process: 14282 ExecStartPre=/bin/bash -c if [ ! "$DISABLE_ZONE_CHECKING" == "yes" ]; then /usr/sbin/named-checkconf -z "$NAMEDCONF"; else echo "Checking of zone files is disabled"; fi (>
Main PID: 14288 (named)
Tasks: 5 (limit: 11188)
Memory: 14.9M
CGroup: /system.slice/named.service
└─14288 /usr/sbin/named -u named -c /etc/named.conf
Aug 30 19:27:05 lamp-dns-slave.chen.org named[14288]: network unreachable resolving './DNSKEY/IN': 2001:500:9f::42#53
Aug 30 19:27:05 lamp-dns-slave.chen.org named[14288]: network unreachable resolving './NS/IN': 2001:500:9f::42#53
Aug 30 19:27:05 lamp-dns-slave.chen.org systemd[1]: Started Berkeley Internet Name Domain (DNS).
Aug 30 19:27:06 lamp-dns-slave.chen.org named[14288]: zone magedu.com/IN: refresh: unexpected rcode (SERVFAIL) from master 192.168.247.240#53 (source 0.0.0.0#0)
Aug 30 19:27:06 lamp-dns-slave.chen.org named[14288]: network unreachable resolving './DNSKEY/IN': 2001:7fe::53#53
Aug 30 19:27:06 lamp-dns-slave.chen.org named[14288]: network unreachable resolving './DNSKEY/IN': 2001:500:2f::f#53
Aug 30 19:27:06 lamp-dns-slave.chen.org named[14288]: network unreachable resolving './DNSKEY/IN': 2001:500:1::53#53
Aug 30 19:27:06 lamp-dns-slave.chen.org named[14288]: network unreachable resolving './DNSKEY/IN': 2001:503:c27::2:30#53
Aug 30 19:27:06 lamp-dns-slave.chen.org named[14288]: managed-keys-zone: Key 20326 for zone . acceptance timer complete: key now trusted
Aug 30 19:27:07 lamp-dns-slave.chen.org named[14288]: resolver priming query complete
[root@lamp-dns-slave ~]#
测试能否主从同步
[root@lamp-dns-slave ~]# rndc reload
server reload successful
[root@lamp-dns-slave ~]#
[root@lamp-dns-slave named]# ls slaves/
magedu.org.slave
[root@lamp-dns-slave named]#
在master、salve节点测试能否解析dns通过ping域名也可以解析对应的ip
4、配置DNAT转发
开启ip转发功能
[root@lamp-nat ~]# echo "net.ipv4.ip_forward = 1" >> /etc/sysctl.conf
[root@lamp-nat ~]# sysctl -p
net.ipv4.ip_forward = 1
[root@lamp-nat ~]#
虚机设置在eth0、eth1、eth2配置好相应ip
清空防火墙规则
iptables -F
iptables -X
iptables -Z
iptables -t nat -F
iptables -t nat -X
iptables -t nat -Z
iptables -t nat -A PREROUTING -d 192.168.247.250 -p tcp --dport 80 -j DNAT --to-destination 10.10.10.100
iptables -t nat -A PREROUTING -d 192.168.247.251 -p tcp --dport 80 -j DNAT --to-destination 10.10.10.110
5、安装mysqlmysql版本8.0.26
yum install -y mysql-server
systemctl enable --now mysqld
创建wordpress库以及账号密码
create database wordpress;
create user wordpress@'10.10.10.%' identified by 'wordpress';
grant all on wordpress.* to wordpress@'10.10.10.%' ;
创建shopxo库以及账号授权
create database shopxo;
create user shopxo@'10.10.10.%' identified by 'shopxo';
grant all on shopxo.* to shopxo@'10.10.10.%' ;
6、wordpress+php安装
wordpress版本:wordpress-6.0.1-zh_CN.tar.gz
php版本:7.4
mysql:8.0.26
rocky8版本安装php7.4
yum install -y https://mirrors.tuna.tsinghua.edu.cn/remi/enterprise/remi-release-8.rpm
yum install httpd php74-php.x86_64 php74-php-mysqlnd.x86_64php74-php-json.x86_64
启动httpd服务
systemctl enable --now httpd
tar -xf wordpress-6.0.1-zh_CN.tar.gz
mv wordpress/* /var/www/html/
chown -R apache.apache /var/www/html/
adminCP4H*4ej(%ccrGLgPF
7、shopxo+php安装shopxo版本2.2.3
php版本:7.4
下载安装包
rocky8版本安装php7.4
yum install -y https://mirrors.tuna.tsinghua.edu.cn/remi/enterprise/remi-release-8.rpm
yum -y install httpd unzip php74-php.x86_64 php74-php-mysqlnd.x86_64 php74-php-json.x86_64 php74-php-gd.x86_64 php74-php-xml.x86_64 php74-php-pecl-zip.x86_64
systemctl enable --now httpd
unzip v2.3.0.zip
mv shopxo-v2.3.0/* /var/www/html/
chown -R apache.apache /var/www/html/
9、在dns主备上测试能否解析网站注意wordpress、shopxo节点 需要指向nat节点10.10.10.250
测试wordpress.ebingou.cn网站解析
shopox.ebingou.cn网站解析
10、 启动windows虚机测试
本文标签:
很赞哦! ()
下一篇:shopxo二次开发小白进阶教程
相关教程
图文教程
shopxo安装插件还是提示绑定商店的解决方法
2.打开项目文件,shopxo/app/service/StoreService.php找到PluginsLegalCheck()方法,即第220行 注释掉,且找到第274行的RemoteStoreData()方法 (此方法远程获取数据校验插件)
shopxo是免费开源的吗?可以商用吗?
ShopXO企业级免费开源电商系统!求实进取、创新专注、自主研发、企业级电商系统解决方案。遵循MIT开源协议发布,无需授权、可商用、可二次开发、满足99%的电商运营需求。
shopxo怎么实现mysql备份
完全备份full backup:备份全部字符集增量备份incremental backup:上次完全备份或增量备份以来改变的数据,不能单独使用,要借助于完全备份,备份的频率取决于数据的更新频率
shopxo后台文件上传漏洞分析
1、进入/admin.php后台地址2、使用默认默认账号密码登录管理员账号(admin、shopxo)3、进入应用中心->应用商店->搜索主题,下载免费主题压缩包4、在下载过来的压缩包中的_static_路径中加入一句话木马
相关源码
-
(自适应)绿色农业大型机械设备展示网站模板下载基于PbootCMS内核深度定制开发的农业机械行业专用模板。针对农机设备展示、产品参数说明等需求优化设计,突出农业机械行业特性查看源码 -
(自适应)电梯扶梯升降梯行业pbootcms企业网站模板(自适应手机版)响应式电梯扶梯类pbootcms模板 电梯生产企业绿色企业网站源码下载PbootCMS内核开发的网站模板,该模板适用于电梯、扶梯类等企业,查看源码 -
粉色家政月嫂保姆公司pbootcms网站模板(PC+WAP)为家政服务、月嫂保姆企业打造的营销型解决方案,基于PbootCMS内核开发,采用温馨粉色主题传递行业温度。PHP7.0+高性能架构支持SQLite/MySQL双数据库查看源码 -
(自适应)文案文档作文写作word资源网站模板下载本模板基于PbootCMS系统深度开发,针对电影解说、文案分享类网站的特殊需求设计。采用响应式布局技术,确保在手机端和桌面端都能呈现专业的内容展示效果,帮助运营者高效管理影视解说资源。查看源码 -
(自适应html5)自媒体运营培训教程个人博客pbootcms模板本模板基于PbootCMS系统开发,特别适合自媒体运营培训、知识付费类网站使用。采用响应式设计,能够适配各类终端设备,为内容创作者提供专业的内容展示平台。查看源码 -
(PC+WAP)蓝色玻璃纤维制品环保设备营销型pbootcms模板源码下载这是一款针对玻璃纤维行业特点设计的网站模板,采用蓝色系配色方案,体现工业感和环保理念。模板包含产品中心、应用案例、技术支持和新闻动态等核心模块,能够全面展示玻璃纤维制品的技术参数和应用场景。查看源码
| 分享笔记 (共有 篇笔记) |
