Home  >  Article  >  Backend Development  >  Building NGINX+SVN under CentOS 2012-07-22 16:56:26

Building NGINX+SVN under CentOS 2012-07-22 16:56:26

WBOY
WBOYOriginal
2016-07-30 13:29:47858browse

Because there is nothing to customize, svn is installed directly using the package management software that comes with the system.

Taking the centos series as an example, the command is as follows:

yum install subversion

Then install nginx:

mkdir -p/opt/soft

groupadd web

useradd http -g web -s /sbin/nologin

cd /opt/soft

wget http ://sourceforge.net/projects/pcre/files/pcre/8.12/pcre-8.12.tar.gz

wget http://www.openssl.org/source/openssl-1.0.0d.tar. gz

tar zxvf pcre-8.12.tar.gz

tar zxvf openssl-1.0.0d.tar.gz

tar zxvf nginx-0.8.54.tar.gz

cd nginx-0.8.54

./configure --prefix=/opt/nginx --user=http --group=web --with-http_stub_status_module --with-http_ssl_module --with-md5= /usr/lib/ --with-pcre=/opt/soft/pcre-8.12 --with-openssl=/opt/soft/openssl-1.0.0d

make

make install

root specified to /data/wwwroot

vi /opt/nginx/conf /nginx.conf ...

Create svn repository:

s

vnadmin create /data/svnModify configuration file:

vi /data/svn/conf/authz

[groups]

admin=test #Members in the admin group

[/]

test = rw #Member permissions on/directory: r read, w write

vi /data/svn/conf/passwd

[users]

test = 123456 #Password of user test

vi /data/svn/conf/sv nserve.conf

anon-access = none

auth-access = write

password-db = passwd

authz-db = authz

realm = My First Repository

Start svnserv

svnserve -d -r /data/svn

You can also use the --listen-port parameter to specify the port and start multiple warehouses

Import the project, if the project directory is svn://host /test, create a copy of the svn warehouse (nginx read directory)

cd /data/wwwroot

svn co svn://localhost/test --username test --password 123456

Set up svn update Then automatically update the reading directory of nginx:

vi /data/svn/hooks/post-commit

#!/bin/sh

svn up /opt/www/test/ -- username "lyf" --password "123456"

chown -R http:web /opt/www

#This step may be able to filter

Add executable permissions to the script

chmod +x /data/ svn/hooks/post-commit

It’s done. Now you can test it. After svn is updated, the content read by nginx (access http) will also change accordingly. Is it simpler than apache? Reprinted from

The above introduces how to build NGINX+SVN under CentOS 2012-07-22 16:56:26, including the relevant content. I hope it will be helpful to friends who are interested in PHP tutorials.


Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn