技術(shù)分享:Ubuntu8.10Server中Apache+SVN+SSL配置方法揭秘
本節(jié)接著上節(jié)介紹Ubuntu8.10Server中Apache+SVN+SSL配置問題,在學(xué)習(xí)SVN的過程中,隨著SVN的廣泛應(yīng)用,難免會遇到SVN在多種操作系統(tǒng)中的配置問題,本節(jié)就和大家一起學(xué)習(xí)一下Ubuntu8.10Server中Apache+SVN+SSL配置,希望通過本文你能學(xué)到更多有關(guān)SVN方面的知識。下面是具體介紹。
四、SSL配置
首先我們來看一下Apache+SVN+SSL配置中SSl的配置。這里可以參考:http://www.cnblogs.com/passos/archive/2006/02/18/332992.html
關(guān)于SSL的配置很多,這里我根據(jù)實際情況,做了一個簡單實用的SSL加密機制。方法如下:
Apache2在Ubuntu系統(tǒng)內(nèi)的基本情況如下
默認站點在/var/www/
配置文件在/etc/apache2/
日志在/var/log/apache/
啟動腳本是/usr/sin/apache2ctl或者/etc/init.d/apache2
Apache2已經(jīng)在前面安裝好了下面安裝SSL模塊:
安裝SSL模塊
#a2enmodssl創(chuàng)建默認的SSL證書(默認證書不是很好用)
#apache2-ssl-certificate
我們可以使用openssl來創(chuàng)建,這里我就是此方法創(chuàng)建SSL證書的
#sudoopensslreq-x509-newkeyrsa:1024-keyoutapache.pem-outapache.pem-nodes-days999注:在要求輸入CommonName(eg,YOURname)時,輸入你的主機名。
示例過程如下:
- #/usr/local/svn#sudoopensslreq-x509-newkeyrsa:1024-keyoutapache.pem-outapache.pem-nodes-days365Generatinga1024bitRSAprivatekey.
- ++++++..++++++writingnewprivatekeyto'apache.pem'-----
- Youareabouttobeaskedtoenterinformationthatwillbeincorporatedintoyourcertificaterequest
- .WhatyouareabouttoenteriswhatiscalledaDistinguishedNameoraDN.
- TherearequiteafewfieldsbutyoucanleavesomeblankForsomefieldstherewillbeadefaultvalue,
- Ifyouenter'.',thefieldwillbeleftblank.-----CountryName(2lettercode)[AU]:Chinastringistoolong,
- itneedstobelessthan2byteslongCountryName(2lettercode)[AU]:CNStateorProvinceName(fullname)
- [Some-State]:JiangxiLocalityName(eg,city)[]:NanchangOrganizationName(eg,company)[InternetWidgitsPtyLtd]
- :NanchangUnversityOrganizationalUnitName(eg,section)[]:InformationCenterCommonName(eg,YOURname)[]
- :LinuxServerEmailAddress[]:111@gmail.com
復(fù)制一份站點配置做為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認證配置
其它的根據(jù)需要自己定制與普通配置無異
修改普通http方式的配置(apache2這里好像不用改,默認的已經(jīng)是80端口)#vi/etc/apache2/sites-enabled/000-default把端口改為80
NameVirtualHost*:80
編輯Apache+SVN+SSL配置中Apache端口配置,加入443端口(SSL的)#vi/etc/apache2/ports.conf:Listen80Listen443
源文件內(nèi)容:
NameVirtualHost*:80Listen80#Listen443
這里可以不用加“Listen443”因為SSL默認認證的443端口已經(jīng)打開。
別忘了把前面生成的SSL密鑰文件拷貝過來
#/usr/local/svn#sudocp/proc/14646/cwd/apache.pem
重新載入Apache的配置
#/etc/init.d/apache2force-reload或者#/etc/init.d/apache2restart
以下是Apache+SVN+SSL配置中SSL的配置文件的示例:
- NameVirtualHost*:443
- <VirtualHost*:443>
- ServerSignatureOn
- SSLEngineOn
- SSLCertificateFile/etc/apache2/ssl/apache.pem
- ServerAdminwebmaster@localhost
- DocumentRoot/var/www/
- <Directory/>
- OptionsFollowSymLinks
- AllowOverrideNone
- < span>Directory>
- <Directory/var/www/>
- OptionsIndexesFollowSymLinksMultiViews
- AllowOverrideNone
- Orderallow,deny
- allowfromall
- #Thisdirectiveallowsustohaveapache2'sdefaultstartpage
- #in/apache2-default/,butstillhave/gototherightplace
- #CommentedoutforUbuntu
- #RedirectMatch^/#/apache2-default/
- < span>Directory>
五、總結(jié)
以上是我個人查閱相關(guān)資料及實踐測試的基礎(chǔ)上總結(jié)出來的Ubuntu8.10Server上搭建
Apache+SVN+SSL模式版本控制系統(tǒng)的經(jīng)驗,安裝和配置過程中注意細心仔細,重要的配置文件注意先備份再修改,以備配置失敗還原之用。本節(jié)關(guān)于Apache+SVN+SSL配置講解完畢,請關(guān)注本節(jié)其他相關(guān)報道。
【編輯推薦】
- Linux下apache+svn+ssl完美結(jié)合搭建安全版本控制平臺
- Linux下如何進行apache+svn+ssl配置詳解
- Fedora下SVN+TRAC+APACHE+SSL安裝全程跟蹤
- RedHatAS下SVN安裝配置技術(shù)分享
- Fedora下SVN+TRAC+APACHE+SSL安裝步驟簡明介紹