3

I have configured all my websites in the "Sites" folder to be tested in my browser. When I type a web address for example http://test.dev, I get "It Works".

Why?

closed as off-topic by Jenny D, womble Oct 5 '17 at 9:40

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Questions on Server Fault must be about managing information technology systems in a business environment. Home and end-user computing questions may be asked on Super User, and questions about development, testing and development tools may be asked on Stack Overflow." – Jenny D, womble
If this question can be reworded to fit the rules in the help center, please edit the question.

  • 5
    Because you haven't configured it to say anything else? – Zoredache Dec 25 '10 at 15:07
16

That's the default Apache HTTP index page. It's there to indicate you've correctly installed and enabled httpd.

  • 11
    In other words, because "It Works". – mattdm Dec 24 '10 at 22:14
8

That page is located in /Library/Webserver/Documents.

You need to make sure you uncomment the second line of the following:

# User home directories
Include /private/etc/apache2/extra/httpd-userdir.conf

That file then includes the files in /private/etc/apache2/users

There should be one with your username.

You can then go to localhost/~username, which is equivalent of visiting Users/username/Sites

  • 1
    or uncomment this line Include /private/etc/apache2/extra/httpd-vhosts.conf in /etc/apache2/httpd.conf – Dimitris Baltas Oct 10 '16 at 15:08
4

This probably means that you don't have a specific entry in your web server configuration for for the IP address (if using IP-based virtual hosting) or the name you are trying to reach (test.dev, in your example, if using name-based virtual hosting).

For example, in Apache you can create <VirtualHost> sections which specify the document root for requests that match the IP and/or name (again, depending on if you're doing IP or name based virtuals). If none of those match, it will fall back to the DocumentRoot and other settings that are set outside of the <VirtualHost> entries.

So, to resolve it you could either make the virtual host config for the site that you want to receive these requests include this name/IP that isn't currently matching (preferable) or make one of your sites existing in the main config instead of in a <VirtualHost> (or similar depending on the web server you are using) section.

2

use apachectl -S (mac) to list the loaded configuration and to see all your loaded virtual hosts. probably your project's .conf file is not in that list.

Not the answer you're looking for? Browse other questions tagged or ask your own question.