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

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

Related

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).

Issue in starting Apache from direct url Localhost

I used to work on localhost before and never had such issue, the issue was with Apache that was not starting so I went to my http.conf file and changed the port 80 to 8080 and from then I have to put the url present in the image. I just want to use the "localhost/projectname" which is not running at the moment.

Localhost on Xampp not Displaying

I'm testing xampp setup, and when I enter localhost, the homepage doesn't display. The main port is 80, and SSL port is 443. I've tried removing the index and dashboard files, but that didn't work. PHP scripts are not running correctly.
You need to start the Apache.....
XAMPP has all logs in-built. Go to Apache > Logs > Apache (error.log) and do a quick search. In most of the cases you likely want to change the port Apache listens to.
Go to Apache > Config > Apache (httpd.conf) and find Listen 80. Replace it with any non-blocked port, i.e. Listen 8087. Save the file and start Apache again.

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

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>

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.

Categories