Inbuilt apache on OSX Mavericks | file location

07
2014-07
  • DSHEP

    Once I have started the server via Terminal, where is the default location for my index.html file to be saved to? Or is there no default, and i have to explicitly call out where I want to put it? and if so, how do i do that? Thanks in advance,

  • Answers
  • shub

    The default directory is /Library/WebServer/Documents

    You know that there is already one set up because when you go to http://localhost, you see this (via here)

    enter image description here

    You can also put your documents in /Users/[USER]/Sites and access it via localhost/~[USER].

    To change the directory (via the above link):

    • Open /private/etc/apache2/httpd.conf:

    • On line 170, change the DocumentRoot to whatever your desired directory is (eg. DocumentRoot “/www”)

    • On line 197, change the Directory location (eg. <Directory “/www”>)

    • On line 217 (within the Directory location we just updated), change the AllowOverride to “All” so that we can use .htaccess to modify any settings for our local sites (ie. AllowOverride All)

    • On line 429, uncomment the Include of the httpd-vhosts.conf file (ie. Include /private/etc/apache2/extra/httpd-vhosts.conf)


  • Related Question

    Recently-written files suddenly dropping to 4kb - OSX
  • Hugh

    I've got a bit of a problem here...

    I've got a render-farm full of machines that are writing to a central disk, and, sometimes, after it's written an image sequence (DPX files, 12Mb per frame), about a minute after each file is written, it suddenly drops from 12Mb to 4kb.

    I'm pretty certain that there is nothing running that would be doing this. .

    The application that is creating the files is Shake.

    This problem has cropped up before, very occasionally. I've certainly never figured out what actually causes it.

    The central disk is a 10Tb raid, which the machines connect to via NFS.

    df -h gives me the following for it:

    clarke:/Volumes/projects 8.9Ti 7.7Ti 1.1Ti 88% /mount/projects

    So it's not like it's running out of space (I was at 700Gb free when it started having the problem tonight, and I've freed up a load more just in case that was something to do with it...

    Any help would be much appreciated! I really want to figure out what's causing this, as it's certainly causing me a lot of pain...

    Edit:

    If you want more specs of the server:

    • XServe running OSX Server 10.5.8
    • Promise Raid VTrak E610f

    Also: The data certainly was there, for a couple of minutes. I set off a process to copy it to another machine, and that other machine is seeing the images just fine.

    More edit:

    Is there some kind of tool that will track every single file creation or modification in a folder (or whole file system) and tell me exactly what's going on? I want to find out if there is some kind of rogue process doing something naughty (it works most of the time, so I suspect not) or something lower down than that...


  • Related Answers
  • polynomial

    Specific to your question about a utility to watch file activity. What you want is called 'opensnoop' and it ships with OS X:

    http://developer.apple.com/library/mac/#DOCUMENTATION/Darwin/Reference/ManPages/man1/opensnoop.1m.html

    # opensnoop  # (in another terminal 'touch hi')
      UID    PID COMM          FD PATH                 
      502    146 Finder        30 /Users/thedude       
      502   1247 touch          3 /dev/dtracehelper    
      502   1247 touch          3 hi                   
      502    141 Dock          -1 /Users/thedude/Applications
      502    141 Dock           9 /Users/thedude       
      502    141 Dock          11 /Users/thedude       
      502   1225 zsh            3 /var/run/utmpx       
        0     58 mds            9 .                    
      502    850 mdworker       7 /Users/thedude/hi    
      502    146 Finder        30 /Users/thedude