Framework

1> 初始化

  • 前提:服务器上已经装有 Apache/Nginx 和 MySQL
  • 进入 hush-framework/hush-app/bin 目录(Linux 下需执行 chmod +x hush)
  • 执行 ./hush sys init

    • 以上过程是完全自动化的
    • 看到 "Initialized successfully" 则表示成功

2> 配置 Apache/Nginx 站点

Apache 站点配置如下(Windows):

NameVirtualHost *:80

<VirtualHost *:80>

    DocumentRoot "E:/web"

    ServerName web

    <Directory />

        AllowOverride All

        Allow from all

    </Directory>

</VirtualHost>

<VirtualHost *:80>

    DocumentRoot "E:/web/platform/Demos/hush-framework/hush-app/web/backend"

    ServerName hush-app-backend

    <Directory />

        AllowOverride All

        Order deny,allow

        Allow from all

    </Directory>

</VirtualHost>

<VirtualHost *:80>

    DocumentRoot "E:/web/platform/Demos/hush-framework/hush-app/web/frontend"

    ServerName hush-app-frontend

    <Directory />

        AllowOverride All

        Order deny,allow

        Allow from all

    </Directory>

</VirtualHost>

Listen 8001

<VirtualHost *:8001>

    DocumentRoot "E:/web/platform/Demos/info-demos/server/www/server"

    ServerName Demos-app-api

    <Directory />

        AllowOverride All

        Order deny,allow

        Allow from all

    </Directory>

</VirtualHost>

Listen 8002

<VirtualHost *:8002>

    DocumentRoot "E:/web/platform/Demos/info-demos/server/www/website"

    ServerName Demos-app-web

    <Directory />

        AllowOverride All

        Order deny,allow

        Allow from all

    </Directory>

</VirtualHost>

Nginx 站点配置如下:

server {
listen 80;
server_name hush-app-backend;
root /path/to/hush/hush-app/web/backend;
location / {
index index.html index.htm index.php;
if (!-e $request_filename) {
rewrite ^(.*)$ /index.php?$1 last;
break;
}
}
location ~ .*\.php$ {
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME /path/to/hush/hush-app/web/backend$fastcgi_script_name;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
}
} server {
listen 80;
server_name hush-app-frontend;
root /path/to/hush/hush-app/web/frontend;
location / {
index index.html index.htm index.php;
if (!-e $request_filename) {
rewrite ^(.*)$ /index.php?$1 last;
break;
}
}
location ~ .*\.php$ {
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME /path/to/hush/hush-app/web/frontend$fastcgi_script_name;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
}
} server {
listen 8001;
server_name zjgx-app-api;
root /path/to/Demos/info-demos/server/www/server;
location / {
index index.html index.htm index.php;
if (!-e $request_filename) {
rewrite ^(.*)$ /index.php?$1 last;
break;
}
}
location ~ .*\.php$ {
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME /path/to/hush/hush-app/web/backend$fastcgi_script_name;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
}
} server {
listen 8002;
server_name zjgx-app-web;
root /path/to/Demos/info-demos/server/www/website;
location / {
index index.html index.htm index.php;
if (!-e $request_filename) {
rewrite ^(.*)$ /index.php?$1 last;
break;
}
}
location ~ .*\.php$ {
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME /path/to/hush/hush-app/web/frontend$fastcgi_script_name;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
}
}

4> 修改本地 hosts 文件

为了便于调试,建议开发者修改本地的 hosts 文件来访问站点:

127.0.0.1 hush-app-frontend
127.0.0.1 hush-app-backend

重新启动 Apache/Nginx 服务器,就可以在浏览器中访问应用界面。

Quick Development Guide

主要命令

  • 注意:执行 ./hush 即可看到所有命令
  • hush sys init:系统初始化,建议仅在首次安装的时候使用
  • hush sys uplib:更新依赖类库,当类库有更新的时候使用
  • hush sys newapp:根据当前应用框架的代码生成新应用
  • hush sys newdao:生成新的数据库模块类(Model)
  • hush sys newctrl:生成新的控制器类(Controller)
  • hush check all:检查所有运行目录的路径和权限
  • hush clean all:清除模板缓存以及文件缓存
  • hush doc build:生成 Hush 基础类库和应用框架的文档
  • hush db backup [database]:备份指定数据库,[database] 是根据 database.mysql.php 文件中的 $_clusters 变量指定的,比如:default:0:master:0:ihush_apps 代表 $_clusters['default'][0]['master'][0] 的数据库配置,ihush_apps 代表数据库名
  • hush db recover [database]:恢复制定数据库,[database] 的规则和 hush db backup [database] 命令相同

最新文章

  1. Android学习网站
  2. Mutex vs Semaphore
  3. VC6.0代码移植到VS2008运行时乱码问题解决
  4. 悟透Javascript undefined,null,&quot;&quot;,0这四个值转换为逻辑值时就是false &amp;this关键字
  5. hdu 2295 Radar 重复覆盖+二分
  6. QGIS1.8.0的编译
  7. LXC学习实践(2)安装LXC
  8. Spring请求参数校验
  9. [Swift]LeetCode211. 添加与搜索单词 - 数据结构设计 | Add and Search Word - Data structure design
  10. Ubuntu设置su和sudo为不需要密码 (摘录自别处)
  11. 华为SSH认证配置
  12. ubuntu 安装 GCC 和 G++ C++ 开发环境
  13. oracle用户权限和角色
  14. 【repost】一探前端开发中的JS调试技巧
  15. linux中如何通过echo输出!(叹号)? -bash: !&quot;: event not found
  16. as3 三行三列 布满9个为一个界面
  17. To 初识Java的小菜菜们 嘻嘻~
  18. 如何理解精通PHP ?
  19. webpack编译报错:Module not found: Error: Cannot resolve &#39;file&#39; or &#39;directory&#39; ./../../node_modules..
  20. express常用代码片段

热门文章

  1. SSDP 简单服务发现协议
  2. iOS开发--自动布局
  3. PHP组合模式、策略模式
  4. ubuntu下搭建cocos2dx编程环境-上
  5. Sublime Text 新建文件可选类型的模版插件: SublimeTmpl
  6. iOS 证书调试的理解(Personal)
  7. babel安装
  8. Maven+Spring+Hibernate+Shiro+Mysql简单的demo框架(一)
  9. 2-Medium下的MultipleCommandAssembly
  10. 转:java中scanner类的用法