竹磬网-邵珠庆の日记 生命只有一次,你可以用它来做些更多伟大的事情–Make the world a little better and easier


811月/118

Git初始化错误小记

发布在 邵珠庆

在第一次 git clone ssh://project_ip/git/project.git 時候,一直發生 fatal: no matching remote head 錯誤訊息,

根據 G 大師開示,解決方法是:

在第一次專案建立時,Client 端的指令:

mkdir test 
cd test
git init 
touch .git/git-daemon-export-ok
git remote add origin ssh://project_ip/git/project.git
touch index.html
git add index.html
git commit -m "init"
git push origin master

讓 project 內有檔案,而其他電腦的 client 部份,直接 git clone 就沒有問題。

之后只使用git push就可以了

 

If you often merge with the same branch, you may want to
configure the following variables in your configuration
file:

    branch.master.remote = <nickname>
    branch.master.merge = <remote-ref>
    remote.<nickname>.url = <url>
    remote.<nickname>.fetch = <refspec>

请使用:


git config branch.master.remote origin  
git config branch.master.merge refs/heads/master 
1711月/100

解决Nginx + PHP(FastCGI)遇到的502 Bad Gateway错误

发布在 邵珠庆

由于服务器版本的不稳定,将Nginx的程序迁移到Apache执行

昨日,有朋友问我,他将Web服务器换成Nginx 0.6.31  + PHP 4.4.7(FastCGI)后,有时候访问会出现“502 Bad Gateway”错误,如何解决。
我让按照以下两个步骤去解决,最后在第2步中将FastCGI的timeout时间增加为300,问题解决:
PS:比较羡慕迅雷的Web服务器,16G内存。
1、查看当前的PHP FastCGI进程数是否够用:

netstat -anpo | grep "php-cgi" | wc -l
如果实际使用的“FastCGI进程数”接近预设的“FastCGI进程数”,那么,说明“FastCGI进程数”不够用,需要增大。


2、部分PHP程序的执行时间超过了Nginx的等待时间,可以适当增加nginx.conf配置文件中FastCGI的timeout时间,例如:

......
http
{
......
fastcgi_connect_timeout 300;
fastcgi_send_timeout 300;
fastcgi_read_timeout 300;
......
}
......