Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a NAS on which I have a RAID 10 array that I use as my GIT repository, I like my clients to have access to the site's builds right down to the latest commit.

My plan is like so:

 ____________       ___          __________
|            | Git |   | Apache |          | 
|Dev Computer|---->|NAS|------->|Web Server|--> NAT/WAN
|____________|     |___|        |__________|
   X.Y.Z.199     X.Y.Z.200       X.Y.Z.201

So what i'm wondering is how do I point apache for say goto X.Y.Z.200/Git/

I can probably plug the NAS direct into the web-server via USB but ethernet is preferable (it is gigabit so latency shouldn't be that bad).

What do you guys recommend? Or maybe install git on the apache web server itself - bypass the NAS and just have the repository hosted on the server's local HDD?

share|improve this question
up vote 1 down vote accepted

You have a source control system, so why not simply check out the latest version from GIT to the web server with a cron job daily or hourly?

share|improve this answer
I'm intrigued, I would have to install GIT on the web server - then what do I do to create the cron job? Make it execute `git clone X.Y.Z.200\git\`? – Myles Gray Sep 14 '11 at 15:08
You don't mention the OS of the server, but assuming it's Linux you'd add the command to check out from GIT to the right folder into the crontab for a user who has write access to the folder the webserver is sharing out using crontab -e, and formatting the entry in the crontab in the normal way: I'm not a Windows admin, but I'm sure you can get windows to run a .BAT file periodically. – Bart B Sep 14 '11 at 16:14
Hi Bart, Right you are this is a linux server (ubuntu server to be specific), I'll have a go at adding the cron job to do that. – Myles Gray Sep 14 '11 at 17:04

I've successfully used apache to serve content off of an SMB-mounted file share before. Worked just fine. Instead of setting up a static mount, I'd recommend using automount - this will give you quite a bit more resiliency over a standard fstab-style mount.

The only issue I did run into was an odd interaction between apache and samba where initially, it would only pull partial files. I needed to add EnableSendfile Off to my vhost definition to fix this.

share|improve this answer

Your Answer


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.