How to setup a Subversion Repository for PHP Development

Being a PHP developer and a System Administrator, Setting up the development environment and Development both are my Key Responsibilities. For years, I have been away from the Source control, but as you grow, your needs also grow to get more managed and secure.

One fine day, I went through the process of version control in PHP basically Subversion. Initially, the idea sounded very good, however, a new issue came to my mind that although, the source code will be version controlled, yet, how the actual work done by the developers will be previewed?

Suppose I have some code that is not under source control system. The project is located at

I have a common svn repository location at
“/var/svn/”, so Project x svn repository will be “/var/svn/x”

For achieving this, I follow these instructions

#svnadmin create /var/svn/x
#cd /var/www/x
#svn import file:///var/svn/x -m "Initial Import"
#cd /var/svn/x/conf
#vi svnserve.conf

Write these lines in this file

anon-access = none
auth-access = write
password-db = passwd

Save and Exit the vi editor

#vi passwd

Add these lines in this file.

anil = konsal

save and exit the vi editor

#cd /var/www/html
#mkdir x
#svn checkout svn:// x
#cd /var/svn/x/hooks
#cp post-commit.tmpl post-commit
#chmod 755 post-commit
#vi post-commit

Goto the end of file

and write

/usr/bin/svn update /var/www/html/x

Save and quit vi

#cd ..
#mkdir logs
#touch logs/post-commit.log
#chown -Rv apache.root /var/svn/x


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s