0

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 example.com goto X.Y.Z.200/Git/example.com/

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?

larsks
  • 43,623
  • 14
  • 121
  • 180
Myles Gray
  • 659
  • 4
  • 12
  • 33

2 Answers2

1

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?

Bart B
  • 3,457
  • 6
  • 31
  • 42
  • 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\example.com\`? – 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: http://adminschoice.com/crontab-quick-reference. 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
0

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.

EEAA
  • 109,363
  • 18
  • 175
  • 245