继续前面的,需要部署h5服务端
一、修改apache的httpd.conf
LoadModule rewrite_module modules/mod_rewrite.so 将前面的#去掉
DocumentRoot “/usr/local/www”
Directory “/usr/local/www”
这里的路径应该是包含ecshop和appserver的路径
Include conf/extra/httpd-vhosts.conf将前面的#去掉
二、ecshop和appserver所属修改
查看httpd.conf查看里面的User和Group,然后将ecshop和appserver的own修改与配置一样
这一步很重要,否则会出现网络连接异常的问题
三、配置conf/extra下面的httpd-vhosts.conf文件
<VirtualHost *:80>
ServerAdmin 管理员邮箱
DocumentRoot "/usr/local/www/ecshop"
ServerName 没有www的域名
ServerAlias 带www的域名
ErrorLog "logs/dummy-host.example.com-error_log"
CustomLog "logs/dummy-host.example.com-access_log" common
<Directory "/usr/local/www/ecshop">
SetOutputFilter DEFLATE
Options FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
DirectoryIndex index.html index.php
RewriteEngine on
# Don't rewrite files or directories
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]
# Rewrite everything else to index.html to allow html5 state links
RewriteRule ^ index.php [L]
</Directory>
</VirtualHost>
<VirtualHost *:80>
ServerAdmin 管理员邮箱
DocumentRoot "/usr/local/www/appserver/public/"
ServerName api.域名=>比如api.maxooo.com
ErrorLog "logs/dummy-host2.example.com-error_log"
CustomLog "logs/dummy-host2.example.com-access_log" common
<Directory "/usr/local/www/appserver/public/">
SetOutputFilter DEFLATE
Options FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
DirectoryIndex index.html index.php
RewriteEngine on
# Don't rewrite files or directories
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]
# Rewrite everything else to index.html to allow html5 state links
RewriteRule ^ index.php [L]
</Directory>
</VirtualHost>
四、修改appserver下面的.env
里面出现域名的地方都修改为实际的域名
APP_ENV=local
APP_LOCALE=zh-CN
APP_TIMEZONE=PRC
APP_NAME=ECAPI
#显示调试信息
APP_DEBUG=false
#商城url
SHOP_URL=http://www.ecshopdemo.com
#注册协议地址
TERMS_URL=http://www.ecshopdemo.com/article.php?cat_id=-1
#你的商城地址/article.php?cat_id=-1
ABOUT_URL=http://www.ecshopdemo.com/article.php?cat_id=-2
#你的商城地址/article.php?cat_id=-2
DB_CONNECTION=shop
DB_TIMEZONE=+08:00
#商城数据库
SHOP_DB_HOST=localhost
SHOP_DB_PORT=3306
SHOP_DB_DATABASE=数据库名
SHOP_DB_USERNAME=数据库用户名
SHOP_DB_PASSWORD=数据库密码
SHOP_DB_PREFIX=数据库前缀
#Token授权加密key
TOKEN_SECRET=请输入32位Token密钥(32位字母加数字即可)
TOKEN_ALG=HS256
TOKEN_TTL=43200
TOKEN_REFRESH=false
TOKEN_REFRESH_TTL=1440
TOKEN_VER=1.0.0
#短信验证信息模版
SMS_TEMPLATE=#CODE#,短信验证码有效期30分钟,请尽快进行验证。
#缓存 支持 file memcached redis
CACHE_DRIVER=file
#队列处理
QUEUE_DRIVER=sync
#邮件发送配置
MAIL_DRIVER=smtp
MAIL_HOST=smtp.xxx.com
MAIL_PORT=25
MAIL_USERNAME=mail@xxx.com
MAIL_PASSWORD=xxx
MAIL_FROM_ADDRESS=mail@xxx.com
MAIL_FROM_NAME=
五、修改/ecshop/h5/config/config.app.js
var GLOBAL_CONFIG = {
‘API_HOST’: ‘http://api.ecshopdemo.com‘,//此处修改为您的API地址
‘APP_NAME’: ‘Demo’,
‘APP_DESC’: ‘This is a demo’,
‘APP_KEYWORDS’: ‘Demo, Shop’,
‘DEBUG’: false
};