Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I'm working on practicing my server setup/command line/Git/ruby on rails skills in Ubuntu, and I have set a folder up with Ruby on Rails to do so. This folder has a rails server which can be accessed at http://localhost:3000. In addition, I am also setting up folders on the same level which contain local Git repositories. While I am developing and hosting on Ubuntu, I am testing for IE bugs in three virtual Windows machines. To do this with the rails server, I can access http://192.168.1.3:3000 (or something similar) in the virtual machine for my virtualized Ubuntu.

How can I set my git folders up to be accessed the same way, despite the fact that they are not in the folder the rails server is installed in, and are not always going to be ruby projects?

For clarification, my folder setup is like this:

home
 www
  rails_project (localhost:3000/192.168.1.3:3000)
  forked_git_repo
  forked_git_repo_2
  my_local_git_project
  just_some_code_i_wanna_browser_test
share|improve this question
    
For this case, make /home/www/ your documentRoot for the virtualhost. Then you can access the git folders like http://192.168.1.3/forked_git_repo/. Try it out. –  Bibhas Feb 12 '12 at 5:58
    
This makes sense, and I've set the server root to what you suggested, but it's saying: "Not Found" when I go try to go to: localhost/forked_git_repo . Also, the Apache config file says: "# Do NOT add a slash at the end of the directory path."Am I doing something wrong? –  CodeJunkie Feb 12 '12 at 22:13
    
I looked around a little more and saw that I was changing the wrong setting. However, now when I set DocumentRoot "/home/www/", it still doesn't seem to work. Also, there didn't seem to be a default setting for that in apache2.conf. –  CodeJunkie Feb 12 '12 at 22:29
    
I got it! I had to edit /etc/apache2/sites-available/default , not /etc/apache2/apache2.conf to edit DocumentRoot. Then, I needed to restart the server. @Bibhas, if you want to post your comment as an answer, I'll mark it as the solution. –  CodeJunkie Feb 12 '12 at 23:15
    
You did do some good research. Kudos. :) Ok. Will add it as answer. :) –  Bibhas Feb 13 '12 at 18:00
add comment

1 Answer

up vote 0 down vote accepted

For this case, make /home/www/ your DocumentRoot for the virtualhost. Then you can access the git folders like http://192.168.1.3/forked_git_repo/. Try it out.

Update: The default settings are at /etc/apache2/sites-available/default as pointed out by the questioner @CodeJunkie.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.