This may be a very late answer, but I followed most of the solutions, none of them helped me for various reasons. So I reset my device as the new Yosemite OS to get this local host running on Mac Yosemite (using Symlinks),
I took the steps for sure:
sudo nano /etc/apache2/httpd.conf
Uncomment the following lines:
Save and exit (Ctrl + X press Enter and press Y and type again)
sudo nano /etc/apache2/extra/httpd-userdir.conf
and uncomment the following line on line 16:
Save and exit (Ctrl + X press Enter and press Y and enter again).
Now go to the Apache Users folder to verify that your configuration file exists or not
cd /etc/apache2/users/
if you do not have a configuration file in this folder, create it
sudo nano /etc/apache2/users/<**YOUR USERNAME**>.conf
Replace <YOUR USERNAME> name of your device (enter whoami in the terminal and enter this name).
after creating the .conf file, copy below line to this file
<Directory "/Users/<YOUR USERNAME>/Sites/"> AddLanguage en .en LanguagePriority en fr de ForceLanguagePriority Fallback Options Indexes MultiViews AllowOverride None Order allow,deny Allow from localhost Require all granted </Directory>
save and exit
Now restart apache
sudo apachectl restart
Now go to your browser and type localhost, it will work as expected,
As a note: if it does not work even after restarting the computer
create index.html as exactly index.html.en which you should find here:
open /Library/Webserver/Documents/
right click on index.html.en and duplicate it in index.html, leaving the original as it is
try again in the browser and if you are successful you can delete the duplicate file
To be clear, leave the original index.html.en file where it is, untouched and unharmed throughout this step.
Not sure why I had to take this mysterious detour - maybe something local to my car, but if you have any problems after following the above guide, see if this helps.
SymLinks :
If you have success, you should see in the browser
It works!
Now create a symbolic link for any of your projects.
ln -s <Path_to_your_Project(index_file)> <Path_to_webroot>
For example, if you have a project folder in the Documents folder, then specify the website in the index file
ln -s /Users/<YOUR USERNAME>/Documents/project/ /Library/Webserver/documents/projectlink
you may need permission to create a symbolic link (use the command above with sudo)
Configure apache to track symbolic links (thanks tomvon, I don't have enough points to vote for you)
sudo nano /private/etc/apache2/httpd.conf
on line 250 (in Yosemite):
Options FollowSymLinks Multiviews
at
Options FollowSymLinks Multiviews Indexes
then in terminal run:
sudo apachectl restart
Now go to localhost/projectlink to see if your index file for your project is displayed in the browser.
Happy coding.