CentOS 6.0 下安装 Apache PHP SVN MySQL

[1]最小安装CentOS 6.0,并更新

[2]安装MySQL
    [2.1]yum install mysql-server
    [2.2]chkconfig --levels 345 mysqld on
    [2.3]编辑/etc/my.cnf,设置MySQL的默认字符编码为UTF-8,在[mysqld]中添加
        character-set-server = utf8
        character-set-filesystem = utf8
    [2.4]service mysqld start
    [2.5]设置root密码
        mysql_secure_installation

[3]安装Apache
    [3.1]yum install httpd
    [3.2]让Apache支持SSL
        yum install mod_ssl
    [3.3]chkconfig --levels 345 httpd on
    [3.4]service httpd start

[4]安装PHP
    [4.1]yum install php
    [4.2]yum install php-mysql php-gd php-xml
    [4.3]service httpd restart

[5]安装SVN
    [5.1]yum install subversion mod_dav_svn mod_auth_mysql
    [5.2]配置SVN
        [5.2.1]创建项目仓库
            mkdir -p /var/www/svn
            cd /var/www/svn
            svnadmin create firstrepo
            chown -R apache.apache firstrepo
            chcon -R -t httpd_sys_content_t firstrepo
        [5.2.2]创建基于路径的SVN访问控制文件
            vi /var/www/svn/SVNAccessFile
            {
                [group]
                dev = member001,member002
               
                [/]
                * = r
               
                [firstrepo:/]
                member001 = rw
            }
        [5.2.3]修改SVN配置文件
            vi /etc/httpd/conf.d/subversion.conf
            {
                LoadModule dav_svn_module     modules/mod_dav_svn.so
                LoadModule authz_svn_module   modules/mod_authz_svn.so
               
                <Location /svn/>
                    DAV svn
                    SVNListParentPath on
                    SVNParentPath /var/www/svn/
                    AuthzSVNAccessFile /var/www/svn/SVNAccessFile
                   
                    SVNIndexXSLT "/repos-web/view/repos.xsl"
                   
                    <LimitExcept GET PROPFIND OPTIONS REPORT>
                        # Require SSL connection for password protection.
                        # SSLRequireSSL
                       
                        AuthType Basic
                        AuthName "Authorization Subversion"
                       
                        AuthMYSQLEnable on
                        AuthMySQLHost localhost
                        AuthMySQLPort 3306
                        AuthMySQLUser auth
                        AuthMySQLPassword 123456
                        AuthMySQLDB auth
                        AuthMySQLUserTable users
                        AuthMySQLNameField name
                        AuthMySQLPasswordField pass
                        AuthMySQLGroupField group
                        AuthMySQLPwEncryption crypt
                       
                        require group svn
                       
                        Require valid-user
                    </LimitExcept>
                </Location>
               
                RedirectMatch ^(/svn)$ $1/
               
                CustomLog logs/svn_logfile "%t %u %{SVN-ACTION}e" env=SVN-ACTION
            }
        [5.2.4]service httpd restart

相关推荐