Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Version Control based on Apache + Subversion under CentOS

2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

First of all, I would like to make it clear that Apache does not have to be installed. If you only need to implement version control locally under CentOS, otherwise you have to choose at least one server to use with SNV to achieve remote version control. Apache is highly recommended. There are too many advantages, such as multiple authentication and configurable use of advanced features such as SSI encryption. Of course, Apache also has some shortcomings, such as http itself is stateless. The result is that the connection speed is relatively slow, but I feel in the actual use process, as long as you are not feverish extremely gray bone, basically can be ignored, hehe.

CentOS officially has information on how to configure SVN, but it is officially installed with yum, and it is true that YUM is sometimes easy to use, but it is recommended for beginners to compile and install it. It is actually a very effective learning method and a very interesting thing to try to solve the problems that arise in this process.

CentOS official Information: http://wiki.centos.org/HowTos/Subversion?highlight=(subversion)

Installation steps:

1. Install Apache

2. Install subversion

3. Create a version library

Apache installation (the original reprinted article felt that this piece was not very good, so this piece was added.):

1. Download: CentOS Apache

[root@localhost src] # chmod + x httpd-2.2.8.tar.gz [root@localhost src] # tar-zxvf httpd-2.2.8.tar.gz

2) CentOS Apache sets the compilation parameters of the compiler

[root@localhost src] # cd httpd-2.2.8 [root@localhost httpd-2.2.8] #. / configure-prefix=/usr/local/apache2-enable-module=so

3) CentOS Apache compilation and installation:

[root@localhost httpd-2.2.8] # make & & make install

# if there are no errors, then Apache is already installed in the / usr/local/apache2 directory

4. CentOS Apache starts the service:

[root@localhost httpd-2.2.8] # / usr/local/apache2/bin/apachectl start

5. CentOS Apache determines the startup status:

[root@localhost apache2] # netstat-utltcp 0 0 *: http *: * LISTEN

# seeing the above line indicates that your Apache has been started.

# visit it with a browser and see It worksworks.This shows that apache has been installed successfully. Congratulations!

First, prepare to install the package:

Apr-1.3.6.tar.gz download address: http://apr.apache.org/apr-util-1.3.8.tar.gzsubversion-1.6.3.tar.gz download address: http://subversion.tigris.org/subversion-deps-1.6.3.tar.gzhttpd-2.2.9.tar.gz download address: http://httpd.apache.org/

Note: the compatibility between the apach version and the subversion version is described on the official website.

2. Start the installation: upload the above installation package to the / usr/local directory and enter cd / usr/local into this directory

1. Install apr

# decompress the package

Tar zxvf apr-1.3.6.tar.gz cd apr-1.3.6. / configure make & & make install

2. Install apr-util

Tar zxvf apr-util-1.3.8.tar.gz cd apr-util-1.3.8. / configure-- with-apr=/usr/local/apr make & & make install

3. Install apache

Tar zxvf httpd-2.2.9.tar.gz cd httpd-2.2.9. / configure-- prefix=/usr/local/apache2.2.9-- enable-dav-- enable-so-- enable-maintainer-mode-- with-apr=/usr/local/apr/bin/apr-1-config-- with-apr-util=/usr/local/apr/bin/apu-1-config #-- prefix means to install apache in the specified directory make & & make install

4. Install subversion

Tar zxvf subversion-1.6.3.tar.gz tar zxvf subversion-deps-1.6.3.tar.gz cd subversion-1.6.3. / configure-- prefix=/opt/svn-- with-apxs=/usr/local/apache2.2.9/bin/apxs-- with-apr=/usr/local/apr-- with-apr-util=/usr/local/apr make & & make install

At this point, the installation is basically complete, and then the configuration can be used.

Note: because these installation packages need to be compiled by gcc, make sure that the gcc program is installed on linux, otherwise there is no way to install it.

Configure SVN in apache

Vi / usr/local/apache2.2.9/conf/httpd.conf

If you see the following two sentences, the installation is successful

LoadModule dav_svn_module modules/mod_dav_svn.so LoadModule authz_svn_module modules/mod_authz_svn.so

If you have the following sentence, comment it out with #.

# LoadModule foo_module modules/mod_foo.so

Define the apache access svn configuration:

DAV svn # SVNPath / opt/svndata SVNParentPath / opt/svndata AuthzSVNAccessFile / opt/svn/conf/authz.conf AuthType Basic AuthName "Subversion repository" AuthUserFile / opt/svn/conf/passwd.conf Require valid-user

4. Configure svn

Create a directory of svn version libraries

Mkdir-p / opt/svndata/repos # can build more version library directories

Establish a svn version library

Svnadmin create / opt/svndata/repos mkdir-p / opt/svndata/repos # can build more version libraries

Establish a local access control file

/ usr/local/apache2.2.9/bin/htpasswd-c / opt/svn/conf/passwd.conf username

Then enter the password, which is encrypted by MD5 by default

/ usr/local/apache2.2.9/bin/htpasswd / opt/svn/conf/passwd.conf username1 # append users

Establish a local project control file

Touch / opt/svn/conf/authz.conf

The content of this example authz.conf is:

[groups] # =, admin=username # [: projectName/directory] # @ = # = [/] @ admin= rw # specifies that members of the user group can read and write to the root directory for all applications [repos:/abc/aaa] username1= rw # specify files that user username1 can read and write to: / abc/aaa directory

At this point, the whole installation process is complete!

5. Test connection

Start apache

/ usr/local/apache2.2.9/bin/apachectl start

Open the browser and enter http://192.168.1.107/svn/repos # in this case the server ip is 192.168.1.107

Log in with the permission username and password you just created to access

Note: when you upload a file, you may have the following hint of insufficient permissions

Permission denied svn: Commit failed (details follow): svn: Can't create directory'/ opt/svndata/repos/db/transactions/0-1.txnails: Permission denied

This is because apache users in the thread do not have access to svn's repository, and the two belong to different users.

In this case, the apache belongs to the daemon owner, while the svn repository belongs to the svn owner.

Solution:

Chown-R daemon / opt/svndata/repos chmod-R 755 / opt/svndata/repos

Restart apache:

/ usr/local/apache2.2.9/bin/apachectl stop / usr/local/apache2.2.9/bin/apachectl start3. "Could not open the requested SVN filesystem" errorcode=2

If this error occurs, you have to check whether the relevant version library path in the httpd.conf file of Apache is correct, please make sure that the absolute path is used.

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: 0

*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.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report