1 / 35
ShopNC B2B2C 商城安装手册
天津市网城天创科技有限责任公司
2014-年 2 月
2 / 35
1. 系统介绍
ShopNC B2B2C 商城是 ShopNC 于 2014 年最新推出,采用 PHP5+MySQL 技术为基础,采用 OOP(面向
对象)方式进行核心框架搭建,结合 MVC 模式进行开发的一套电商平台系统。
2. 运行环境
项目
说明
操作系统
推荐使用 Linux,兼容 Windows,内存 >= 16G,硬盘 >= 300G
Web 服务器
Apache 或 Nginx
数据库
MySQL5 及以上版本
PHP
PHP5.2 及以上版本,支持以下扩展:
php_mysql
php_mysqli
php_gd2
php_mbstring
支持以下函数:
mysql_connect,fsockopen,gethostbyname,file_get_contents,mb_con
vert_encoding,json_encode
其它项:
file_uploads = On
upload_max_filesize = 1M
ShopNC 商城系统运行环境
推荐系统运行于 Linux + Nginx 环境。
3. 安装详解
系统运行的最佳环境是 Linux + Nginx,下面介绍一下此环境的搭建过程。
3.1 安装 Nginx
主配置文件:/Data/app/nginx/conf/nginx.conf
服务控制:service nginx (start|stop|restart|reload|configtest)
核心命令:
3 / 35
wget http://nginx.org/download/nginx-1.4.2.tar.gz
tar zxvf nginx-1.4.2.tar.gz
cd nginx-1.4.2
./configure \
"--prefix=/Data/app/nginx" \
"--sbin-path=/Data/app/nginx/sbin/nginx" \
"--conf-path=/Data/app/nginx/conf/nginx.conf" \
"--error-log-path=/Data/app/nginx/logs/error.log" \
"--http-log-path=/Data/app/nginx/logs/access.log" \
"--pid-path=/Data/app/nginx/var/nginx.pid" \
"--lock-path=/Data/app/nginx/var/nginx.lock" \
"--http-client-body-temp-path=/tmp/clientbody" \
"--http-proxy-temp-path=/tmp/proxy" \
"--http-fastcgi-temp-path=/tmp/fastcgi" \
"--http-uwsgi-temp-path=/tmp/uwsgi" \
"--http-scgi-temp-path=/tmp/scgi" \
"--user=www" \
"--group=www" \
"--without-select_module" \
"--without-poll_module" \
"--with-file-aio" \
"--with-http_realip_module" \
"--with-http_ssl_module" \
"--with-openssl=/Data/software/openssl" \
"--with-http_gzip_static_module" \
"--with-zlib=/Data/software/zlib" \
"--with-http_stub_status_module" \
"--without-http_ssi_module" \
4 / 35
"--without-http_userid_module" \
"--without-http_geo_module" \
"--without-http_empty_gif_module" \
"--without-http_map_module" \
"--without-mail_pop3_module" \
"--without-mail_imap_module" \
"--without-mail_smtp_module" \
"--with-pcre=/Data/software/pcre"
make && make install
编辑配置文件
vi /Data/app/nginx/conf/nginx.conf
加入如下内容
user www www;
error_log /Data/app/nginx/logs/error.log error;
pid /Data/app/nginx/var/run/nginx.pid;
lock_file /Data/app/nginx/var/lock/nginx;
worker_rlimit_nofile 102400;
worker_processes 2;
#worker_cpu_affinity 00000100 00001000 00010000 00100000;
events {
worker_connections 10240;
use epoll;
multi_accept on;
}
5 / 35
http {
#core
include mime.types;
default_type application/octet-stream;
client_body_buffer_size 8k;
client_body_temp_path /tmp/client_body_temp;
client_body_timeout 30;
client_header_buffer_size 32k;
large_client_header_buffers 4 32k;
client_header_timeout 30;
client_max_body_size 32m;
#keepalive_disable msie6 safari;
keepalive_timeout 3;
tcp_nodelay on;
send_timeout 30;
sendfile on;
tcp_nopush on;
server_names_hash_max_size 512;
server_names_hash_bucket_size 128;
server_tokens off;
open_file_cache off;
#index
index index.php index.html index.htm;
#fastcgi
fastcgi_connect_timeout 60;
fastcgi_read_timeout 60;
fastcgi_send_timeout 60;