Take the 2-minute tour ×
Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

I am using OS X Mountain Lion 10.8.4. I tried the steps in Installing Apache, PHP, and MySQL on Mac OS X to setup my dev environment, but I am not able to open the virtualhost I created – or localhost for that matter.

cURL gives me this error:

curl: (7) couldn't connect to host

For those who are interested, here's my httpd-vhosts.conf file,

<VirtualHost *:80>
    DocumentRoot "/Library/WebServer/Documents"
</VirtualHost>

<VirtualHost *:80>
    DocumentRoot "/Users/AnkurKaushal/Documents/workspace/dev"
    ServerName ankur.local
    ErrorLog "/private/var/log/apache2/ankur.local-error_log"
    CustomLog "/private/var/log/apache2/ankur.local-access_log" common

    <Directory "/Users/AnkurKaushal/Documents/workspace/dev">
        Options Indexes FollowSymLinks
        AllowOverride All
        Order allow, deny
        Allow from all
    </Directory>
</VirtualHost>

and my /etc/hosts file:

127.0.0.1       localhost
255.255.255.255 broadcasthost
::1             localhost
fe80::1%lo0     localhost
127.0.0.1       ankur.local

What might I be missing here?

share|improve this question
    
Okay I fixed my own question, those who are having any issues like this. Just do sudo apachectl -t, that will help you fixing any issue your having with Apache configuration. In my case, it was just a simple space in httpd-vhosts.conf file that was causing the issue. –  Ankur Jul 21 '13 at 3:54
1  
Great job, to help us managing this place please make it in a answer so it can be marked as completed. –  Buscar웃 Jul 21 '13 at 9:54

1 Answer 1

Just do sudo apachectl -t, that will help you fixing any issue your having with Apache configuration.

In that case, it was just a simple space in httpd-vhosts.conf file that was causing the issue.

share|improve this answer

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.