1

Currently trying to setup my localhost and install php as well with the new osx yosemite i've been following the following instructions: http://coolestguidesontheplanet.com/get-apache-mysql-php-phpmyadmin-working-osx-10-10-yosemite/

I've uncommented everything they said for apache and php and restarted apache afterwords FYI. SO won't let me type localhost so where I write lh means that

I'm successfully able to get to lh/

but... if I try to go to any other pages it says the site can't be found.

There is a index.html in the Sites folder which I have tried to access lh/~myusername/index.html

and I have the same file in /Library/WebServer/Documents which I have tried to access lh/index.html

Can someone tell me the step that I am missing that needs to get all of this to work correctly?

nick s
  • 11
  • 1

2 Answers2

0

Apache has a DocumentRoot which is the default page for localhost. That guide tries to enable a virtualhost for a directory in your local user but it is not possible to know why yours is not working as it is not clear which part you have gone wrong.

However it is better to use normal virtualhost configuration to define any folder you want for Apache as it is pretty much the same as Apache under Linux. Follow this guide for a basic understanding of creating virtualhosts for Apache. Let me know if you have any issues.

Nima
  • 1,470
  • 2
  • 17
  • 25
0

I had the same exact problem.

Followed all the steps, retraced them but still got the error.

First, check for a syntax error in your httpd.conf by typing in terminal:

sudo apachectl configtest

If you get a Syntax OK, then most likely its one of the settings in your httpd.conf file that isn't set right

You can check out this post and try what some other people did:

Apache localhost/~username/ not working

My error was that I didn't actually include "~" in the username (thought it was just there to define the var 'username' - took me almost 2 god damn hours to figure that out -__-)

After I got that far

localhost/~username

worked but I didn't have permissions to view it.

Had to do an extra step here to add permissions for my user:

http://coolestguidesontheplanet.com/forbidden-403-you-dont-have-permission-to-access-username-on-this-server/

Community
  • 1
  • 1
TrieuNomad
  • 1,651
  • 1
  • 21
  • 24