Jump to content


Photo

Unable to find domain name

http apache domain host

  • Please log in to reply
3 replies to this topic

#1 Lyric

Lyric

    Newbie

  • New Members
  • Pip
  • 2 posts

Posted 04 October 2013 - 04:23 AM

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?



#2 Ch0cu3r

Ch0cu3r

    Advanced Member

  • Moderators
  • 1,679 posts

Posted 04 October 2013 - 05:02 AM

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, 04 October 2013 - 05:15 AM.


#3 Lyric

Lyric

    Newbie

  • New Members
  • Pip
  • 2 posts

Posted 04 October 2013 - 08:15 AM

I'm taking my hat off!

Works perfectly! Thanks a lot



#4 dalecosp

dalecosp

    Advanced Member

  • Members
  • PipPipPip
  • 278 posts
  • LocationJoplin, MO

Posted 30 January 2014 - 05:25 PM

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, 30 January 2014 - 05:25 PM.

"God doesn't play dice" --- Albert Einstein
"Perl is hardly a paragon of beautiful syntax." --- Weedpacket




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

Cheap Linux VPS from $5
SSD Storage, 30 day Guarantee
1 TB of BW, 100% Network Uptime

AlphaBit.com