Set up SVN server under Ubuntu, and automatically update to Web server.

Source: Internet
Author: User

<span style= "font-family:arial, Helvetica, Sans-serif; Background-color:rgb (255, 255, 255); " > found a lot of tutorials on the internet, but tried a lot of them. The writing is a little rough, there are a lot of problems. The whole three days was finally done. I'm here to tidy up and send it up for you to see. Want to have the same needs of the Tao friend less go some detours. What are the questions you can leave a message below. </span>
<span style= "font-family:arial, Helvetica, Sans-serif; Background-color:rgb (255, 255, 255); " ></span>
operating system: Elementary OS (one branch under Ubuntu)
Current environment: Installed lamp (Web server directory is/var/www/), the SVN server has been installed (startup script in/USR/BIN/SVN)


Create a code warehouse

Svnadmin create/home/svn/project  --fs-type Fsfs

then three folders are generated under the project directory, and there are authz,passwd,svnserve three files in the Conf directory.
Authz
--------record each user's access rights to individual items in the warehouse (there may be multiple projects in a warehouse).
Under [groups], add the following:
User group name = user 1, User 2 ... [project:/]   The root of the repository @ user group name =RW  //represents permissions *=

Cases:

Test=chrisdowson,test    [project:/]    @test =rw      *=     (<span style= "color: #ff0000;" > Note Do not leave spaces on both sides of the equals sign for example: Test = chrisdowson,test</span>)

passwd-------stores the user's user name and password
User name = password .....

Cases:

test=123456chrisdowson=123456   (<span style= "color: #ff0000;" > Note Do not leave spaces on both sides of the equals sign for example: Test = 123456</span>)

Svnserve-----Stores the path of the user to verify permissions and passwords when attempting to log in (usually the path is two files up), and find each of the following options to remove the previous #

Absolute path to the absolute path of the anon-access=noneauth-access=writepassword-db=passwd file Authz-db=authz file (no spaces at the front of each line)


Cases:

anon-access=noneauth-access=writepassword-db=/home/svn/project/conf/passwdauthz-db=/home/svn/project/conf/ Authz



Start the server again svnserve-d-R/HOME/SVN (Note that the path here is not yet to the warehouse address Oh. No ProjectThere's always a reason to think that there might be multiple warehouses, so every time you start up, you start all the warehouses. If you are prompted Svnserve: cannot bind the server socket: The address is already in use, use the Killall svnserve command to kill the previous Svnserve process and then run the above command again.

Then use the SVN Co svn://server's IP address/project to do a test, if you can get it out to build a successful.



now you want to implement SVN automatic Update Web server.


The current version of the Web server directory is now checkout. Then add the script in the Post-commit file in the Hooks folder of the SVN project: Edit a new post-commit with the VI command (See clearly no suffix nameNever use the Post-commit file that comes with the Hooks folder. Add the following content to the file:
#!/bin/shweb=/var/www/test   the items under the//web server cannot have spaces. Export Lang=en_us. UTF-8SVN update $WEB--username chrisdowson--password 123456  //is equivalent to client Update<span style= under Windows font-family : Arial, Helvetica, Sans-serif; Background-color:rgb (255, 255, 255); " > Operation Satan (If you can't tell if your shell script is wrong, you can now run the Hooks directory./post-commit try) </span>

The file is then assigned permission to execute chmod +x post-commit.

OK to here is done, we can in win under the small turtle test upload files to the server, and then see if there are any changes in the Web server.


PS: Because I started Linux for more than a week. The understanding of permissions and some commands is not profound. The ladies clap, everyone has any questions or suggestions can give me a message. I also thirst for knowledge!

Set up SVN server under Ubuntu, and automatically update to Web server.

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.