歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Linux基礎 >> 關於Linux >> centos6.4 x64位系統安裝apache+ssl+svn vipyhd著作

centos6.4 x64位系統安裝apache+ssl+svn vipyhd著作

日期:2017/3/1 16:18:18   编辑:關於Linux
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
Copyright © Linux教程網 All Rights Reserved