sudo apt-get install php5 php5-cli php5-curl php5-fpm php5-intl php5-mcrypt php5-mysqlnd php5-gd
sudo vim /etc/php5/fpm/php.ini
post_max_size = 1024M
memory_limit = 1024M
upload_max_filesize = 1024M
vim /etc/php5/fpm/pool.d/www.conf
找到:
;listen.owner = www-data
;listen.group = www-data
;listen.mode = 0660
去除最前面的分号。
sudo /etc/init.d/php5-fpm restart
sudo apt-get install nginx
sudo vim /etc/nginx/nginx.conf
在 http{} 字段里添加
client_max_body_size 1024M;
sudo vim /etc/nginx/sites-enabled/edusoho
输入以下内容
server {
listen 80;
# [改] 域名
10.200.4.57;
#301跳转可以在nginx中配置
# 文件指向目录
root /home/jenkins_home;
index index.html index.jsp;
# 开启文件下载
autoindex on;
# 日志路径
access_log /var/log/nginx/example.com.access.log;
error_log /var/log/nginx/example.com.error.log;
location / {
index app.php;
try_files $uri @user1;
}
location @user2 {
rewrite ^(.*)$ /app.php/$1 last;
}
location ~ ^/udisk {
internal;
root /var/www/edusoho/app/data/;
}
location ~ ^/(app|app_dev)\.php(/|$) {
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_split_path_info ^(.+\.php)(/.*)$;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param HTTPS off;
fastcgi_param HTTP_X-Sendfile-Type X-Accel-Redirect;
fastcgi_param HTTP_X-Accel-Mapping /udisk=/var/www/edusoho/app/data/udisk;
fastcgi_buffer_size 128k;
fastcgi_buffers 8 128k;
}
# 配置设置图片格式文件
location ~* \.(jpg|jpeg|gif|png|ico|swf)$ {
# 过期时间为3年
expires 3y;
# 关闭日志记录
access_log off;
# 关闭gzip压缩,减少CPU消耗,因为图片的压缩率不高。
gzip off;
}
# 配置css/js文件
location ~* \.(css|js)$ {
access_log off;
expires 3y;
}
# 禁止用户上传目录下所有.php文件的访问,提高安全性
location ~ ^/files/.*\.(php|php5)$ {
deny all;
}
# 以下配置允许运行.php的程序,方便于其他第三方系统的集成。
location ~ \.php$ {
# [改] 请根据实际php-fpm运行的方式修改
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_split_path_info ^(.+\.php)(/.*)$;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param HTTPS off;
fastcgi_param HTTP_PROXY ;
}
}
sudo /etc/init.d/nginx restart
为什么要写这一篇呢?因为要和持续集成的测试报告做关联,感兴趣的朋友猜猜看