开源项目shopxo电商平台的部署(腾讯云平台centos7.3)

本文详细介绍了在CentOS环境下从零开始搭建LNMP(Linux+Nginx+MySQL+PHP)架构的过程,并成功安装了ShopXO电商系统。包括解决依赖、配置参数、编译安装等关键步骤。

一、平台搭建在LNMP上,所以应该先搭建LNMP架构

首先建立目录:

[root@VM_0_13_centos ~]# mkdir /usr/local/lnmp

1.首先安装nginx

这里时用的版本是nginx-1.14.0,解压

[root@VM_0_13_centos ~]# tar zxf nginx-1.14.0.tar.gz 
[root@VM_0_13_centos ~]# cd nginx-1.14.0/

修改配置文件,使无法看到nginx的具体版本,防止利用版本漏洞恶意破坏

[root@VM_0_13_centos nginx-1.14.0]# vim src/core/nginx.h
#define NGINX_VER          "nginx/"

添加配置,首先下载gcc

[root@VM_0_13_centos nginx-1.14.0]# yum install -y gcc
[root@VM_0_13_centos nginx-1.14.0]# ./configure --prefix=/usr/local/lnmp/nginx --with-threads --with-file-aio --with-http_ssl_module --with-http_stub_status_module --user=nginx --group=nginx

出现错误:

./configure: error: the HTTP rewrite module requires the PCRE library.

在这里插入图片描述
解决方法:

[root@VM_0_13_centos nginx-1.14.0]# yum install pcre-devel -y

再次执行
出现错误:

./configure: error: SSL modules require the OpenSSL library.

解决办法:

[root@VM_0_13_centos nginx-1.14.0]# yum -y install openssl openssl-devel

再次执行,成功!
在这里插入图片描述
编译安装:

[root@VM_0_13_centos nginx-1.14.0]# make && make install

成功!
在这里插入图片描述
修改配置文件并进行测试:

[root@VM_0_13_centos nginx-1.14.0]# vim /usr/local/lnmp/nginx/conf/nginx.conf
  1 
  2 user  nginx nginx;
  3 worker_processes  auto;
[root@VM_0_13_centos sbin]# useradd nginx

检查配置文件是否出错

[root@VM_0_13_centos nginx-1.14.0]# cd /usr/local/lnmp/nginx/sbin
[root@VM_0_13_centos sbin]# ./nginx -t

查看版本

[root@VM_0_13_centos sbin]# ./nginx -v
nginx version: nginx/

查看添加配置时使用参数

[root@VM_0_13_centos sbin]# ./nginx -V
nginx version: nginx/
built by gcc 4.8.5 20150623 (Red Hat 4.8.5-36) (GCC) 
built with OpenSSL 1.0.2k-fips  26 Jan 2017
TLS SNI support enabled
configure arguments: --prefix=/usr/local/lnmp/nginx --with-threads --with-file-aio --with-http_ssl_module --with-http_stub_status_module --user=nginx --group=nginx

在这里插入图片描述
制作软链接并测试

[root@VM_0_13_centos sbin]# ln -s /usr/local/lnmp/nginx/sbin/nginx /usr/local/sbin/
[root@VM_0_13_centos sbin]# nginx -t
nginx: the configuration file /usr/local/lnmp/nginx/conf/nginx.conf syntax is ok
nginx: configuration file /usr/local/lnmp/nginx/conf/nginx.conf test is successful

可以使用
在这里插入图片描述
启动nginx并查看端口

[root@VM_0_13_centos sbin]# nginx 
[root@VM_0_13_centos sbin]# netstat -antlp

在这里插入图片描述
测试nginx的工作是否正常,输入ip
在这里插入图片描述
正常工作

2.安装php

这里使用的是php-5.6.35
首先解压

[root@VM_0_13_centos ~]# tar jxf php-5.6.35.tar.bz2

解决依赖性

<
评论 10
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值