I’ve tried to update the /etc/hosts file and added the 127.0.0.1 to. This site can’t be reached ’s server IP address could not be found. I could not do the search and replace part at the end as the localhost would hang when i tried it.Īnyways the installation is fine for the primary site (fourplusmedia.local) but for the subsites () i get a screen with this messages I followed instructions from here ( ) to do the installation. the original website is and the local one is fourplusmedia.local. i’ve created a localhost version of my website.
If you are using Windows 10 the above dns commands no longer work, you should do this instead.Hi. Once you have made all these changes remember to restart Apache.Īlso if you change the hosts file to make the chnages active you should either reboot or run these command from the command line of a command windows started ising the Runs as Administrator option. If you get to the stage of Port Forwarding you router so that the world is allowed into your network that would cause ALL OF YOUR SITES to become available to the world.īetter to change the ONE Virtual Host Definition for the ONE site you want people to see for testing/bragging from Require local to Require all granted and only allow that single site to be access from the internet. It may solve your issues in the short term, but is just waiting to catch you sometime later when you decide you want to show your site to a friend/client/boss. Require ip 192.168.1Īlso avoid using the syntax that allows access from anywhere i.e. Or to anyone on your local network just use the first 3 of the 4 quartiles of the ip address.
work mate or the kids etc, you can add this syntax to one or more of your Virtual Host definition.Īllow just a single other PC into your site Require local If you find you want to allow other PC's inside your local network to see you site i.e. You are using Apache 2.4 so use the Apache 2.4 syntax. Apache can connect to any of these site.Īvoid mixing Apache 2.2 syntax and Apache 2.4 syntax together in the same definition. section tells Apache which IP Addresses it is allowed to accept connections from, so using the Apache 2.4 syntax Require local limits access so that only the PC running WAMPServer i.e. ServerAlias ErrorLog "logs/mysite-error.log"ĬustomLog "logs/mysite-access.log" common Now on the 2 Virtual Hosts that actually exist on your system try this as the Virtual Host definition : The browser can arbitrarily use either so you need both but will probably use the IPV6 network in preference to the IPV4 if both are actually active on your PC.
Second Apache 2.4.x is IPV4 ( 127.0.0.1 ) and IPV6 (::1) aware so your hosts file should look like this with definitions for both IPV4 and IPV6 versions for each site. So remove these 2 definitions from the file:
They are there as examples only just to get you started with the syntax, and should not remain in an active conf/extra/nf as they are pointing to non existant folders. Any ideas will be greatly appreciated!įirst you need to remove the example dummy definitions from your nf file. My virtual host was working before but i'm not sure why it wasn't working now. I try to access my project using this URL: BUT I am getting a Server not found error I tried accessing it using, but still having a bad luck! On my c:\Windows\System32\Drivers\etc\hosts # localhost name resolution is handled within DNS itself. ServerAdmin "g:/Apache24/docs/"ĮrrorLog "logs/"ĬustomLog "logs/" commonĬustomLog "logs/localhost-access.log" common ServerAlias ErrorLog "logs/"ĬustomLog "logs/" common # match a ServerName or ServerAlias in any block. # The first VirtualHost section is used for all requests that do not # Almost any Apache directive may go into a VirtualHost container. # You may use the command line option '-S' to verify your virtual host # for further details before you try to setup virtual hosts. This is indicated by the asterisks in the directives below. # use only name-based virtual hosts so the server doesn't need to worry about # machine you can setup VirtualHost containers for them. # If you want to maintain multiple domains/hostnames on your On my G:\wamp\bin\apache\apache2.4.9\conf\extra\nf # Virtual Hosts