Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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?

share|improve this question

2 Answers 2

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

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

 
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.