EvaThumber部署文档
[1] 安装curl,composer.phar组件
yum -y install curl ##已安装跳过 cd /usr/local/bin alias php='/usr/local/php/bin/php' ##已映射跳过 curl -s http://getcomposer.org/installer | php chmod a+x composer.phar alias composer='/usr/local/bin/composer.phar'
[2] 安装EvaThumber
cd /home/wwwroot/img0.xxx.com git clone git://github.com/AlloVince/EvaThumber.git mv EvaThumber evathumber ##重命名符合各个项目命名 cd evathumber composer install composer -V ##检查是否安装成功
[3] 配置Nginx的URL重写
1>mkdir /usr/local/nginx/conf/img0.xxx.com.conf 2>log_format img0.xxx.com.conf '$remote_addr - $remote_user [$time_local] "$request" ' '$status $body_bytes_sent "$http_referer" ' '"$http_user_agent" $http_x_forwarded_for'; server { listen 80; server_name img0.xxx.com; index index.html index.htm index.php default.html default.htm default.php; root /home/wwwroot/evathumber/; include img0.xxx.com.conf; location / { if (!-e $request_filename){ rewrite ^/(.*)$ /index.php last; } } location ~ .*\.(php|php5)?$ { try_files $uri =404; include fastcgi_params; fastcgi_pass unix:/tmp/php-cgi.sock; fastcgi_index index.php; include fcgi.conf; fastcgi_param SCRIPT_FILENAME /home/wwwroot/evathumber/$fastcgi_script_name; } access_log /home/wwwlogs/test.img.com.log test.img.xxx.com; }
[4] EvaThumber添加项目配置
cd /home/wwwroot/evathumber/ cp config.default.php config.local.php vim config.local.php //输入格式: return array( 'thumbers' => array( 'item' => array( 'source_path' => '/home/wwwroot/test.img.com/item/upload', 'system_file_encoding' => 'UTF-8', 'zip_file_encoding' => 'GB2312', 'thumb_cache_path' => '/home/wwwroot/test.img.com/item/upload/thumb', ) ) );
[5] 修改EvaThumber项目,添加可以识别类似http://img0.xxx.com/thumb/item/logo-20140530-538842f8990b8,w_400.jpg
cd /home/wwwroot/evathumber/src/EvaThumber vim Url.php //修改下面两个方法 public function getImagePath() { $urlImagePath = $this->getUrlImagePath(); $urlImagePathArray = explode('/', ltrim($urlImagePath, '/')); $urlImageOtherArray = explode('-', ltrim($urlImagePath, '/')); //echo '<pre>'; //print_r($urlImageOtherArray); if(count($urlImageOtherArray) == 0) { if(count($urlImagePathArray) < 4){ return ''; } //remove url key array_shift($urlImagePathArray); //remove imagename array_pop($urlImagePathArray); $this->imagePath = '/'. implode('/', $urlImagePathArray); } else { $endNode = end($urlImagePathArray); $leftNode = explode(",", $endNode); $childNode = explode("-", $leftNode[0]); array_pop($childNode); $this->imagePath = '/' . implode('/', $childNode) . '/'; } return $this->imagePath; } public function getImageName() { $urlImageName = $this->getUrlImageName(); if(!$urlImageName){ return $this->imageName = ''; } $fileNameArray = explode('.', $urlImageName); if(!$fileNameArray || count($fileNameArray) < 2){ return $this->imageName = ''; } $fileExt = array_pop($fileNameArray); $fileNameMain = implode('.', $fileNameArray); $fileNameArray = explode(',', $fileNameMain); if(!$fileExt || !$fileNameArray || !$fileNameArray[0]){ return $this->imageName = ''; } $fileNameMain = array_shift($fileNameArray); $extNameList = explode("-", $fileNameMain); //update by kewen if(count($extNameList) > 0) { $this->imageName = end($extNameList) . '.' . $fileExt; } else { $this->imageName = $fileNameMain . '.' . $fileExt; } return $this->imageName; //return $this->imageName = $fileNameMain . '.' . $fileExt; }
相关推荐
centos搭建安卓模拟器实现自动化抓包分析,内含所需全部安装包、模拟器搭建详细步骤、启动脚本、抓包脚本、自动化脚本,适合安卓开发或者APP接入服务分析。
Centos搭建KMS服务器
centos7搭建mysql集群,包含整个搭建步骤,部分错误解决方案
Centos8 搭建DNS服务器
本文介绍Centos搭建EasyDarwin流媒体服务器的基本流程,给初学者做一个参考,少走一些没必要的弯路。
centos6下搭建socket5的教程非常全面,拥有这个教程可以让你快速搭建,省去很多碰壁的麻烦
CentOS搭建NFS服务器步骤_2020022_完成版,搭建NFS必备,简单易行 CentOS搭建NFS服务器步骤_2020022_完成版,搭建NFS必备,简单易行
centos 7.9服务器 离线 搭建svn服务器 ,该文章适用于 开发人员 实施人员 项目经理用于项目文档管理 代码管理,而不指定如何在centos7.9环境下离线搭建svn服务器,因为大多数的网站只是介绍yum install 的方式,但是...
本文档使用CentOS7、mariadb、nginx、PHP7搭建PHP服务器(LNMP)
在centos linux环境下快速搭建SVN服务器环境的文档教程
linux centos搭建ftp服务器.zip
centos_下搭建postfix邮件服务器
此文档介绍了centos7环境下搭建nas服务并完成数据迁移
在Centos系统搭建Ostube2.6开源flv流媒体服务器
使用vm安装centos,然后搭建前端开发环境。可以参考一下。 使用vm安装centos,然后搭建前端开发环境。可以参考一下。 使用vm安装centos,然后搭建前端开发环境。可以参考一下。 重要的事情说三遍。
【初学者福利】虚拟机Centos7搭建MQTT服务。【注:虚拟机可连接互联网;以下指令依次进行即可】第二章附带JAVA代码。
CentOS搭建FTP服务器 本文详细描述了如何在CentOS操作系统上安装部署FTP服务器。
文档都是自己平时研究的,绝对真实,绝对可靠,一步步做的
centos搭建的solr服务器下搭建好的solr服务器,可以直接使用!!