1.centos7 yum安装phpMyAdmin
yum install phpmyadmin
yum install php-mcrypt
vi /etc/phpMyAdmin/config.inc.php(默认,暂时不用修改)
vi /etc/httpd/conf.d/phpMyAdmin.conf(注意使用rpm -qa|grep httpd查看apache版本是不是2.4)
Alias /phpMyAdmin /usr/share/phpMyAdmin
Alias /phpmyadmin /usr/share/phpMyAdmin
<IfModule mod_authz_core.c>
# Apache 2.4
<RequireAny>
Require all granted
Require ip IP
</RequireAny>
</IfModule>
</Directory>
<Directory /usr/share/phpMyAdmin/setup/>
<IfModule mod_authz_core.c>
# Apache 2.4
<RequireAny>
Require all granted
Require ip IP
</RequireAny>
</IfModule>
</Directory>
<Directory /usr/share/phpMyAdmin/libraries/>
Order Deny,Allow
Deny from All
Allow from None
</Directory>
<Directory /usr/share/phpMyAdmin/setup/lib/>
Order Deny,Allow
Deny from All
Allow from None
</Directory>
<Directory /usr/share/phpMyAdmin/setup/frames/>
Order Deny,Allow
Deny from All
Allow from None
</Directory>
浏览器http://IP:端口号/phpmyadmin/(登录账号使用mysql的账户密码)
mysql -u root -p
create database svn;
grant all on svn.* to guowang@localhost identified by "123456";
flush privileges;
\q
vi /etc/httpd/conf.d/svnmanager.conf
<Directory "/var/www/html/svnmanager/">
Options FollowSymLinks
AllowOverride None
Order deny,allow
Deny from all
Allow from all
</Directory>
cd /opt/svn
touch passwd authz
vi config.php
$svn_config_dir="/tmp";
$svn_repos_loc="/opt/svn";
$svn_passwd_file="/opt/svn/passwd";
$svn_access_file="/opt/svn/authz";
$dsn="mysqli://guowang:123456@localhost/svn";
浏览器输入http://IP:端口号/svnmanager/即可
报错1:
测试创建库时报错:fopen(/opt/svn/shop/conf/authz): failed to open stream: Permission denied (@line 207 in file /var/www/html/svnmanager/svnmanager/library/class.accessfile.php
vi /var/www/html/svnmanager/svnmanager/library/class.accessfile.php(发现没有W权限)
解决1:chmod 666 authz
报错2:
编辑库用户组时报错:PHP Fatal error: Class 'PEAR_ErrorStack' not found in /var/www/html/svnmanager/svnmanager/RepositoryModule/UserPrivilegesEditPage.php on line 203
vi UserPrivilegesEditPage.php(发现pear指向错误)
find / -name SVN.php
解决2:
pear uninstall VersionControl_SVN-0.5.0
pear install PEAR-1.9.4
pear install VersionControl_SVN-0.4.0(按照网上方法这样做任然没有解决问题,报错如下)
报错3
svn: E180001: Unable to open repository 'file:///opt/svn/app' (cmd: /usr/bin/svn list --config-dir /opt/svn --non-interactive 'file:///opt/svn/app')
Command used: /usr/bin/svn list --config-dir /opt/svn --non-interactive 'file:///opt/svn/app'
解决3:
pear install VersionControl_SVN-0.4.0(0.5.2换成0.4.0)
chmod 777 /opt/svn(可以看见权限和属主都和以前的root不一样)
报错4:
[authz_svn:error] [pid 9649]
[auth_basic:error] [pid 9653]
解决4:
chown -R apache.apache /opt/svn/accessfile
chown -R apache.apache /opt/svn/passwdfile
2.2svn文件同步到web服务器,即同步到apache的根目录,每一秒同步一次
# vi /opt/wc/web.sh
#!/bin/bash
step=2
for (( i = 0; i < 60; i=(i+step) )); do
svn checkout http://110.120.130.140:1111/svn/web/ /var/www/html/web/
sleep $step
done
exit 0
# crontab -e
* * * * * /opt/wc/web.sh
3.centos7 yum安装memadmin
tar -zxvf memadmin-1.0.12.tar.gz
cp -R memadmin /var/www/html
vi /etc/httpd/conf.d/memadmin.conf
<Directory "/var/www/html/memadmin">
Options FollowSymLinks(Indexes表示当前目录没有index.html就显示目录结构)
AllowOverride None (none表示服务器将忽略.htacess文件)
Order deny,allow (进行WEB访问先后顺序deny和allow对应下一行权限控制)
Deny from all
Allow from all
</Directory>
systemctl restart httpd
vi /var/www/html/memadmin/config.php
$config['user'] = "管理员账号"; // your username
$config['passwd'] = "管理员密码"; // your password
浏览器输入:http://IP:端口/memadmin即可