前言
虽然amh5.0出来了,但是JaneCC还是习惯使用4.2的版本。理由嘛大家都懂(5.0收费呗)!
amh4.2官方的php版本是5.3.27,nginx是1.4.7,现在php稳定版已经到5.3.28(很多程序都不支持PHP5.5的命名空间)了,nginx稳定版已经1.6.2了,mysql完美兼容稳定版的MariaDB!所以嘛,JaneCC就对AMH修改了下,把mysql替换成了MariaDB,nginx换成了Tengine,PHP升级到了5.3.28。
这次修改版本是基于【AMH 4.2 ? 麦葱修改版发布 [tengine最新版+php最新版]】优化自用版
修改项
- 添加pcre-8.36
- 添加zlib-1.2.8
- 添加openssl-1.0.2
- 添加jemalloc-3.6.0(并优化MySQL和Nginx)
- 添加ssh ip黑名单: http://antivirus.neu.edu.cn/scan/ssh.php
- 替换php-5.3.27为php-5.3.28
- 替换nginx-1.4.7为tengine-2.1.0
- 替换mysql-5.5.34为MariaDB-5.5.42
- 修改提示文字为中文
- 修改错误提示页
使用方法
1、安装wget命令
Centos:
1 |
yum install -y wget |
Debian/Ubuntu:
1 |
apt-get install wget |
2、运行一句话安装命令
1 |
wget http://cdn.janecc.com/amh/amh-janecc.sh && bash amh-janecc.sh 2>&1 | tee amh-janecc.log |
本地安装,下载 http://pan.baidu.com/s/1gdzqdt5
扩展
自阿里云开源项目Cube.css能多个css合并只有,就有留意这种技术,多方了解只有才知道,需要服务器支持,所以今天在AMH 4.2 ? JaneCC修改版的基础上开启了这个功能
编译启用动态加载模块: mod_concat
Tengine动态加载模块的编译安装方法,参考官方文档http://tengine.taobao.org/document_cn/dso_cn.html
Tengine所有的HTTP功能模块,都可以在configure的时候,通过 --with-http_xxxx_module=shared 的形式编译为动态加载模块,如果不指定=shared 则会被静态编译到Tengine的核心中;安装动态加载模块用 make dso_install命令;

编译安装完成后,ngx_http_concat_module.so文件会被安装到Tenginx安装目录下的modules目录内;
编辑/usr/local/nginx/conf/nginx.conf配置文件,添加如下红色代码,让Tengine启动时动态加载刚刚编译的ngx_http_concat_module.so

重启Tengine,查看已加载模块
1 2 3 4 5 6 7 8 9 10 11 12 13 |
service nginx restart /usr/local/nginx/sbin/nginx -l #列出Tenginx所有支持的功能模块(包括静态与动态)-命令 ...... output_buffers ngx_http_range_body_filter_module: ngx_http_not_modified_filter_module: ngx_http_concat_module (shared): concat concat_max_files concat_unique concat_types concat_delimiter concat_ignore_file_error |
具体配置:
1 2 3 4 5 6 7 8 |
location / { concat on; #启用concat函数 concat_max_files 20; concat_unique off; #允许返回不同类型的文件内容(js,css同时合并) concat_delimiter " "; #自动在返回每个文件内容的末尾添加换行符 concat_ignore_file_error off; #不要忽略所合并的文件不存在等错误 } |
按官方介绍配置后总是对js无效,而仅是css有效,仔细阅读文档之后,才发现是concat_types默认值得问题
concat_types MIME types
默认: concat_types: text/css application/x-javascript
上下文: http, server, location
定义哪些MIME types是可以被接受
编辑/usr/local/nginx/conf/nginx.conf配置文件,在http{}中加加入
1 2 3 4 |
http{ concat on; concat_types text/css application/javascript; } |
本文转自:
1 |
http://www.janecc.com/ |
文章评论
路过 必须支持啊