In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-27 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
1. Description
Building apache+svn under rhel6.4 system
2. Realize
1) install and configure the SVN service on the server
2) SVN service supports svnserve independent service mode access
3) SVN service supports http mode access of Apache.
3. Install the svn server
[root@reedoracle ~] # yum install-y subversion [root@reedoracle ~] # rpm-qa | grep subversionsubversion-1.6.11-15.el6_7.x86_64
4. Install the apache server
[root@reedoracle ~] # yum install-y httpd [root@reedoracle ~] # rpm-qa | grep httphttpd-2.2.15-56.el6.centos.3.x86_64
5. Configure SVN version library
[root@reedoracle ~] # mkdir / svn [root@reedoracle ~] # svnadmin create / svn/reed # create version Library Command [root@reedoracle ~] # cd / svn/reed/ [root@reedoracle reed] # lltotal 24drwxr-xr-x 2 root root 4096 Apr 6 05:09 confdrwxr-sr-x 6 root root 4096 Apr 6 05:09 db-r--r--r-- 1 root root 2 Apr 6 05:09 formatdrwxr-xr-x 2 root root 4096 Apr 6 05:09 hooksdrwxr-xr- X 2 root root 4096 Apr 6 05:09 locks-rw-r--r-- 1 root root 229 Apr 6 05:09 README.txt
6. User password passwd configuration
[root@reedoracle reed] # cd conf/ [root@reedoracle conf] # lltotal 12 root root 1080 Apr 6 05:09 authz-rw-r--r-- 1 root root 309 Apr 6 05:09 passwd-rw-r--r-- 1 root root 2279 Apr 6 05:09 svnserve.conf [root@reedoracle conf] # vim passwd [root@reedoracle conf] # grep'^ [^ #] 'passwdusers] admin=123 # Administrator reed=123 # ordinary user deer=123 # ordinary user
7. Permission control authz configuration
[root@reedoracle conf] # vim authz [root@reedoracle conf] # grep'^ [^ #] 'authz [aliases] [groups] # administrator can read and write under the root directory (that is, / svn/reed), other users can only read and write [/] * = radmin=rw#public directory, any user can read and write [/ public] * = rw#reed directory, only admin/reed read and write, other users do not have any permission [/ reed] admin=rwreed=rw*=#deer directory, only admin/deer read and write Other users do not have any permissions [/ deer] admin=rwdeer=rw*=
8. Service svnserve.conf configuration
[root@reedoracle conf] # vim svnserve.conf [root@reedoracle conf] # grep'^ [^ #] 'svnserve.conf[ general] anon-access = none # forbids anonymous access and is set to none The default is read, and the parameter: read,write,nonepassword-db = passwd # points to the user information file authz-db = authz # points to the permission information file realm = / svn/reed # the authentication name of each SVN project, which will be displayed in the authentication prompt. It is recommended to write the project name. [sasl] [root@reedoracle conf] #
9. Start the SVN service
[root@reedoracle conf] # svnserve-d-r / svn
10. Export files using checkout
10.1. Use TortoiseSVN client to test
Create three local directories: public, reed and deer (corresponding to the permission configuration of authz)
10.2.Use the linux command line to test
[root@reedoracle deer] # svn co svn://127.0.0.1/reedAuthentication realm: / svn/reedPassword for 'root':Authentication realm: / svn/reedUsername: deerPassword for' deer':----ATTENTION! Your password for authentication realm: / svn/reedcan only be stored to disk unencrypted! You are advised to configureyour system so that Subversion can store passwords encrypted, ifpossible. See the documentation for details.You can avoid future appearances of this warning by setting the valueof the 'store-plaintext-passwords' option to either' yes' or 'no' in'/root/.subversion/servers'.----Store password unencrypted (yes/no)? YesA reed/deerA reed/publicChecked out revision 1. [root@reedoracle reed] # lsdeer public [root@reedoracle reed] # svn up .A public/restartsvn.shUpdated to revision 2. [root@reedoracle reed] #
11. Configure svn to support http access
Accessing the version library through the Http protocol is one of the highlights of Subversion. Using the Http protocol means that you can easily browse the entire version library by opening a browser and typing URL. Flexibility usually brings complexity, and the Http approach requires more configuration than the svnserve approach.
Because Subversion needs versioned control, the standard Http protocol can not meet the requirements. For Apache to work with Subversion, you need to use WebDAV (Web distributed authoring and versioning). WebDAV is an extension of HTTP 1.1. For the specification and working principle of WebDAV, please refer to IETF RFC 2518.
In order for Subversion to communicate with the dav module, the mod_dav_svn plug-in needs to be installed.
11.1. Install mod_dav_svn
[root@reedoracle conf] # yum install mod_dav_svn
11.2. Configure subversion.conf
[root@reedoracle conf.d] # grep'^ [^ #] 'subversion.confLoadModule dav_svn_module modules/mod_dav_svn.soLoadModule authz_svn_module modules/mod_authz_svn.so# the above two lines have been added by default, just add the following content DAV svnSVNPath / svn/reedAuthType Basic # using basic authentication That is, user name and password authentication AuthName "svn reed" # prompt message AuthUserFile / svn/reed/svnuser # specify the file path where the user name information is stored in http AuthzSVNAccessFile / svn/reed/conf/authz # AuthzSVNAccessFile points to the policy file Satisfy AnyRequire valid-user of authz # limit the path that the label points to only after the user enters the correct user name and password
11.3. Create an account password authentication file
The / svn/reed/conf/authz file is the authentication file used by the svnserve stand-alone server. The password is not encrypted and is displayed in clear text.
The / svn/reed/svnuser file is the authentication file used by Apache's http mode, and the password is encrypted using MD5.
The account password must be set to the same in the authz and svnuser files.
[root@reedoracle conf.d] # htpasswd-c / svn/reed/svnuser adminNew password:Re-type new password:Adding password for user admin [root@reedoracle conf.d] # htpasswd / svn/reed/svnuser reedNew password:Re-type new password:Adding password for user reed [root@reedoracle conf.d] # htpasswd / svn/reed/svnuser deerNew password:Re-type new password:Adding password for user deer
12. Start the httpd service
[root@reedoracle conf.d] # / etc/init.d/httpd startStarting httpd: httpd: apr_sockaddr_info_get () failed for reedoraclehttpd: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName [OK]
13. Testing
Through client access, enter the user password (the user password corresponding to the passwd file)
Access through the browser (user password corresponding to the svnuser file)
14. Attached
To facilitate debugging (testing needs to be restarted frequently), share a script for everyone:
#! / bin/sh. / etc/profilesvnid=$ (ps-ef | grep 'svnserve-d-r' | grep-v grep | awk' {print $2}') if [$svnid]; then kill-9$ svnid svnserve-d-r / svn echo "restart done..." else echo "not start,now begin to start..." Svnserve-d-r / svn echo "start done..." fi
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 206
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.