服务器php一直用5.2.17现在升级了5.3.X,困难重重~显示libiconv错误,然后是php-fpm配置警告~
不过检查php-fpm配置可以是使用
php-fpm -t来检车配置
说明:nginx用80,apache用8080,这样可以使用apache的模块
提示:svn: 版本库永久移到 “http://svn.phpfs.com/”;请重新定位。
解决办法:去掉apache中documentroot配置
提出来完整配置:
nginx主机配置(将svn.phpfs.com全部转发给apache)
server {
listen 80;
server_name svn.phpfs.com;
root /varw/www/html/svn;
location / {
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-Proto https;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://svn.phpfs.com:8080;
}
}
apache的配置是这样的
NameVirtualHost 192.168.1.128:8080#这个当然不是我主机的ip了~嘿嘿
<VirtualHost 192.168.1.128:8080>
ServerName svn.phpfs.com
#DocumentRoot /var/www/html/svn,这个会导致提示,svn转移啥的~千万不要带
<Directory /var/www/html/svn>
order allow,deny
allow from all
</Directory>
</VirtualHost>
配置svn使用mysql认证
<Location /test>
DAV svn
SVNPath /var/www/html/svn/test #svn的真实路径
Authtype Basic
AuthName “svn.phpfs.com”
AuthMYSQLEnable on #开启mysql认证
AuthMYSQLHost localhost #mysql服务器地址
AuthMYSQLPort 3306 #mysql服务器端口
AuthMYSQLUser svn #登录数据库服务器的用户名
AuthMYSQLPassword test #密码
AuthMYSQLDB svn #数据库名字
AuthMYSQLUserTable user #表名字
AuthMYSQLNameField username #帐号字段名
AuthMYSQLPasswordField password #认证密码字段名
AuthMYSQLPwEncryption md5
Require valid-user
</Location>
安装SVN看这里:http://blog.phpfs.com/archives/1525.html
svn checkout http://192.168.1.107/svn/test_svn /var/www/html/test
会需要输入svn帐号和密码
其中test_svn是通过
svnadmin create test_svn
而/var/www/html/test是你的网站根目录
PS:我提交就更新网站?怎么做?利用svn钩子文件更新网站!
钩子文件:
#!/bin/bash
svn update /var/www/news
chown -R www.www /var/www/news
这个是post-commit文件(在hosk目录下)
但是这个一直不能执行!
1.要有执行权限
2.这个需要是www用户
3.www用户可执行bash
测试方法:可以先sudo su www
如果提示This account is currently not available.那是因为www用户的命令是nologin,所以需要修改www的shell为/bin/bash,然后sudo su www,执行env – ./post-commit