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 (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:

  rails_project (localhost:3000/
  • For this case, make /home/www/ your documentRoot for the virtualhost. Then you can access the git folders like 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

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

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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