简体   繁体   English

开发Web服务器上的基本subversion服务器问题

[英]Basic subversion server question on a development web server

I've just set up a development web server, where people will be testing out some changes before making these changes on the production web server. 我刚刚建立了一个开发Web服务器,人们将在生产Web服务器上进行这些更改之前测试一些更改。 Currently the web development team is used to using subversion to make their changes on the production server. 目前,Web开发团队习惯使用subversion在生产服务器上进行更改。 I'd like to set up a SVN server on the development web server as well. 我也想在开发Web服务器上设置一个SVN服务器。

My question is this: How can I make it so subversion stores the repository in the Apache document root, so that files they check into the repository will go right into the docroot and be served by the web server. 我的问题是:我如何制作它以便subversion将存储库存储在Apache文档根目录中,以便它们检入存储库的文件将直接进入docroot并由Web服务器提供服务。

As I have it set up now, it seems that when files are commited, they turn into virtual files in the svn repo directory (only visible with "svn ls file:///repo/file" rather than just "ls /var/www/file". 正如我现在设置的那样,似乎在提交文件时,它们会变成svn repo目录中的虚拟文件(仅在“svn ls file:/// repo / file”中可见,而不仅仅是“ls / var /” WWW /文件”。

Thank you 谢谢

That's not how subversion works. 这不是颠覆的方式。 It doesn't normally store files in a format that's directly accessible. 它通常不以可直接访问的格式存储文件。 What you want to do is add a post-commit hook that will update a checked-out copy in the web directory. 你想要做的是添加一个post-commit钩子,它将更新web目录中的签出副本。 Google search for "subversion post-commit update" for more information. Google搜索“subversion post-commit update”以获取更多信息。

You can control your source code using subversion, but the real issue is that you are changing your installation and then archiving it instead of the "normal" development routine; 您可以使用subversion控制源代码,但真正的问题是您正在更改安装,然后将其归档而不是“正常”开发例程; which is to make your changes and THEN install the changes. 这是为了进行更改,然后安装更改​​。

The best method would be to keep the subversion server far away from the production web server. 最好的方法是使subversion服务器远离生产Web服务器。 Your development box checks in changes to the subversion server. 您的开发框会检查对subversion服务器的更改。 A single "special" build user checks out all the subversion stuff and makes a zip file (or something more appropriate) and that "zip file" is then copied to the production server and "installed". 一个“特殊”构建用户检查所有的subversion东西并制作一个zip文件(或更合适的东西),然后将“zip文件”复制到生产服务器并“安装”。

This will give you more flexibility in deploying to your web server, and it will allow you to test changes on other non-critical web servers (if you ever decide to get so fancy) before you deploy to the production server. 这将使您在部署到Web服务器时具有更大的灵活性,并且它允许您在部署到生产服务器之前测试其他非关键Web服务器上的更改(如果您决定如此看中)。 It will also prevent you from having mistakes that get checked in directly taking down the web server (as you can opt to not deploy a build to the web server while you check in subsequent "fixes" for the introduced mistakes). 它还可以防止您在直接关闭Web服务器时出现错误(因为您可以选择不在构建到Web服务器的同时检查引入的错误的后续“修复”)。

Either way, you can use crontab or some other cron-like functionality to do a "nightly" package, etc. The key isn't to create more work that a person has to do, it's to create more work that automated programs can do simply so you have more security in the event of eventual upsets. 无论哪种方式,您都可以使用crontab或其他一些类似cron的功能来执行“夜间”程序包等。关键不是要创建一个人必须做的更多工作,而是要创建更多自动程序可以执行的工作只是为了让您在最终的不安情况下获得更多安全保障。 Your role should be to decide if you want to install "this" package, and to run the command (or two) to install it. 您的角色应该是决定是否要安装“this”软件包,并运行命令(或两个)来安装它。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM