Lyric Posted October 4, 2013 Share Posted October 4, 2013 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? Quote Link to comment https://forums.phpfreaks.com/topic/282704-unable-to-find-domain-name/ Share on other sites More sharing options...
Ch0cu3r Posted October 4, 2013 Share Posted October 4, 2013 (edited) 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 October 4, 2013 by Ch0cu3r Quote Link to comment https://forums.phpfreaks.com/topic/282704-unable-to-find-domain-name/#findComment-1452549 Share on other sites More sharing options...
Lyric Posted October 4, 2013 Author Share Posted October 4, 2013 I'm taking my hat off!Works perfectly! Thanks a lot Quote Link to comment https://forums.phpfreaks.com/topic/282704-unable-to-find-domain-name/#findComment-1452588 Share on other sites More sharing options...
dalecosp Posted January 30, 2014 Share Posted January 30, 2014 (edited) 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 January 30, 2014 by dalecosp Quote Link to comment https://forums.phpfreaks.com/topic/282704-unable-to-find-domain-name/#findComment-1467128 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.