技术分享:Ubuntu8.10Server中Apache+SVN+SSL配置方法揭秘

开发 项目管理
本文主要介绍一下Ubuntu8.10Server中Apache+SVN+SSL配置问题,主要包括SSL配置及个人的一个小小的总结,希望本文能够是你的视野更加开阔。

本节接着上节介绍Ubuntu8.10Server中Apache+SVN+SSL配置问题,在学习SVN的过程中,随着SVN的广泛应用,难免会遇到SVN在多种操作系统中的配置问题,本节就和大家一起学习一下Ubuntu8.10Server中Apache+SVN+SSL配置,希望通过本文你能学到更多有关SVN方面的知识。下面是具体介绍。

四、SSL配置
首先我们来看一下Apache+SVN+SSL配置中SSl的配置。这里可以参考:http://www.cnblogs.com/passos/archive/2006/02/18/332992.html
关于SSL的配置很多,这里我根据实际情况,做了一个简单实用的SSL加密机制。方法如下:
Apache2在Ubuntu系统内的基本情况如下
默认站点在/var/www/
配置文件在/etc/apache2/
日志在/var/log/apache/
启动脚本是/usr/sin/apache2ctl或者/etc/init.d/apache2
Apache2已经在前面安装好了下面安装SSL模块:
安装SSL模块
#a2enmodssl创建默认的SSL证书(默认证书不是很好用)
#apache2-ssl-certificate
我们可以使用openssl来创建,这里我就是此方法创建SSL证书的
#sudoopensslreq-x509-newkeyrsa:1024-keyoutapache.pem-outapache.pem-nodes-days999注:在要求输入CommonName(eg,YOURname)时,输入你的主机名。
示例过程如下:

  1. #/usr/local/svn#sudoopensslreq-x509-newkeyrsa:1024-keyoutapache.pem-outapache.pem-nodes-days365Generatinga1024bitRSAprivatekey.  
  2. ++++++..++++++writingnewprivatekeyto'apache.pem'-----  
  3. Youareabouttobeaskedtoenterinformationthatwillbeincorporatedintoyourcertificaterequest  
  4. .WhatyouareabouttoenteriswhatiscalledaDistinguishedNameoraDN.  
  5. TherearequiteafewfieldsbutyoucanleavesomeblankForsomefieldstherewillbeadefaultvalue,  
  6. Ifyouenter'.',thefieldwillbeleftblank.-----CountryName(2lettercode)[AU]:Chinastringistoolong,  
  7. itneedstobelessthan2byteslongCountryName(2lettercode)[AU]:CNStateorProvinceName(fullname)  
  8. [Some-State]:JiangxiLocalityName(eg,city)[]:NanchangOrganizationName(eg,company)[InternetWidgitsPtyLtd]  
  9. :NanchangUnversityOrganizationalUnitName(eg,section)[]:InformationCenterCommonName(eg,YOURname)[]  
  10. :LinuxServerEmailAddress[]:111@gmail.com 

复制一份站点配置做为SSL配置的原型
#cp/etc/apache2/sites-available/default/etc/apache2/sites-available/ssl#ln-s/etc/apache2/sites-available/ssl/etc/apache2/sites-enabled/ssl
编辑SSL的配置
#vi/etc/apache2/sites-enabled/ssl
把端口改为443加入SSL认证配置
其它的根据需要自己定制与普通配置无异
ServerSignatureOnSSLEngineOnSSLCertificateFile/etc/apache2/ssl/apache.pemServerAdminwebmaster@localhostDocumentRoot/var/www/OptionsFollowSymLinksAllowOverrideNoneOptionsIndexesFollowSymLinksMultiViewsAllowOverrideNoneOrderallow,denyallowfromallScriptAlias/cgi-bin//usr/lib/cgi-bin/AllowOverrideNoneOptions+ExecCGI-MultiViews+SymLinksIfOwnerMatch"/etc/apache2/sites-enabled/ssl"45L,1055C
修改普通http方式的配置(apache2这里好像不用改,默认的已经是80端口)#vi/etc/apache2/sites-enabled/000-default把端口改为80
NameVirtualHost*:80ServerAdminwebmaster@localhost#[......]
编辑Apache+SVN+SSL配置中Apache端口配置,加入443端口(SSL的)#vi/etc/apache2/ports.conf:Listen80Listen443
源文件内容:
NameVirtualHost*:80Listen80#Listen443#SSLnamebasedvirtualhostsarenotyetsupported,thereforeno#NameVirtualHoststatementhereListen443
这里可以不用加“Listen443”因为SSL默认认证的443端口已经打开。
别忘了把前面生成的SSL密钥文件拷贝过来
#/usr/local/svn#sudocp/proc/14646/cwd/apache.pem
重新载入Apache的配置
#/etc/init.d/apache2force-reload或者#/etc/init.d/apache2restart
以下是Apache+SVN+SSL配置中SSL的配置文件的示例:
 

  1. NameVirtualHost*:443  
  2. <VirtualHost*:443> 
  3. ServerSignatureOn  
  4. SSLEngineOn  
  5. SSLCertificateFile/etc/apache2/ssl/apache.pem  
  6. ServerAdminwebmaster@localhost  
  7. DocumentRoot/var/www/  
  8. <Directory/> 
  9. OptionsFollowSymLinks  
  10. AllowOverrideNone  
  11. Directory> 
  12. <Directory/var/www/> 
  13. OptionsIndexesFollowSymLinksMultiViews  
  14. AllowOverrideNone  
  15. Orderallow,deny  
  16. allowfromall  
  17. #Thisdirectiveallowsustohaveapache2'sdefaultstartpage  
  18. #in/apache2-default/,butstillhave/gototherightplace  
  19. #CommentedoutforUbuntu  
  20. #RedirectMatch^/#/apache2-default/  
  21. Directory> 

五、总结
以上是我个人查阅相关资料及实践测试的基础上总结出来的Ubuntu8.10Server上搭建
Apache+SVN+SSL模式版本控制系统的经验,安装和配置过程中注意细心仔细,重要的配置文件注意先备份再修改,以备配置失败还原之用。本节关于Apache+SVN+SSL配置讲解完毕,请关注本节其他相关报道。 

【编辑推荐】

  1. Linux下apache+svn+ssl完美结合搭建安全版本控制平台
  2. Linux下如何进行apache+svn+ssl配置详解
  3. Fedora下SVN+TRAC+APACHE+SSL安装全程跟踪
  4. RedHatAS下SVN安装配置技术分享
  5. Fedora下SVN+TRAC+APACHE+SSL安装步骤简明介绍

 

责任编辑:佚名
相关推荐

2010-05-25 19:31:03

Apache+SVN+

2010-05-25 18:32:22

apache+svn+

2010-05-28 18:53:36

配置SVN1.4.5

2010-05-25 18:20:54

apache+svn+

2010-05-25 18:45:05

2010-05-31 13:00:49

MyEclipse配置

2010-05-25 19:57:32

2010-05-31 18:20:25

配置SVN访问

2010-02-07 14:41:28

Ubuntu 8.10

2010-05-26 15:53:52

SVN服务

2010-06-01 17:03:59

SVN用户

2010-05-31 13:11:45

MyEclipse下S

2010-05-25 11:24:30

SVN安装配置

2010-03-12 15:02:02

2010-06-02 14:41:46

SVN建库

2010-03-16 18:44:55

Ubuntu 8.10

2010-03-15 15:49:01

Ubuntu 8.10

2010-05-25 18:59:37

2010-06-02 16:19:28

SVN协议

2010-05-27 18:09:08

Apache SVN配
点赞
收藏

51CTO技术栈公众号