Thursday, 12 June 2014

Java EE Web App (part #4)

Configuring SVN Server


Setting up SVN Server is a big pain in a** specially if you are behind router because router does the NATTING for you (private IP to Public IP & Vice-Versa) and you need to forward request from public IP to appropriate private IP because in my place there are 5 private IP's.

Today i will simplify this a bit just follow the steps as shown below...

Steps 
  1. Download VisualSVN
  2. Installation is simple just follow the on-screen instructions
  3. Once you installed first step is to open your router page
  4. Goto Status tab and look for IP address, Once found copy it, now come to VisualSVN application, and select VisualSVN Server (Local) right click goto Network tab and under "Server Name" paste that IP
  5. Set "Server Port" to 8443 and press "Ok" button
  6. Then select Users --> right click --> Create User.. a dialog box will pop-up enter username & password which you wanna set and press "Ok" button
  7. Then select Repository --> right click --> Create New Repository, give a name and press "next" button
  8. Then select empty repository and press "Next" button
  9. Then select permission as per your convenience, i selected the default option which was already selected, Then select "Create" Button
  10. Now goto "C:\Repositories" you will find the repository which you just created, browse that directory 
  11. And from that directory which will be empty, perform right click and select TortiseSVN --> Create Repository Here..(follow the same step we have done in http://inaved-momin.blogspot.in/2014/06/java-ee-web-app-part-3.html)
  12. Then again right click and select SVN Checkout and in the "URL of the Repository" field enter the path where you have saved your "foobar" project. for eg: under NetbeansProjects in Documents
  13. Then "Checkout directory" field will contain path to this directory where you are standing for eg: "C:\Repositories\foobar" where "foobar" is the name of the repository which i have created in step 7
  14. Press "Ok" button
  15. Now goto that VisualSVN application and see whether new files have been added to your repository or not, try to browse it using for that select the repository and right click --> Browse
  16. If it opens in browser and you can see files means it is working else perform step 17
  17. Again goto router page, and goto "Advanced" tab which says "Advanced Port Forwarding Rules" in that perform as I say in step 18
  18. Name should be "VisualSVN", Application Name "HTTPS", Public port should be 8443,IP Address is the private IP address (as it starts with 192.168.*.*) see figure 1.0 more for more clarity
  19. Then Save Settings, It will ask for reboot, so reboot it and then try to browse the repository from VisualSVN it will work now
Note: Important point is once you shutdown your router and restart there is a probability that your private IP might change from 192.168.0.100 to 192.168.0.102 or vice-versa depending on the machines in your private network, in that case you need to perform step 18 & 19 again and again each time your private IP changes to map Public IP to appropriate private IP.

Changes should take place only in second row first row should be 
intact, in 2nd row only select the machine name and click that button next to it "<<" button and save settings.


 
Image 1.0

For more clarity this post should be read alongside with this post.

Now you have working SVN Client & Server, enjoy collaborative coding .....:)))