Apache server doesn't work

Discussion in 'Web Design and Development' started by may89, Jul 12, 2014.

  1. may89 macrumors newbie

    Joined:
    Mar 4, 2014
    #1
    Hey folks,
    I have mac pro mid 2012 mavericks.
    Apache server doesn't work on my mac. When I enter localhost on web browser it shows me
    [​IMG]
    I don't know how to solve this problem. Anyone can help me fixing it?:confused:
     
  2. ghellquist macrumors regular

    Joined:
    Aug 21, 2011
    Location:
    Stockholm Sweden
    #2
    So, what did you expect should happen?
    And have you checked some tutorials on the net on how to set up a website using Apache?

    // Gunnar
     
  3. may89 thread starter macrumors newbie

    Joined:
    Mar 4, 2014
    #3
    Well actually it was working. At first when I wrote localhost there was "It Works!". Now it doesn't work I don't know why.
     
  4. jwhazel macrumors regular

    Joined:
    Sep 22, 2005
    #4
    Apple has made it way harder to set up a web dev stack in Mavericks than what it needs to be. The guides I've looked at are all pretty lacking in one way or another. If you're just trying to run apache for something quick/simple then press on. If you plan on doing anything remotely more intense such as scripting or long term dev, look into another easier to use stack like xampp. You'll save yourself some hours of frustration.

    The issue you're seeing is a permissions related one. Theres a number of things that could be wrong here, but off the top of my head...

    1.) The file you're trying to read doesn't have proper permissions. Go into terminal and make sure its chmod 644 for a static file or chmod 755 for a script.
    2.) the directory or one of the parent directories your content is in doesn't have proper permissions. Say your apache conf is set to use /foo/bar/mywebsite/. All 3 of those directories 'foo', 'bar', and 'mywebsite' need to be chmod 755.
    3.) you might need to play with chown'ing /foo/bar/mywebsite to _www or your username.
     
  5. 960design macrumors 68020

    Joined:
    Apr 17, 2012
    Location:
    Destin, FL
    #5
    I use MAMP for development work on my Macs. No muss, no fuss.
     
  6. firedept macrumors 603

    firedept

    Joined:
    Jul 8, 2011
    Location:
    Somewhere!
    #6
    Have to agree Xampp or Mamp for development work on a Mac. Save yourself the headache. It is a quick & easy install of either and you will be running in no time.
     
  7. NutsNGum, Jul 13, 2014
    Last edited: Jul 13, 2014

    NutsNGum macrumors 68030

    NutsNGum

    Joined:
    Jul 30, 2010
    Location:
    Glasgow, Scotland
    #7
    I think you need to set Apache Directory Options to show Indexes, then you'll be able to view your root directory. You do this by adding a .htaccess file to the root and adding the following text to it:

    Options +Indexes
     
  8. Darth.Titan macrumors 68030

    Darth.Titan

    Joined:
    Oct 31, 2007
    Location:
    Austin, TX
    #8
    Another option is to just make sure there is an index.html file in your web root. The error you're seeing is because there is not an index page, and indexes are disallowed.

    Add an index file with some content and it should show up.
     
  9. wgnoyes macrumors 6502

    Joined:
    Jul 20, 2011
    #9
    Absolutely! Plus you get php and mysql ready to go as well.
     

Share This Page