Simple steps to setup symfony and svn
I setup my ubuntu box with svn server and symfony. Here i want to share simple steps to configure symfony and svn server. I will cover the svn access from file system. I am considering you had installed SVN server. If not than follow these instructions. Now let’s install symfony. I will follow the pear installation.
pear channel-discover pear.symfony-project.com pear install symfony/symfony
So it will install symfony framework for you. Now we will configure svn with symfony for the access from file system.
- Login as a root.
- Create new user “svn” with some specific home directory say /home/svn.
- Create your project directory in your svn user. say /home/svn/new_project.
- Setup repository structure with “svnadmin create /home/svn/new_project”.
- Now browse your svn home with “cd /home/svn”
- Let’s set some permissions with “chown -R www-data new_project”.
- Then “chgrp -R subversion new_project”
- And “chmod -R g+rws new_project”
- Now suppose your project’s home directory is “/home/new_project/public_html” and user of your project is “new_project”. Now we will give access of svn directory to “new_project” user by editing /etc/group. assign svn to new_project group.
- Now login to the user “new_project” and make sure you have both groups with “id -a”. Now browse your projects directory. In my case it is “/home/new_project/public_html”
- Set an environment variable with “export SVN_DIR=/home/svn/new_project”
- Now Create directory structure of your repository for your project. To do so give “svn mkdir -m “initial structure” file:///$SVN_DIR/trunk file:///$SVN_DIR/tags file:///$SVN_DIR/branches”
- Now make sure you are in /home/new_project/public_html and give “symfony generate:project new_project” where “new_project” is the name of your project.
- Now give these two commands to clear cache and log “rm -rf cache/* , rm -rf log/*”.
- Now Import with “svn import -m “initial import” . file:///$SVN_DIR/trunk”.
- Now go to “/home/new_project” and move your project directory to public_html.original with “mv public_html public_html.original”.
- Give “svn co file:///$SVN_DIR/trunk public_html” command to create the working version of your project.
- Now browse your project directory with “cd public_html” and give “svn propedit svn:ignore cache”. It will open your default editor. put “” and save that. similarly for log directory with “svn propedit svn:ignore log”, put “” and save it. It will put your “cache” and “log” directory in the ignore list of svn server.
- Now give [ svn commit -m “added cache/ and log/ content in the ignore list” ] command to commit the ignorance list.
That’s all. It will setup your symfony svn controlled project. I hope it will help some body and save some time.