使用百度Bae遇到的问题及解决方法

使用BAE有小段时间了,写一下使用百度Bae遇到的问题及解决方法

1.使用Git发布时提示如下

1
2
3
4
5
6
7
8
9
10
$ git push
Counting objects: 1620, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (1592/1592), done.
error: RPC failed; HTTP 411 curl 22 The requested URL returned error: 411 Length Required
fatal: The remote end hung up unexpectedly
Writing objects: 100% (1620/1620), 23.54 MiB | 13.99 MiB/s, done.
Total 1620 (delta 114), reused 0 (delta 0)
fatal: The remote end hung up unexpectedly
Everything up-to-date

Push文件过大,在.git/config 文件中加入

Windows:

1
2
[http]
postBuffer = 524288000

linux:

1
git config http.postBuffer 52428800

2.发布过程太麻烦,批处理一键搞定

在.git/config 文件中加入,之后直接输入 Git blog 就可以实现版本发布了

1
2
[alias]
blog = !git add . && git commit -m 'blog update' && git push

然后新建cmd,键入以下内容

1
2
3
G:
cd appidbdxxxxxxxx(每个人的都不同)
git blog

之后本地改动文件后,打开新建的cmd文件就可以直接发布了。

3.伪静态的问题,修改app.conf文件

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
########################## BAE application config file ######################
#
# app.conf 采用YAML格式, 请参考 http://yaml.org/
# 请尽量不要在配置部分使用中文,以免发布失败
# 请不要使用TAB键,应该使用空格
# 一定要注意对齐,否则发布会失败
# app.conf 详细功能,请参考:
# http://bce.baidu.com/doc/BAE/GUIGettingStarted.html#.E9.85.8D.E7.BD.AEapp.conf
# http://godbae.duapp.com/?p=654
#
##############################################################################
handlers:
- url : (.*)\.css$
script : $1.css
- url : (.*)\.js$
script : $1.js
- url : (.*)\.woff$
script : $1.woff
- url : (.*)\.ttf$
script : $1.ttf
- url : (.*)\.svg$
script : $1.svg
- url : (.*)\.otf$
script : $1.otf
- url : (.*)\.eot$
script : $1.eot
- url : (.*)\.jpg$
script : $1.jpg
- url : (.*)\.gif$
script : $1.gif
- url : (.*)\.png$
script : $1.png
- url : (.*)\.jpeg$
script : $1.jpeg
- url : (.*)\.html$
script : $1.html
- url : /sitemap.html$
script : sitemap.html
- url : (.*).xml$
script : $1.xml
- url : (.*)\.php$
script : $1.php
- url : /favicon.ico$
script : favicon.ico
- url : /wp\-admin/
script : /wp-admin/index.php
- url : (.*)
script: index.php
- expire : .jpg modify 10 years
- expire : .swf modify 10 years
- expire : .png modify 10 years
- expire : .gif modify 10 years
- expire : .JPG modify 10 years
- expire : .ico modify 10 years

结束


评论: