3

Here's the situation:

subversion is already installed in the server and I have access to one of the shared accounts in the server (not the root), and this shared hosting account has SSH access.

I want to create a repository where I can commit the PHP files i'm working on, and when I commit it should be viewable in a browser that is why I was thinking of creating the repository folders inside public_html is this a correct way to do this? How about the security of the server? If not what is the correct and proper way to do this?

I would also need help in creating the repository via SSH with Putty. Is there a step-by-step guide online for this?

Server information is as follows:

cat /proc/version - output this:

Linux version 2.6.9-89.0.3.ELsmp (mockbuild@x86-005.build.bos.redhat.com) (gcc version 3.4.6 20060404 (Red Hat 3.4.6-11))

svn --version - output this:

svn, version 1.1.4 (r13838) compiled Aug 10 2009, 23:17:10

  • ra_dav : Module for accessing a repository via WebDAV (DeltaV) protocol.
    • handles 'http' schema
    • handles 'https' schema
  • ra_local : Module for accessing a repository on local disk.
    • handles 'file' schema
  • ra_svn : Module for accessing a repository using the svn network protocol.
    • handles 'svn' schema
Tyler
  • 21,762
  • 11
  • 61
  • 90
  • Depends on what you want to do. Do you want a nice web interface where you can see files, commits, and any past history of the repository? Or do you want to be able to checkout and commit over HTTP? Or both? They have fairly different solutions. Please edit question and clarify. (And no, repository in public_html is wrong.) – Nicolás Dec 27 '09 at 01:40
  • 1
    Not really related to your question, but Subversion 1.1.4 is years out of active support. It should still work, but Subversion is now on 1.6.6 and only 1.5.x and 1.6.x are in active support. Several security issues where fixed since then. – Bert Huijben Dec 27 '09 at 22:05
  • Oh wow, I didn't notice the version number o.O – Nicolás Dec 28 '09 at 06:23

3 Answers3

0

The correct way to do this is to use a web bridge to SVN, such as websvn or viewsvn (there are several). You can set these up to expose any repository as a website.

As to creating a new repository, see the SVN "Red-Bean" reference at http://svnbook.red-bean.com/

Jim Garrison
  • 85,615
  • 20
  • 155
  • 190
0

I want to create a repository where I can commit the PHP files i'm working on, and when I commit it should be viewable in a browser.

I'm not sure I understand your question. Do you mean that the repository should execute your PHP, i.e. that your Subversion repository should also be your PHP server? I strongly recommend against it.

A source control repository and an application server are completely different things. They serve different roles; should be accessed by different people (developers vs. end-users); should have different monitoring and SLA policies; different hardware, and whatnot. You also probably don't want every committed change to be automatically deployed to your production environment.

Eli Acherkan
  • 6,401
  • 2
  • 27
  • 34
  • I actually understand this now. and I opted to setup a repository outside the public_html (the folder that is viewable to the public and can execute php), done this for security reasons. Now, how can I deploy the committed changes to the public_html folder? No need to do this automatically, I just want to know how to do this for every major build we make. Thanks! –  Jan 07 '10 at 14:20
0

The Red Bean book also has a number of sections on integrating SVN with apache, etc. But before you start working on a solution, you need to define what you're trying to do more thoroughly. What is your usage model?

For example, will you commit to SVN repository via svn+ssh, or via svnserve, etc?

Do you want to see full revisions, history, changesets from the web interface? Or just the head?

Sam Post
  • 3,721
  • 3
  • 17
  • 14