APACHE+SVN Environment construction under Linux (v)

Source: Internet
Author: User

Before setting up the following packages, recommended to the Apache official website to download: http://httpd.apache.org/

Apr-1.4.6.tar.gz
Apr-util-1.4.1.tar.gz
Httpd-2.2.16.tar.gz
Openssl-1.0.0a.tar.gz
Subversion-1.6.1.tar.gz
Subversion-deps-1.6.1.tar.gz
Neon-0.30.1.tar.gz
expat-2.1.1.tar.bz2

After all the compressed packages are downloaded, it is recommended to put them uniformly in a directory, for example I was put in:/home/svn_apachetool

The process of building is: Install httpd first, then install Subversion, and then configure it, follow the steps below

First, install the apr-1.4.6.tar.gz
#tar-ZVXF apr-1.4.6.tar.gz
#cd apr-1.4.6
#./configure--PREFIX=/USR/LOCAL/APR
#make && make Install

Second, installation apr-util-1.4.1.tar.gz
#tar-ZVXF apr-util-1.4.1.tar.gz
#cd apr-util-1.4.1
#./configure--with-apr=/usr/local/apr/
#make && make Install

Third, installation httpd-2.2.16.tar.gz
#tar-ZVXF httpd-2.2.16.tar.gz
#cd httpd-2.2.16
#./configure--prefix=/usr/local/apache--enable-dav--enable-so--enable-headers--enable-expires-- Enable-mods-shared=all--with-apr=/usr/local/apr/bin/apr-1-config--with-apr-util=/usr/local/apr-util/bin/ Apu-1-config
#make && make Install
After installation, start the Apache service:
#/usr/local/apache/bin/apachectl–k Start
To view http://localhost/in a browser, if it works, it shows that Apache has been configured successfully.

Iv. installation of subversion-1.6.1
1. First install the openssl-1.0.0a.tar.gz
#tar-ZXVF openssl-1.0.0a.tar.gz
#cd opennssl-1.0.01a
#./config--prefix=/usr/local/ssl
#./config-t
#make depend
#make && make Install

2. Unzip the subversion-1.6.1.tar.gz and ssubversion-deps-1.6.1.tar.gz into the same directory.
#tar ZXVF subversion-1.6.1.tar.gz
#tar ZXVF subversion-deps-1.6.1.tar.gz

3. Replace the neon in subversion and install it.
#tar-ZXVF neon-0.30.1.tar.gz
#mv neon-0.30.1.tar.gz Neon
#cd subversion-1.6.1
#rm-RF Neon
#cp-R .../neon./
#cd Neon
#./configure
#make && make Install

4. Delete the APR and Apr-util directories in subversion1.6.1
#cd subversion-1.6.1
#rm-RF Apr
#rm-RF Apr-util

5. Compiling and installing the zlib in subversion1.6.1
#cd./subversion-1.6.1/zlib
#./configure
#make && make Install

6. Installing expat-2.1.1.tar.bz2
#tar ZXVF expat-2.1.1.tar.bz2
#cd expat-2.0.1
#./configure
#make && make Install

7. Configuring and Compiling subversion1.6.1
#./configure--PREFIX=/USR/LOCAL/SVN--with-apxs=/usr/local/apache/bin/apxs--with-apr=/usr/local/apr/bin/ Apr-1-config--with-apr-util=/usr/local/apr/bin/apu-1-config--with-openssl=/usr/local/ssl--with-zlib=/home/svn_ apachetool/subversion-1.6.1/zlib/--enable-maintianer-mode
#make && make Install

8. Create and import a repository
[Email protected]/]# cd/usr/local/subversion/bin/
[Email protected] bin]# Mkdir/repo
[Email protected] bin]#/svnadmin Create--fs-type Fsfs/repo/te
[Email protected] bin]# ls/repo/te/
If ls/repo/te/appears below, the Subversion installation is successful.
CONF DAV db format hooks locks README.txt

Import the Repository
[Email protected] bin]#/svn import/root/test/file:///repo/te/-M "Initial import"

The revised version after submission is 1.

9. Modify Directory Permissions
[Email protected] bin]# cd/repo/te/
[[email protected] te]# CHMOD-R 777 *

10. Modify the Apache configuration file
1). Open vim/usr/local/apache/conf/httpd.conf File
2). Modify the httpd.conf file to add the following lines at the end of the file
<Location/svn>
DAV SVN
Svnparentpath/repo
</Location>
3). Save exit

As specified above, SVN does not require permissions, that is, any anonymous user can access, modify, Commit
In the actual use, you need to have permission to control the line, so the configuration file needs to be detailed configuration as follows:

Enter the Cd/usr/local/apache/bin directory, set up user groups and user files can of course also be in other folders

To create a user group file:
# Touch Authz

Write the following in the Authz file, the following code shows that the user group Admin has lyd,zzq two users, the admin group to [/] indicates that the root directory has read and Write permissions R for reading W representative write:

[Groups]
admin = lyd,zzq
[/]
@admin = RW

Create a user, where the user needs to be in the user group above in order to have the appropriate permissions:
HTPASSWD-CM pwd.txt Lyd First created, plus the-CM parameter, you need to create a user file Pwd.txt, of course, you can also use the name or suffix name

HTPASSWD Pwd.txt Zzq was created the second time because the user file was created for the first time, so just add the user directly to the user file

Modify the apache/conf/httpd.conf file, add the following code at the end, specify the repository location for SVN and the file you just created, the permissions you want to use

<Location/svn>

DAV SVN

svnparentpath/repo/
Authzsvnaccessfile/usr/local/apache/bin/authz
AuthType Basic
AuthName "Subversion.tom"
Authuserfile/usr/local/apache/bin/pwd.txt
Require Valid-user


</Location>

11. Restart the Apache service.
[Email protected] bin]# cd/usr/local/apache/bin/
[[email protected] bin]#./apachectl stop
[[email protected] bin]#./apachectl start
or direct restart.

Start SVN
/usr/local/subversion/bin/svnserve-d-r/repo

12. Testing

Under window, check out the project as follows:

Click OK, enter the user name and password, if you can check out the success, to this build completed

APACHE+SVN Environment construction under Linux (v)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.