Apache: Your requested host "localhost" could not be resolved by DNS - php

I am working on my old windows 7 user for a month and everything works fine but eventually, our admin gave me new ADID (active directory ID). Then when i log on using that ADID. My localhost is not working anymore. It gives me an error below :
Error (dns_unresolved_hostname)
Your requested host "localhost" could not be resolved by DNS.
For assistance, Please. contact our Help Desk.
I tried to navigate at http://ip_address/ and it is working fine but the localhost is really gives me a headache.
But when i try to log on using my old ADID. Everything is back to normal. Already tried to reinstall xampp and laragon on my new ADID. Already tried everything i saw on the internet, and still not working.
By the way, this is my hosts
127.0.0.1 localhost
127.0.0.1 sample1.dev
127.0.0.1 sample2.dev
My configuration on my XAMPP is the default. I haven't reconfigure it yet since fresh install.
Update : While i'm investigating this case, i try to remove my internet connection then navigate to http://localhost. My browser says "No internet connection" so in my understanding, my localhost and 127.0.0.1 is pointing outside my local machine. Any idea guys?

This article help me much.
All i did was to remove my proxy temporarily and run Laragon. Then after i checked that my localhost is working properly, i set up my proxy again.

::1 is IPv6 version for 127.0.0.1. to resolve to localhost, try:
edit c:\xampp\apache\conf\httpd.conf and change the Listen 80 to
Listen 127.0.0.1:80 or
disable IPv6 in your adapter or
change virtualhost to
<VirtualHost *:80> or <VirtualHost 127.0.0.1:8080>

Related

how to get rid of default apache page "it works!"?

I created a virtual host on MAMP PRO 5 like this "mywebsite.test" but it does not open the local site unless I add :8888 so it has to be like this "mywebsite.test:8888" then I changed the Apache port to 80 and whenever I try to get them to local site using "mywebsite.test" is show me the default page of apache "it works!" instead.
I did uncomment this line
# Virtual hosts
#Include /private/etc/apache2/extra/httpd-vhosts.conf
in
/private/etc/apache2/httpd.conf
but still not working
any solution?
I just found the solution this could be helpful to anyone facing this same problem.
After contacting the support they told me to check indexes under Apache tab and it works
make sure the Apache port is at 80 and not 8888

How do I know what server name or web address was set on Nginx

I am trying to setup LEMP (Linux, Nginx, MySQL, PHP) stack on my PC to use with Wordpress.
I follow the instructions on this website. I see that the folder of wordpress in www folder was successfully extracted.
I can also verify that Nginx is running. However, I don't know how to get the wordpress index.php page on the browser.
On windows, I simply go to the browser and type localhost/webprojectfoldername or 127.0.0.1/webprojectfoldername
However, when I try to access the index.php of wordpress via localhost, I get the Apache page.
I would like to use Nginx as server but not Apache. I guess at this point, I don't know what servername or ipaddress to put on the browser to get to Nginx's page or Wordpress's index.php
I don't know how to identify the servername that was setup. On Windows, I simply use localhost or 127.0.0.1.
Any thoughts on how I identify it on Ubuntu?
I'd appreciate any help.
Thank you.
*** EDIT (Added Screenshot of Nginx configuration) ****
Either:
nginx is listening on a different port
By default, HTTP works over port 80, but when you connect to that port you are reaching Apache.
You need to find the port nginx is listening on (from the article you link to: listen 80 default_server; shows 80 but lets say it was 81) and connect to that instead: http://localhost:81/`
nginx and apache are trying to listen on the same port and apache won
You need to turn off Apache (and possibly restart nginx).

wamp localhost not working (I know there are few posts but mine is quite weird)

Ok, let me try to shorten things so less to read.
wamp works fine for the past few months, then I started to learn laravel4 and optionally requires vhost and rewrite_module which works pretty well that when I type in larave.intro as URL it works.
Now I'm trying to use wamp again just going to localhost AND page says
The title of the page does say 404 Not Found.
Read a few threads, some said go apache->service->Test port 80 and see if there are other ports running port 80. It says
Your port 80 is actually used by : Server: Apache/2.4.4 (Win32) PHP/5.4.16
which means my apache is the only one running it isn't it...
this already makes me curious and feeling weird, well alright then I go change my port or 8000 in the httpd.conf restart my wamp. and uses localhost:8000 alright now wamp works and I test port 80 again it says
Your port 80 is actually not used.
So nothing is running on my port 80 why can't wamp use it?
And, at first I thought it's my vhost so I deleted the vhost and in my host I deleted 127.0.0.1 laravel.intro too and runs my wamp back to port 80...still doesn't work.
I was thinking then fine I will just use port 8000 BUT then my vhost won't work :(
I was using this as my vhost before
<VirtualHost *:80>
DocumentRoot "J:\wamp\www\laravel4-basic\public"
<Directory "J:\wamp\www\laravel4-basic\public">
Options FollowSymLinks Indexes MultiViews
AllowOverride All
</Directory>
ServerName laravel.intro
</VirtualHost>
and in host it's 127.0.0.1 laravel.intro
now since I'm using port 8000 I suppose I should change the vhost too? so I changed to
<VirtualHost *:8000>
and laravel.intro doesn't work. laravel.intro works if I'm using port 80 with virtualhost: *80 and in URL if I type 127.0.0.1:8000 what popped up is laravel.intro instead of the wamp index and if I use localhost:8000 wamp index comes out.
I'm pretty much so confused now.
Side note:php Admin works fine if I'm using port 80 and in URL I just go localhost/phpmyadmin
Anyone knows what I'm talking about here? I'm getting confused a bit myself at the end and anyone can get me back to port 80 with everything works?
(if I have to change port then oh wells better than one works and the other one doesn't)
Please give me some suggestions thanks ~!
completely remove the wamp files and just clean the temp files and www folder where you have installed and restart the system and then reinstall WAMP and run
The error message means apache is running, so this is a good thing.
By specifying the local host url you are requesting a file called index.htm, index.html or index.php (any one of them depending on your configuration), and the error is merely telling you that the file is not there.
Check that one of these files are in the directory : J:\wamp\www\laravel4-basic\public
If you do that and the problem persists, look for the *error_log in the WAMP log directory. The 404 error message means a file is missing. The error log will tell you which file it is looking for that is missing.
I'm using Laravel 4.1 installed in a Windows OS System with WAMP Server and I get it working using the following routine:
To avoid the conflict between localhost and your virtualhost project you can config as follow:
In the httpd.conf remove the # from the following line:
#Include conf/extra/httpd-vhosts.conf
to
Include conf/extra/httpd-vhosts.conf
Later you need to modify your httpd-vhosts.conf file from c:/wamp/bin/apacheX.X.X/conf/extra folder (i'm using Windows 8 OS). Here you need to add the following VirtualHosts:
#Localhost
<VirtualHost localhost:80>
ServerName localhost
DocumentRoot "c:/wamp/www/"
</VirtualHost>
#My VirtualHost
<VirtualHost appdomain.dev:80>
ServerName appdomain.dev
DocumentRoot "c:/wamp/www/app/public"
</VirtualHost>
In this virtualhost app is the project folder and appdomain.dev is the host that I specify in the hosts windows file located in c:/windows/system32/drivers/etc/hosts:
127.0.0.1 appdomain.dev
As you can see it needs two VirtualHosts because if you use only the second VirtualHost you overwrite the localhost access, then you need to specify the Localhost access as a new top virtualhost.
I hope it serves you.
This problem happen cause of port 8000 has been reserved so try to change it by the following :
In your command line prompt try :
php artisan serve --port=8080
Go to your browser with : localhost:8080
by that it works with me.

Browserstack.com webtunnel not working

I'm using Browserstack.com local test and it seems not working for me.
I installed lampp on my Ubuntu 12.04 and configured httpd-vhosts.conf and /etc/hosts like below:
httpd-vhosts.conf:
<VirtualHost *:80>
DocumentRoot "/home/ME/FOLDER"
ServerName dev
</VirtualHost>
/etc/hosts:
127.0.0.1 dev
I can access my PHP site on my local machine by typing dev/ in Chrome, but when using Browserstack's web tunnel for local test, it won't work after I input dev as HOST and 80 as PORT.
Does anyone know how to make things work? Thanks.
BrowserStack's web applet doesn't works with openjdk+icedtea-6-plugin combination. Is it possible for you to switch to sun/oracle java[1]?
[1] https://askubuntu.com/questions/56104/how-can-i-install-sun-oracles-proprietary-java-6-7-jre-or-jdk
well, just tried command line mode and it works. Following the official documentation, type this command java -jar BrowserStackTunnel.jar <MYKEY> dev,80,0, the dashboard page will prompt you it's OK to run local site automatically.
Perhaps a bug with web tunnel? I'm using open_jdk 1.6 and I installed icedtea-6-plugin for Chrome, don't know if it has anything to do with the version.
Anyway, command line is totally OK but I wonder if someone can help configure the web tunnel with me.

Run wamp through lan or wan and as root website

I want to run a localhost php website from some other system. I was able to run the website through the subfolder link as http://192.168.1.102/website. But I want it to run as the main site http://website.
Is there any way we can achieve this.
I have tried adding following in hosts file but didn't work.
host:
http://192.168.1.102/website website
I also tried to do following:
host:
192.168.1.102 website
httpd-vhosts.conf
<VirtualHost *:80>
DocumentRoot e:/wamp/www/website/
ServerName website
</VirtualHost>
Here the DocumentRoot path is the path on other pc.
In the system in which you are hosting your website ( I mean the one you are accessing via LAN ) you need to have below host entry
127.0.0.1 localhost
127.0.0.1 website
and in the system from where you are accessing this remote system need to have below host entry
192.168.1.102 website
192.168.1.102 is the ip address of the machine you are accessing , please change it accordingly
Also If you have problems in setting Up VHOST in WAMP you can verify your way with the below link it worked for me I often use to follow this link
Setting up WAMP server in windows along with virtual HOST
You need to edit the apache config for wamp to point its default root to your folder (not the vhosts but the main file) also you'll need to put wamp into online mode so it'll listen on the external interface not just localhost but I believe this is just a * in the config anyway to listen to all not just 127.0.0.1
In the /etc/hosts add an entry like this:
127.0.0.1 www.localhost
192.168.1.102 website

Categories