centos6.4 x64位系统安装apache+ssl+svn vipyhd著作


centos6.4 x64位系统安装apache+ssl+svn vipyhd著作
 
一、安装:
    yum install httpd httpd-devel mod_dav_svn subversion mod_ssl
  a. 确定已经安装了svn模块:mod_dav_svn
           #cd /etc/httpd/modules
           #ls | grep svn
             mod_authz_svn.so
             mod_dav_svn.so
       如果要确认是否成功的安装了svn可以通过如下的命令进行验证:
           svn --version
   b. 确认apache能正常启动。
   测试Apache是否可以正常启动:
      #service httpd start
   在浏览器中访问:http://localhost, 如果能看到Apache的页面,则说明Apache已经正常启动。
   Apache命令:
         启动:apachectl -k start / service httpd start
         关闭:apachectl -k stop
         重启:apachectl -k restart
         查看日志:tail -f /etc/httpd/logs/error-log
二、配置
  进入到/etc/httpd/conf.d目录下用vim打开subversion.conf配置文件进行选项的
  修改:
  a. module的配置
  一定要保证下面的两句话存在于配置文件中,否则无法在如svn的模块(如果是用YUM安装的话,下面两个模块在安装的过程中已经改好了)。
               LoadModule dav_svn_module     modules/mod_dav_svn.so
               LoadModule authz_svn_module   modules/mod_authz_svn.so
  b. 仓库目录配置
              
下面将使用svnregister这个仓库来配置Subversion
# mkdir -p /data/svn/repo
 
# cd /data/svn/repo
 
# svnadmin create vipyhd
 
# chown -R apache.apache vipyhd
<Location /svn/>
              DAV svn
              SVNParentPath  /data/svn/repo
              SVNListParentPath on
              AuthType  Basic
              AuthName  ”www.vprisk.com“
              AuthUserFile  "/data/svn/userfile"
              AuthzSVNAccessFile  "/data/svn/accessfile"
              Require  valid_user
</Location>
RedirectMatch ^(/svn)$ $1/
 下面建立可访问用户文件
# htpasswd -c /data/svn/userfile vipyhd
要增加用户,则使用下面命令
# htpasswd /data/svn/userfile yhd
重起Apache
service httpd restart 
 下面创建权限访问控制文件,把内容填写如下红色字体两行:
 # vi /data/svn/accessfile
 [/]
 *=rw
 
  重启apache.
# service httpd restart
三、如果您的CentOS系统装了seLinux,还需要进行如下配置,不然会报各种“没有权限”错误。
 编辑/etc/sysconfig/selinux,把SELINUX设定为disable,下次启动系统后将不会自动启动SElinux即可。
[root@SVNMANAGER repo]# service iptables stop
[root@SVNMANAGER repo]# chkconfig --level 345 iptables off
Subversion部分安装完成,打开浏览器访问http://localhost/svn/vipyhd即可看到效果。
四、设置apache开机启动
在/etc/rc.d/rc.local中增加启动apache的命令,例如:/usr/local/httpd/bin/apachectl start
五:
#cd /etc/httpd/conf
  # openssl genrsa -out httpd.key 1024  生成一个私钥文件
  # openssl req -new -key httpd.key -out httpd.pem -days 3650 -x509
再红线处依次填写:国家,省份,城市,公司,部门,网络名,邮箱完成。
修改apache使ssl生效
 # vim /etc/httpd/conf.d/ssl.conf
-------------------------------
#   Server Certificate:
# Point SSLCertificateFile at a PEM encoded certificate.  If
# the certificate is encrypted, then you will be prompted for a
# pass phrase.  Note that a kill -HUP will prompt again.  A new
# certificate can be generated using the genkey(1) command.
SSLCertificateFile /etc/httpd/conf/httpd.pem
#   Server Private Key:
#   If the key is not combined with the certificate, use this
#   directive to point at the key file.  Keep in mind that if
#   you've both a RSA and a DSA private key you can configure
#   both in parallel (to also allow the use of DSA ciphers, etc.)
SSLCertificateKeyFile /etc/httpd/conf/httpd.key
------------------
 vi /etc/httpd/conf/httpd.conf
<Directory />
    Options FollowSymLinks
    AllowOverride None
    SSLRequireSSL
</Directory>
加入开机启动
chkconfig httpd on
vim /etc/rc.local 
----
svnserve -d -r /svn/repo

相关内容

    暂无相关文章