![]() |
ubuntu.com - launchpad.net - ubuntu help
|
|
|||||||
|
Tutorials & Tips The place to find Ubuntu related Tips & Tricks. |
|
|
Thread Tools | Display Modes |
|
|
#1 | ||
|
5 Cups of Ubuntu
![]() |
HOWTO : Subversion & Eclipse development environment
# All the modified or additional information will be updated on this post in order for everyone to get alwasys up-to date information.
# After you've done this, some of you might need tomcat5 + Apache2 set up. # I also wrote the article here, so please have a look. Here is the how-to for setting up the subversion client with eclipse and the server. Hope this will help you more productive coding First of all, regarding "Subversion" For more detail, please refer to http://en.wikipedia.org/wiki/Subversion_(software) Here is the snipet about the difference between CVS & Subversion. Quote:
Now let's get started to prepare the development environment for Ubuntu (Dapper). [Client - Eclipse with plugin] Assume that you have already installed eclipse & j2sdk1.5-sun. If you face problem starting up the eclipse you can find the answer in this forum. Most likely it is related to "java_home". Just for the instant check Code:
cd /etc/eclipse cat java_home Code:
ubuntu% cat java_home # This file determines the search order the Eclipse Platform uses to find a # compatible JAVA_HOME. This setting may be overridden on a per-user basis by # altering the JAVA_HOME setting in ~/.eclipse/eclipserc. /usr/lib/j2sdk1.5-sun/ #/usr/lib/jvm/java-gcj #/usr/lib/kaffe/pthreads #/usr/lib/sablevm #/usr/lib/fjsdk #/usr/lib/j2se/1.5 #/usr/lib/j2se/1.4 #/usr/lib/j2sdk1.5-ibm #/usr/lib/j2sdk1.4-ibm #/usr/lib/j2sdk1.5-sun #/usr/lib/j2sdk1.4-sun Step1: Installing the plug-in (subclipse) Launch eclipse and go to : help->s/w updates ->find and install->search for new features Then press "new remote site" and add "http://subclipse.tigris.org/update" Then follow the instraction to install the plugin. Step2: Install library needed for subversion from eclipse Code:
sudo apt-get install libsvn-javahl Follow this then you can see the svn perspective window->Opne Perspective-> Other->SVN Repository Explorer If you already have subversion server running, you can access to it by right clicking svn repository explorer then new -> create remote folder [Server - Subversion] There are 2 simple ways to use subversion. One is using subversion function over WebDav and another is subversion server using specific protocol. First I'll explain about the WebDav way. Step1: Install subversion package [WebDav] Code:
sudo apt-get install subversion subversion-helper-scripts subversion-tools sudo apt-get install apache2 libapache2-svn Code:
sudo mkdir -p /var/local/svn sudo svnadmin create --fs-type fsfs /var/local/svn sudo chown -R www-data:www-data /var/local/svn Code:
sudo vi/etc/apache2/mods-enabled/dav_svn.conf -- #Comment out the following 2 lines with your repo path #DAV svn <-Comment out this DAV svn #SVNPath /var/lib/svn <-Comment out this SVNPath /var/local/svn <LimitExcept GET PROPFIND OPTIONS REPORT> #Require valid-user <-Comment this if you don't need basic authentication Options Indexes Order allow,deny allow from all </LimitExcept> In order to use basic authentication for loging on to subversion server, you need to do the followings. Code:
sudo vi/etc/apache2/mods-enabled/dav_svn.conf
# comment the following 4 lines
AuthType Basic
AuthName "Subversion Repository"
AuthUserFile /etc/apache2/dav_svn.passwd
<LimitExcept GET PROPFIND OPTIONS REPORT>
Require valid-user
Options Indexes
Order allow,deny
allow from all
</LimitExcept>
Code:
#-m option for MD5 encryption of the password sudo htpasswd2 -cm /etc/apache2/dav_svn.passwd cavalier1 New password: ***** Re-type new password: ***** Adding password for user cavalier1 $ htpasswd -m /etc/apache2/dav_svn.passwd cavalier2 New password: ******* Re-type new password: ******* Adding password for user cavalier2 Tip2 - SSL access Code:
# Create ssl certificate # certificate will be stored at /etc/apache2/ssl sudo apache2-ssl-certificate # Copy conf file for ssl sudo cp /usr/share/apache2/config/default-443 /etc/apache2/sites-available Code:
# Edit conf file sudo vim /etc/apache2/sites-available/default -- #Comment following and set proper one # NameVirtualHost * NameVirtualHost *:80 # <VirtualHost *> <VirtualHost *:80> Code:
sudo vim /etc/apache2/sites-available/default-443 -- # Find the following lines and comment out and set the appropriate ones # SSLCertificateFile /etc/apache2/sites/::SERVERNAME::-ssl.crt SSLCertificateFile /etc/apache2/ssl/apache.pem # SSLCertificateKeyFile /etc/apache2/sites/::SERVERNAME::-ssl.key SSLCertificateKeyFile /etc/apache2/ssl/apache.pem # ServerAdmin ::SERVERADMIN:: ServerAdmin Cavalierski # ServerName ::SERVERNAME:: ServerName www.yourdomain.com # DocumentRoot /var/vhosts/::VHOSTNAME::/htdocs-443 DocumentRoot /var/www # <Directory /var/vhosts/::VHOSTNAME::/htdocs-443> <Directory /var/www> # ErrorLog /var/vhosts/::VHOSTNAME::/logs/error.log-443 ErrorLog /var/log/apache2/error.log-443 # CustomLog /var/vhosts/::VHOSTNAME::/logs/access.log-443 combined CustomLog /var/log/apache2/error.log-443 combined # I deleted the cgi lines as I don't need them. That's all for conf file. -- # Enable ssl module sudo a2enmod ssl # Enable ssl config sudo a2ensite default-443 # Open the port for ssl sudo vim /etc/apache2/ports.conf # Add the following line Listen 443 Code:
sudo /etc/init.d/apache2 reload or If you've done ssl part "https://your server name/svn". ---- Step1: Install subversion package[svn Server] Code:
sudo apt-get install subversion subversion-helper-scripts subversion-tools # You can deploy your repository folder wherever you want. This is my case. Code:
sudo mkdir -p /var/local/svn/projectx sudo svnadmin create /var/local/svn/projectx sudo chown -R username:usergroup /var/local/svn/projectx Code:
cd /var/local/svn/projectx/conf sudo gedit svnserve.conf -- [general] anon-access = read auth-access = write password-db = passwd # This refer to passwd file in the same folder realm =Cavalier Repository -- Code:
sudo gedit passwd -- [users] username = password #<- you can modify here to whom you want to allow the access -- Code:
sudo /usr/bin/svnserve -d # With "-r" option like "svnserve -d -r /var/local/repos", your path to the repos is hidden. If you want to access to "/var/local/repos/xproject/trank" , from the client the address to access is "svn://your.svnserve.address/xproject/trank" Code:
sudo /usr/bin/svnserve -d -r /root/svn/var/local/svn/your_repos However you most likely want to run automatically at OS start up. Then let's try to do it by the super server. Super server is a program which start the service triggered by the client request. Super server watch the specified port and if there is a request listed on the conf file, it automatically start the program. This will reduce the use of CPU and even the service is down , it automatically start the service. (Often TELNET, POP which require stability are using super server) # However the server such as HTTPD (Apache) which has frequent access BETTER NOT use super server. Step1: Install xinetd(Super server program) and set it up. Code:
sudo apt-get install xinetd
sudo gedit /etc/xinetd.d/svnserve
--
service svnserve
{
disable = no
port = 3690
socket_type = stream
protocol = tcp
wait = no
user = root
server = /usr/bin/svnserve
server_args = -i -r /var/local/svn/your_repos
}
--
sudo gedit /etc/services
# modify the port "3690/tcp" line like this below
--
svnserve 3690/tcp # Subversion protocol
--
Code:
sudo /etc/init.d/xinetd restart Some people might face error such as "Malformed network data". Try following as a temporary solution. #Before please check if you run svnserve with "-r" option like "svnserve -d -r /var/local/repos", your path to the repos is hidden. If you want to access to "/var/local/repos/xproject/trank" , from the client the address to access is "svn://your.svnserve.address/xproject/trank" 1) Many case svnserve file under xinetd.d is misspelled. Please check it first. 2) If svnserve file seems ok + you are running svnserve locally, change the protocol to "file". Use: Code:
file:///localhost/var/local/svn/your_repos Code:
svn://localhost/var/local/svn/your_repos Code:
sudo rm /etc/xinetd.d/svnserve sudo /etc/inited.d/xinetd restart sudo /usr/bin/svnserve -d -r /root/svn/var/local/svn/your_repos You can alwasy check if the 3690 port is Listen status by Code:
netstat -n or netstat -an|grep 3690 Here you could get the additional good info from the community member. Quote:
Now I have subversion server & client for the productive open source development.. Enjoy coding ![]() Last edited by Cavalierski; July 21st, 2006 at 06:53 AM.. |
||
|
|
|
|
|
#2 |
|
Dipped in Ubuntu
![]() Join Date: Apr 2005
My beans are hidden!
Ubuntu
|
Re: HOWTO : Subversion & Eclipse development environment
Just a couple of notes while following this:
- I had to run svnadmin with sudo - the path for the xinetd svnserve conf file was "/etc/xinetd.d" (on my box anyway) - the second "server" is supposed to be "server_args" I think on a personal opinion note, I question whether the user should be 'root'. I created a user 'svn' and chown'ed the svn directory to svn and used user = svn in the svnserve conf file. I'll post back if I run into issues. Otherwise, thanks for the guide. I only post this to help out the next person. |
|
|
|
|
|
#3 | |
|
5 Cups of Ubuntu
![]() |
Re: HOWTO : Subversion & Eclipse development environment
Thanx mbeach, your points are all right.
I updated my original article. Thanx again for your feedback Regarding the user root, I suppose creating another user for it is more secure. However it shouldn't be a big problem I guess to use root account this time, shoud it? Quote:
|
|
|
|
|
|
|
#4 |
|
Dipped in Ubuntu
![]() Join Date: Mar 2005
Location: Dunedin, NZ
Beans: 562
Kubuntu 7.10 Gutsy Gibbon
|
Re: HOWTO : Subversion & Eclipse development environment
If you use the name svn instead of svnserve then you don't need to edit your /etc/services file as svn is already in there with the appropriate port number.
I too created a svn system user (no home created) and did a chown on the repository directory. Thanks for the HOW TO though, it started me on the right track.
__________________
ACCU - for programmers who care |
|
|
|
|
|
#5 |
|
Just Give Me the Beans!
![]() Join Date: May 2005
Beans: 47
|
If you are using subversion and eclipse (and subclipse), and would like to access a local repository using the file:// protocol then you need to install libsvn-javahl. Then start eclipse with "eclipse -vmargs -Djava.library.path=/usr/lib/jni/".
In the Eclipse menu Windows -> Preferences -> Team -> SVN and select JavaHL. I am using eclipse 3.1 (custom installation) with subclipse 1.0.2 and libsvn and libsvn-javahl from the Dapper repositories. Sincerely, Aouie Last edited by aouie; June 14th, 2006 at 01:13 PM.. |
|
|
|
|
|
#6 |
|
First Cup of Ubuntu
![]() Join Date: May 2006
Beans: 9
|
Re: HOWTO : Subversion & Eclipse development environment
Hi all,
I am totally new with this. I've just installed Ubuntu 6.06 a few days ago. I wanted to play around with Subversion. I follow all the steps above and I think I am doing everything correctly. I did also created a svn account (with no home directory). In Step 2: This is what I did, is this correct? sudo mkdir -p /var/local/svn/projects sudo svnadmin create /var/local/svn/projects sudo chown -R svn:svn /var/local/svn/projects In Step 3: I did exactly the same, except I gave it a different Realm Repository. How does this Realm name come into play? Does this even matter? I also add a user and password to the passwd file. I did install xinetd. I edited /etc/xinetd.d/svnserve to be the following service svnserve { disable = no port = 3690 socket_type = stream protocol = tcp wait = no user = sve server = /usr/bin/svnserve server_args = -i -r /var/local/svn/projects } and edited /etc/services to the following: svnserve 3690/tcp # Subversion protocol I've restarted /etc/init.d/xinetd restart, is say it stop and started again after the command. So I think I am doing everything correctly. I have a few questions. First how can I tell that the svnserve is running? Secondly how can I access the svn repository. Is it svn://my.domainname/svn? Can I put that url a browser address bar or File Explorer? Thanks again for help. |
|
|
|
|
|
#7 |
|
Dark Roasted Ubuntu
![]() |
Re: HOWTO : Subversion & Eclipse development environment
I had problems using Subversion.
I've installed Subversive which acts as Subversion and now I have no problems. Developers says that it's possible to use both together.
__________________
Search before posting new threads ! Community Documentation | UbuntuGuide Ask questions the smart way |
|
|
|
|
|
#8 |
|
First Cup of Ubuntu
![]() Join Date: May 2006
Beans: 5
|
Re: HOWTO : Subversion & Eclipse development environment
Hi,
I've followed all of the instructions here, but I get a "Malformed network data" error when I try to create a new repository location from eclipse. What's going wrong? I'm using svn://localhost for my repository location. |
|
|
|
|
|
#9 | |
|
5 Cups of Ubuntu
![]() |
Re: HOWTO : Subversion & Eclipse development environment
Quote:
A1) You can check if the server is listening the port or not by Code:
netstat -n Code:
ps aux | grep svn If you want to access CUI, Code:
svn co svn://localhost/var/local/svn/xxx |
|
|
|
|
|
|
#10 | |
|
5 Cups of Ubuntu
![]() |
Re: HOWTO : Subversion & Eclipse development environment
Quote:
|
|
|
|
|
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|