Can't access localhost with wamp and Chrome - google-chrome

from today, when I go to localhost (http://localhost) after launch WAMP, in Firefox, as usual, everything is normal, but Chrome says "Forbidden, You don't have permission to access / on this server."
Anyone can help me please ?

Edit: Solved it for me.
This is an IPv6 problem. Google must have just updated Chrome.
First of all ensure that your hosts file has the following line and that it is uncommented.
::1 localhost
Next, open up your Apache config (httpd.conf) and add the following to the listen section:
Listen [::1]:80
Next, you need to edit you Directory statements in httpd.conf or your vhosts files. They probably look something like this.
<Directory "C:\path">
Options Indexes FollowSymLinks
Order Deny,Allow
Deny from all
Allow from 127.0.0.1
AllowOverride All
</Directory>
Add an extra line after the 'Allow from 127.0.0.1' so it looks like this
<Directory "C:\path">
Options Indexes FollowSymLinks
Order Deny,Allow
Deny from all
Allow from 127.0.0.1
Allow from ::1
AllowOverride All
</Directory>

For anyone running into this problem this is what worked for me on apache 2.4.17
host file is here: C:\Windows\System32\drivers\etc
httpd.conf is here: C:\wamp64\bin\apache\apache2.4.17\conf
httpd-vhosts.conf is here: C:\wamp64\bin\apache\apache2.4.17\conf\extra
I made sure that localhost was enabled in my hosts file:
127.0.0.1 localhost
::1 localhost
just remove the # at the beginning of the line.
make sure this line in un-commented in your httpd.conf
Include conf/extra/httpd-vhosts.conf
In my file it was line 518.
then add this to your httpd-vhosts.conf file:
<VirtualHost *:80>
ServerAdmin somerandomdude#whaaat.com
DocumentRoot "c:/wamp64/www"
ServerName localhost
</VirtualHost>
Then restart WAMP.
I don't know if that's the cleanest way of doing it(probs not). but it worked pretty well for me.

It happens the same to me. From today I can not access with http://localhost to my wamp files with chrome.
In Firefox or Explorer I have no problems.
You can use 127.0.0.1 while the problem is solved.

I had the same problem. This is how I solved it out:
I first added ::1 to host file,usually found at C:\Windows\System32\drivers\etc
Then I went ahead an opened my Chrome browser. I went to settings>advanced settings>Open proxy settings (under the title system)
In the new window that pops up go to 'LAN settings' then make sure you check 'Automatically detect settings'

Related

Links No Longer Work After Wordpress Server Migration

I had a Wordpress server running on a windows based WAMP server and I just migrated over to my main Ubuntu Server. The first thing I did was move the database over and then the files. After pointing the Wordpress config file to the new database, the home page loaded right up!
The problem is that the nav links or any other link that is NOT the homepage loads a 404 error.
I have tried pointing my Virtualhost to the .htaccess file and then also re-saving the permalinks in wordpress.
Here is my current Virtual host file
Virtual Hosts:
<VirtualHost *:80>
ServerName WherehouseMKE.com
ServerAdmin info#wherehousemke.com
DocumentRoot /var/www/html
<Directory /var/www/html>
AllowOverride All
Require all granted
</Directory>
</VirtualHost>

Error code 403 when using WAMP for custom website

When attempting to access a website i am attempting to host on my pc using WAMP i get the typical error code 403 forbidden. I have edited the apache config to allow all etc but still seem to get it, however i can see localhost and phpadmin from 127.0.0.1
Any other suggestions? i can attach my apache config or put it in a pastebin if needed
For reference im running Win10(64x) with WAMP Server 3.0.6 (64x)
I have followed multiple tutorials from youtube and stackoverflow but cannot seem to get it to work as most use commands given are from linux such as 'chmd' (i have used linux before therefor understand what this means but cant work out how to do the same thing via windows)
Try making virtual host and give access to all local user. Make sure you give access to
file -------> httpd.conf
DocumentRoot "${INSTALL_DIR}/www"
<Directory "${INSTALL_DIR}/www/">
#onlineoffline tag - don't remove
Require local
Require ip 192.168.0
</Directory>
Edit httpd-vhosts.conf As like:
file ------> httpd-vhosts.conf
# Virtual Hosts
<VirtualHost *:80>
ServerName localhost
DocumentRoot c:/wamp64/www
<Directory "c:/wamp64/www/">
Options +Indexes +Includes +FollowSymLinks +MultiViews
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
<VirtualHost *:80>
ServerName smarthome
DocumentRoot "c:/wamp64/www/smarthome"
<Directory "c:/wamp64/www/smarthome/">
Options +Indexes +Includes +FollowSymLinks +MultiViews
AllowOverride All
Require all granted
</Directory>
</VirtualHost>

How to put wildcard entry into /etc/hosts?

I recently wanted to point all subdomains for a test domain, let's say example.com to the localhost. Is there a way to point all requests on *.example.com to resolve to 127.0.0.1
It happens that /etc/hosts file doesn't support wild card entries.
You'll have to use other services like dnsmasq. To enable it in dnsmasq, just edit dnsmasq.conf and add the following line:
address=/example.com/127.0.0.1
use dnsmasq
Assuming that you're using a Debian-based dist(ubuntu, mint..), check if it's installed with
(sudo) systemctl status dnsmasq
If it is just disabled, start it with
(sudo) systemctl start dnsmasq
If you have to install it, write
(sudo) apt-get install dnsmasq
To define domains to resolve edit /etc/dnsmasq.conf like this.
address=/example.com/127.0.0.1
to resolve *.example.com
! You must reload dnsmasq to take effect for the changes !
systemctl reload dnsmasq
Here is the configuration for those trying to accomplish the original goal (wildcards all pointing to same codebase -- install nothing, dev environment ie, XAMPP)
hosts file (add an entry)
file: /etc/hosts (non-windows)
127.0.0.1 example.local
httpd.conf configuration (enable vhosts)
file: /XAMPP/etc/httpd.conf
# Virtual hosts
Include etc/extra/httpd-vhosts.conf
httpd-vhosts.conf configuration
file: XAMPP/etc/extra/httpd-vhosts.conf
<VirtualHost *:80>
ServerAdmin admin#example.local
DocumentRoot "/path_to_XAMPP/htdocs"
ServerName example.local
ServerAlias *.example.local
# SetEnv APP_ENVIRONMENT development
# ErrorLog "logs/example.local-error_log"
# CustomLog "logs/example.local-access_log" common
</VirtualHost>
restart apache
create pac file:
save as whatever.pac wherever you want to and then load the file in the browser's network>proxy>auto_configuration settings (reload if you alter this)
function FindProxyForURL(url, host) {
if (shExpMatch(host, "*example.local")) {
return "PROXY example.local";
}
return "DIRECT";
}

localhost/phpmyadmin giving page not found error

I'm running wampserver.
I had a mysql server crash, and the wampmysqld service would not start up. Also, localhost/phpmyadmin did not show phpmyadmin but gave me a 403 error. I installed the mysql-addon for another mysql version. Then I went to the wampserver icon and did Mysql > Version > and selected the add-on version I'd just downloaded.
This helped, wampmysqld was able to start up, the wampserver icon was able to go green all the way, and my application is working. However, phpmyadmin is giving a 404 error. How do I fix this?
phpmyadmin.conf is:
Alias /phpmyadmin "c:/wamp/apps/phpmyadmin3.3.9/"
# to give access to phpmyadmin from outside
# replace the lines
#
# Order Deny,Allow
# Deny from all
# Allow from 127.0.0.1
#
# by
#
# Order Allow,Deny
# Allow from all
#
<Directory "c:/wamp/apps/phpmyadmin3.3.9/">
Options Indexes FollowSymLinks MultiViews
AllowOverride all
Order Deny,Allow
Deny from all
Allow from 127.0.0.1
</Directory>
I changed c:/ to d:/ as per the location of phpmyadmin on my machine and restarted all services. But I'm still getting the same error.
You need to configure your apache2.conf to make phpMyAdmin works.
sudo nano /etc/apache2/apache2.conf
Then add the following line to the end of the file.
Include /etc/phpmyadmin/apache.conf
Then restart apache
/etc/init.d/apache2 restart
When you install a new phpmyadmin, or anything at all that refreshes the state of the apache.conf, there is usually need to retrace all previous manual inclusions in the config file.
Hence, given that when phpmyadmin is installed like in this tutorial, you added a line in the /etc/apache2/apache2.conf it becomes necessary to repeat that step:
Hence, running the command
sudo nano /etc/apache2/apache2.conf
and the including the following line at the end of the opened config file
Include /etc/phpmyadmin/apache.conf
usually solves this problem.
Remember to hit CTRL+O to save your changes, and then CTRL+X to close the open file.
Lastly, restart apache to let your new configuration take effect:
sudo systemctl restart apache2
That's it!
Start wamp or xamp make sure the icon color change to green for wamp. This time open it in another browsers not Internet explorer . it should work

How to rectify this virtualhost setup on Wamp?

Could anyone please help me with setting up this virtual host on my WAMP server?
I have read through several posts and blogs online and unable to get this set up.
I followed the procedure suggested here: http://www.ruifeio.com/2011/01/30/setting-up-virtual-hosts-on-wampserver/
When I do the above, my server hangs up. Presently I added the following to my C:/windows/system32/drivers/etc/hosts file
127.0.0.1 tsg.local
And I changed my httpd.conf Apache config file with Listen 90 since I am using Port 90
Plus, removed # tag as suggested in the above tutorial.
# Virtual hosts
Include conf/extra/httpd-vhosts.conf
I also added the following to my httpd-vhosts.conf
<VirtualHost *:90>
ServerAdmin webmaster#localhost
DocumentRoot “C:\wamp\www\tsg\”
ServerName tsg.local
ErrorLog “C:\wamp\www\logs\tsg.log”
CustomLog “C:/wamp/www/logs/common.log” common
</VirtualHost>
And changed: NameVirtualHost *:80 to NameVirtualHost *:90
Thanks for helping out in advance!
If your server will start fine with the Virtual Host block removed, try fixing your quotes. It looks like you have some "magic quotes" instead of straight quotes - likely from copy and pasting from the tutorial. Try this instead:
<VirtualHost *:90>
ServerAdmin webmaster#localhost
DocumentRoot "C:\wamp\www\tsg\"
ServerName tsg.local
ErrorLog "C:\wamp\www\logs\tsg.log"
CustomLog "C:/wamp/www/logs/common.log" common
</VirtualHost>
You also might want to pick a more standard port to listen on, 8080 or 8888 rather than 90 if 80 is not an option.