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 three Virtual Hosts running in apache2 on my personal Macintosh running OS X Mavericks and I have ran into a knot of confusion. They are configured in my httpd-vhosts.conf file as follows:

<VirtualHost *:80>
DocumentRoot "/Library/WebServer/Documents"
ServerName localhost
ServerAlias localhost
</VirtualHost>
<VirtualHost *:80>
DocumentRoot "/Library/WebServer/Documents/dev1"
ServerName dev1.local
ServerAlias www.dev1.local
</VirtualHost>
<VirtualHost *:80>
DocumentRoot "/Library/WebServer/Documents/dev2"
ServerName dev2.local
ServerAlias www.dev2.local
</VirtualHost>
<VirtualHost *:80>
DocumentRoot "/Library/WebServer/Documents/dev3”
ServerName dev3.local
ServerAlias www.dev3.local
</VirtualHost>

Note: The first entry allows me to type in "localhost" and have it load as you'd expect it to without Virtual Hosts running.

dev1 and dev2 work fine, but I get an Error 404 saying "The requested URL / was not found on this server." when I try to load dev3 on the local machine. All three Dev folders have the same permissions I have verified the names. When I checked the error_log I found this:

[Fri Jan 24 12:55:07 2014] [error] [client 127.0.0.1] File does not exist: /Library/WebServer/Documents/dev3\xe2\x80\x9d

Does anyone know why Apache is appending a "\xe2\x80\x9d" to the end of the Folder path, or why dev3 isn't loading? (I suspect these randomly appended characters are why) Any input welcome! Thanks for reading!

share|improve this question

1 Answer 1

up vote 5 down vote accepted
DocumentRoot "/Library/WebServer/Documents/dev3”
                                               ^----- no proper quotation mark :9

If you have php installed:

<?php
echo "\xe2\x80\x9d";

// or

echo utf8_decode("\xe2\x80\x9d");

// should give you ”
share|improve this answer
1  
makes a "Not Bad" face and face palms hand through head Now see, that makes so much sense. This happens to me with HTML forms too... THANK YOU! I've been scratching my head for an hour about this. How does that character get typed out versus the regular quotation mark @DanFromGermany ? –  Uncle Nerdicus Jan 24 at 18:21
    
@UncleNerdicus depends on your text editor! I really only use NetBeans , notepad++ and vi for everything and never had such problems –  DanFromGermany Jan 24 at 18:26
1  
@DavidHoude It's making me wait a few more minutes (stupid timers!), I haven't forgotten! –  Uncle Nerdicus Jan 24 at 18:27
    
@DanFromGermany I'll keep note of that. Thanks man! :) –  Uncle Nerdicus Jan 24 at 18:27
    
@UncleNerdicus if you ever encounter ^M at your line endings or similiar, it's because of wrong line ending (\r\n chars) dos/unix/mac (there are tools: dos2unix etc), just in case ;D –  DanFromGermany Jan 24 at 18:30

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.