How to install apache + subversion in Ubuntu

Source: Internet
Author: User
Yesterday spent nearly a day to install apache + subversion under Ubuntu, here a brief summary of the installation process because of the installation of apache2 in sudoapt-getinstallapache2, because of the need to integrate with svn, there are some necessary so files that need to be re-compiled, so we should directly use the source code to compile and install them. Note: I started to use linux, and many of them did not understand it. I checked the information on the Internet, thank you for your contribution.

It took nearly one day yesterday to install apache + subversion under Ubuntu. Here is a brief summary of the installation process.

If you use sudo apt-get install apache2 to install apache2, You need to integrate it with svn and re-compile some necessary so files. Therefore, you need to directly compile and install the files using the source code. Note: I used linux at the beginning. Many people do not understand it. I checked the information on the Internet. So I would like to thank the majority of netizens for their contributions. Because I checked a lot, I forgot the specific information, here is the link.

During the installation process, I personally think it is a little easier to switch from a root user to a root user. Otherwise, I accidentally Fail the file because it does not have the read and write permissions, Which is troublesome, haha, I installed it directly under the root user.

Preparation: Download httpd.2.2.9.tar.gz and subversion-deps-1.5.1.tar. bz subversion-1.5.1.tar.gz

1. Install apache2.2

Tar zxvf httpd.2.2.9.tar.gz

Cd httpd.2.2.9

./Configure -- enable-dav -- enable-so -- prefix =/opt/apache2.2

Note: -- enable-dav allows Apache to provide DAV protocol support; -- enable-so allows the DSO module to be loaded at runtime; -- prefix specifies the installation directory of apache.

Make

Make install

Note: Some fail may occur in configure and make, but often because there is a lack of necessary libraries, you can directly install apt-get install, I have installed three, which is intuitive.

In this case, apache should be installed. Test it,/opt/apache2/bin/apachectl-k start, and enter http: // locahost in the browser.

Under normal circumstances, It works should appear!

2. Install subversion

This is annoying, mainly to deal with this, but it was really annoying for nearly a day. After downloading the source code, decompress the two files to the same directory (there are no identical files in the two packages)

Cd subversion

. /Configure -- with-apxs =/opt/apache2/bin/apxs -- with-apr =/opt/apache2 -- with-apr-util =/opt/apache2 -- prefix =/opt /subversion

-- With-apxs =/opt/apache2/bin/apxs: generate two so, mod_authz_svn.so, mod_dav_svn.so

-- With-apr =/opt/apache2 -- with-apr-util =/opt/apache2 to prevent apr Mismatch

This step is also the same. There may be such a library without fail, so the installation will be OK.

Make

This step is the key. I just made a mistake at this moment. It took most of the time to change it.

There is an ERROR:/usr/bin/ld: cannot find-lexpat

Let me start with an apt-get install lexpat. I cannot find it. I just used it. I don't know what the library is about. Later I checked that lexpat had to install expat.

OK, apt-get install expat. After the installation is complete, the installation will not work, and the error information will be the same. This is really annoying.

Google, check it and find that it will read/usr/lib/libexpat. so, let's take a look. I'm dizzy. Why didn't I have libexpat. so, try apt-get install expat again, and check again. It seems that this is a big problem.

Search for google again, "but/usr/lib has/usr/lib/libexpat. so.1, so we made a link. The command is ln-s/usr/lib/libexpat. so.1/usr/lib/libexpat. so ", this is written by a renxiong on the Internet. Haha, it seems that I am saved. Let's take a look. I'm dizzy. I have more than one here.

Libexpat. so.1 libexpat. so.1.5.0

I feel that it is still a new version of 1.5.0. Just copy libexpat. so.1.5.0 and rename libexpat. so.

Make

An error occurred again. However, the information is different, which indicates that this operation is acceptable.

ERROR: relocation R_X86_64_32 can not be used when making a shared object; recompile with-fPIC

This error, in simple words, seems to be because 32-bit cannot be used in 64-Bit mode, and-fPIC is added in a certain place. I don't know where to add it. It seems that cainiao is a dish, there is no way. I can only go to google again. There are a lot of google resources.

Modify subversion/nero/src/Makefile and change CFLAGS =-g-O2 to CFLAGS =-fPIC-g-O2.

Wow, I used to add-fPIC here, and bold here. Please note that, haha, if it is a 32-bit OS, this error will not occur.

But I did not try

OK, make & make install. Everything works.

Add/opt/subversion/bin to path for ease of use

Vi/etc/profile

Add export PATH = $ PATH:/opt/subversion/bin

Now, the installation is successful. Haha, there is no other meaning. In fact, it is just a bit of fun on your own machine. It is mainly to familiarize yourself with some basic usage in linux.

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.