Apapche httpd installation and configuration of SVN based on Linux

Recommended for you: Get network issues from WhatsUp Gold. Not end users.

 

Around for a long time, finally last night completed! The following post process, a share, two record.

The required in preparing documents and the records word document also share in the paper the following (due to 10M restrictions, so the batch upload).

Format is very poor, please forgive me, thank you!

 

1, Environment and prepare documents

System: Ubuntu 12.04

File: httpd-2.4.6.tar.gz

subversion-1.8.3.tar.gz

apr-1.4.8.tar.gz

apr-util-1.5.2.tar.gz

pcre-8.33.tar.gz

sqlite-autoconf-3080100.tar.gz

zlib-1.2.8.tar.gz

 

 

2, Install Apache httpd

1), Unzip the tar -zxvf httpd-2.4.6.tar.gz

2), Enter the folder CD httpd-2.4.6/

3), To configure

 

/configure --prefix=/usr/local/apache2 --enable-so --enable-dav --enable-module=so --enable-mods-shared=all --enable-rewrite --enable-cache

 

Find the following error occurred:

 

checking for APR... no
configure: error: APR not found. Please read the documentation.

 

Upon inquiry, found that the installation of Apache httpd pre installed APR, apr-util, prce, It is also mentioned in the official website. So, you must install APR, apr-util, prce, see Step 3, 4, 5.

4), Reconfiguration (if 3) no problem can be skipped), after the above 3 file installation, re configuration,

 

./configure --prefix=/usr/local/apache2 --enable-so --enable-dav --enable-module=so --enable-mods-shared=all --enable-rewrite --enable-cache --with-apr=/usr/local/apr/ --with-apr-util=/usr/local/apr-util/ --with-pcre=/usr/local/pcre/

 

5), The sudo make compiler

6), The installation of sudo make install

7), The test run

Start: sudo /usr/local/apache2/bin/apachectl -k start

If the error:

 

AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1. Set the 'ServerName' directive globally to suppress this message

 

To configure the ServerName, specific:

sudo gedit /usr/local/apache2/conf/httpd.conf

Add to: ServerName 127.0.0.1:80

Restart the browser 127.0.0.1:80, input It works showed the success!!

Close service: sudo /usr/local/apache2/bin/apachectl -k stop

Attached to: CSDN the article above good record of the various problems encountered during the installation process, very detailed.

 

3, Install APR

1), Unzip the tar -zxvf apr-1.4.8.tar.gz

2), Enter the folder CD apr-1.4.8/

3), To configure./configure --prefix=/usr/local/apr

4), The sudo make compiler

5), The installation of sudo make install

 

4, Install apr-util

1), Unzip the tar -zxvf apr-util-1.5.2.tar.gz

2), Enter the folder CD apr-util-1.5.2/

3), To configure./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr/

4), The sudo make compiler

5), The installation of sudo make install

 

5, Install PCRE

1), Unzip the tar -zxvf pcre-8.33.tar.gz

2), Enter the folder CD pcre-8.33/

3), To configure./configure –prefix=/usr/local/pcre

If the configure: error: You need a C++ compiler for C++ support. error, you need to install the C++ compiler, available via the sudo apt-get install build-essential (Debian Edition)

4), The sudo make compiler

5), The installation of sudo make install

 


6, Install SVN

1), Unzip the tar -zxvf subversion-1.8.3.tar.gz

2), Enter the folder CD subversion-1.8.3/

3), To configure

 

./configure –-prefix=/usr/local/subversion/--with-apxs=/usr/local/apache2/bin/apxs --with-apr=/usr/local/apr/ --with-apr-util=/usr/local/apr-util/ --with-sqlite=/usr/local/sqlite/ --with-zlib=/usr/local/zlib/ --enable-maintainer-mode

 

If you find an error: configure: error: Subversion requires SQLite

Install the SQLite, as shown in Figure 7.

Then, if the error: configure: error: subversion requires zlib, install the zlib, as shown in Figure 8.

4), Re configuration, with 3).

5), The sudo make compiler

6), The installation of sudo make install

7), Test sudo /usr/local/subversion/bin/svnserve –-version

If the version information, is installed successfully!

8), Environment variables, to facilitate the next start, add the following information to environmental variables:

 

#svn
export SVN_HOME=/usr/local/subversion
export PATH=$PATH:$SVN_HOME/bin

 

Effective configuration file source /etc/profile

 


7, Install SQLite

1), Unzip the tar -zxvf sqlite-autoconf-3080100.tar.gz

2), Enter the folder CD sqlite-autoconf-3080100/

3), To configure./configure –-prefix=/usr/local/sqlite

4), The sudo make compiler

5), The installation of sudo make install

 

8, Install zlib

1), Unzip the tar -zxvf zlib-1.2.8.tar.gz

2), Enter the folder CD zlib-1.2.8/

3), To configure./configure –-prefix=/usr/local/zlib

4), The sudo make compiler

5), The installation of sudo make install

 

9, The SVN configuration

1), Select the root directory and repository

 

svnadmin create /home/<your name>/repository/svn/jbbs

 

This step generates some basic files and configuration of the project repository

Note: /home/<your name> /repository/svn SVN root directory, need to create, jbbs product of the project repository specific

2), Configuration, in the conf folder has three main file configuration:

svnserve.conf: The SVN service configuration file.

passwd: The user name password file.

authz: Permissions configuration file.

3), The configuration of svnserve.conf

 

anon-access = none
auth-access = write
password-db = passwd
authz-db = authz

 

The above configuration refers to:

Anonymous users do not have access, users can write, password configured in the passwd file, the permissions in the authz file. We can according to their own circumstances change.

4), The configuration of passwd

harry = harryssecret

sally = sallyssecret

The user name and password are

5), The configuration of authz

[groups]

@<User group name > = <1>, <user; user 2>

[<The repository: > / project / directory]

@<User group name > = <authority>

<The user name > = <authority>

Detailed configuration can refer to this Bo Wen

 

10, Svn starts off

1), Start SVN:

Methods: start a port number svnserve -d -r /opt/svn/ # default is 3690

Mode two: Su - <start the user> -c "svnserve -d –listen-port 9999 -r /opt/svn/"

Among them:

su –<Start the user > SVN says start to start the identity of the user, the user can add,

-d said to daemon (background) operation,

–Listen-port 9999 uses port 9999, can be replaced with the ports that you need. But note, using 1024 port requires root permission,

-r /home/<your name>/repository/svn/ Specify the root directory.

2), Check whether the start

netstat -tunlp | grep svn

If the following information that started successfully

tcp 0 0 0.0.0.0:3690 0.0.0.0:* LISTEN 22887/svnserve

3), If you want to stop the SVN, use the following command:

killall svnserve


11, Combined with the Apache start SVN

1), Configure the Apache configuration file

Add in /apache2/conf/httpd.conf:

 

LoadModule dav_svn_module modules/mod_dav_svn.so
LoadModule authz_svn_module modules/mod_authz_svn.so
<Location /svn>
DAV svn
SVNParentPath /home/<your name>/repository/svn
AuthType Basic
AuthName "Welcome to Subversion!"
AuthUserFile /etc/subversion/passwd
AuthzSVNAccessFile /etc/subversion/authz
Require valid-user
</Location>

 

Interpretation:

The root directory SVNParentPath SVN

AuthType this directive chosen user authentication type a directory

The AuthName string is supplied to the AuthName will be available in most browsers password dialog box.

AuthUserFile specifies the SVN access password file

AuthzSVNAccessFile specifies the permissions file SVN access

Among them:

About AuthUserFile:

First need to create a user file. Apache provides a tool for generating user file, htpasswd, can be found in the Apache installation directory. Following are the specific method of use: htpasswd /etc/subversion/passwd username. If the passwd does not exist, can add the -c option in htpasswd to create a new. Create the file content is user name and password encrypted MD5.

For example:

 

sudo /usr/local/apache2/bin/htpasswd -c /etc/subversion/passwd tom

 

About AuthzSVNAccessFile: that is the same as the above 9 authz, can be the reference configuration.

Detailed explanation seeThis blogAnd this blog.

This may report errors:

 

httpd: Syntax error on line 518 of /usr/local/apache2/conf/httpd.conf: Cannot load modules/mod_dav_svn.so into server: /usr/local/apache2/modules/mod_dav_svn.so: cannot open shared object file: No such file or directory

 

This is because the mod_dav_svn.so

And the mod_authz_svn.so file is not found, the two files in the SVN directory are copied to the /apache2/modules/ directory

Then restart the service:

sudo /usr/local/apache2/bin/apachectl -k restart

May find error:

 

httpd: Syntax error on line 163 of /usr/local/apache2/conf/httpd.conf: Cannot load modules/mod_dav_svn.so into server: /usr/local/apache2/modules/mod_dav_svn.so: undefined symbol: dav_do_find_liveprop

 

The reason is not loaded mod_dav.so, the solution is found in httpd.conf:

#LoadModule dav_module modules/mod_dav.so , Remove the front # No.

Restarting the browser, enter the address:

If there is

Forbidden

You don't have permission to access /svn on this server.

The root directory cannot be accessed, these errors can be made byhttpd.confIn the<Location /svn>Change into<Location /svn/>

If there is

Not Found

The requested URL /svn was not found on this server.

The root directory is not found, the error is not known, but the repository directory can go in, estimation is right reason. But the access

jbbs - Revision 0: /

The success.!!

 


Million years the crater has finally come to an end!!!
One thirty-two on October 31, 2013 26 seconds

 

(paper/p)

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download

Posted by Richard at January 17, 2014 - 10:40 AM