Jump to content

Recommended Posts

Hey,

I've been using Apache for about a year now and it have been working completly fine.
However, I had a little break with my webdesign projects for a few months and haven't been using it during this time. When I started apache again I was unable to find my domain name in my browser.

I've uninstalled apache completly and I still have the same error.

When I try finding my hosted files with localhost or 127.0.0.1 in the browser I can find my sites, but not when I use the domain name.

 

 

This is what my hosts file looks like:

 

# localhost name resolution is handled within DNS itself.
#    127.0.0.1       localhost              www.mytestingwebsites.com
#    127.0.0.1       localhost
 

 

And in Apache config
 

#ServerName www.mytestingwebsites.com:80

 

 

I've been turning off some Windows Services during the time I've not been working on websites. Is it possible that I may have disabled some services that are dependent on this?

Link to comment
https://forums.phpfreaks.com/topic/282704-unable-to-find-domain-name/
Share on other sites

Lines that start with a # are ignored in the hosts file and httpd.conf file.

 

Each domain that maps to an ipaddress needs to be on its own line. This is how your host file should look like

127.0.0.1       localhost
127.0.0.1       www.mytestingwebsites.com

Now localhost and mytestingwebsites.com will map back to the local loop back address 127.0.0.1

 

 

In the httpd.conf file you set up the ServerName using (lines that start with a # are ignored)

ServerName www.mytestingwebsites.com:80

If you want to access both http://localhost/ and http://mytestingwebste.com/ but to serve files from different locations you'll need to set-up name based virtual hosts. Otherwise leave the above line commented out and set the Listen directive to

Listen 127.0.0.1:80
Edited by Ch0cu3r
  • 3 months later...

This is how your host file should look like

127.0.0.1       localhost
127.0.0.1       www.mytestingwebsites.com

 

In most Unix flavors, an alias is acceptable in the second position:

127.0.0.1       localhost    donny
127.0.0.1       www.mytestingwebsites.com     development
1.2.3.4         www.google.com                dagoog
11.22.33.4      development.server.mysite.com    devel
Edited by dalecosp
This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.