apache xampp virtual host makes error 403 windows - apache

I simply want to enable the test.php file to be accessible via a virtualhost so I added just 127.0.0.1 test.localhost in the windows host file and
<VirtualHost *:80>
DocumentRoot "D:/Programmordner/test"
ServerName test.localhost
<Directory "D:/Programmordner/test">
require all granted
#<FilesMatch "^((test|test2).testdateiendung1|.+.testdateiendung2)$">
<FilesMatch "^(test.php)$">
Allow from All
</FilesMatch>
in httpd-vhosts.conf
Now if I add the second, it seems I even cannot open the default documentation website by clicking the admin-button on the apache interface, which should not be affected? If I erase the second the alterations in the windows host file doesnt affect anything and I can access all files in standard htdocs. I switched different versions like allow from all, access denied access granted but nothing changed
If somebody knows there is already which solves my problem, I will not grudge him however I looked for it and it did not help

I made several fixes and changed to Port 80 (without httpS :( ) and everything is running now.

Related

Accessing local host from another machine

I have seen many answers on this with what would appear to be simple solutions, none of which are working for me at this time.
I have WAMP install with Apache 2.4.33 32bit installed on a PC. I can access the site on that PC without a problem using the alias mySite.local.
The PC's host file looks like this
127.0.0.1 mySite.local
The remote lap top's host file is
192.168.1.114 mySite.local
That is the IP of the PC on the network.
httpd.conf
Listen 80
ServerName mySite.local:80
<Directory />
AllowOverride none
Require all denied
</Directory>
DocumentRoot "H:/Intranet/mySite_v2_www/public"
httpd-vhosts.conf
<VirtualHost *:80>
ServerName mySite.local
DocumentRoot "H:/Intranet/mySite_v2_www/public"
</VirtualHost>
I have tried disabling the windows firewall and virus checker on the PC.
The laptop appears to be getting there but being blocked. The message is..
Forbidden
You don't have permission to access / on this server.
Apache/2.4.33 (Win32) PHP/7.2.4 Server at mySite.local Port 80
So it looks like it can see Apache but is being blocked. So what else needs to be set to get access to the server?
Here are two of the links that I have been following to try and get this to work
Error message "Forbidden You don't have permission to access / on this server"
and
How do I connect to this localhost from another computer on the same network?
Thanks for any direction you can provide.
To complement the answer of Paul Neale:
Forbidden You don't have permission to access / on this server. Apache/2.4.33 (Win32) PHP/7.2.4 Server at mySite.local Port 80
That message is an answer from Apache. Disabling the windows firewall and virus checker on the PC won't have any effect, you are already reaching Apache there is not any networking problem.
Apache is receiving your request to access the root folder "public":
H:/Intranet/mySite_v2_www/public
But denies the request because, the directive Require local is enabled. This directive means, you can access to the content of public from the local server (localhost), which is the same to say 127.0.0.0 or localhost.
What you wanted is to tell apache that allows the access of certain IP address to the root directory "public".
When you changed the directive to Require all granted you are telling apache that, no matter who asks, give it access to / (root folder) in other words "public".
So, what you was searching for is "Access Control" in apache, and the directive Require can be used with IP address, here's the main document from Apache, this is an example:
Require host address
Require ip ip.address
It's important to differentiate between Network//Permissions problems. If you want to know if you are able to communicate (At network level) with Apache, you could do:
telnet <IP_APACHE_SERVER> <PORT_APACHE_SERVER>
#example: telnet 172.10.10.2 80
So after playing around will combinations for a day I found that in the httpd.conf I needed to change Require local to Require all granted in the section.
<Directory "H:/Intranet/mySite_v2_www/public/">
Options +Indexes +FollowSymLinks +Multiviews
AllowOverride all
# onlineoffline tag - don't remove
# Require local
Require all granted
</Directory>

Xampp keeps redirecting to dashboard

I am trying to set up local dev environment with virtual host, using XAMPP, on my new work laptop - running Windows 10.
I have exactly the same set up as on my Surface Pro where it works, but each time I try to access local, I get redirected to the dashboard.
In the hosts file I have added:
127.0.0.1 local.testing.co.uk
In httpd-vhosts.conf I have added:
<VirtualHost *:80>
DocumentRoot "C:/www/testing-co-uk/web"
ServerName local.testing.co.uk
<Directory />
AllowOverride none
Require all granted
</Directory>
</VirtualHost>
In httpd.conf, I have amended the DocumentRoot and Directory as follows:
DocumentRoot "C:/www"
<Directory "C:/www">
My testing-co-uk folder is in C:/www
If I go to local.testing.co.uk, I get redirected to local.testing.co.uk/dashboard.
If I go to localhost, I also get redirected to local.testing.co.uk/dashboard.
If I go to localhost/index.php, I do get to the front page of site I want, however clicking on a link will take me to local.testing.co.uk/linkname (and a 404 error).
Can anyone kindly suggest what could be going wrong? I have been going slowly insane for about 10 hours now. I have checked various other posts within Stack Overflow and tried various solutions, and of course, restarted Xampp every time.
Any help would be really appreciated.
Kind regards
James

Cannot access to my server without writing the client's host

I have set up my OVH server, installing apache2, php5, mysql, phpmyadmin etc... And configured the vhosts.
The content of my VirtualHost file :
<VirtualHost *:80>
ServerName www.abracadabook.fr
ServerAlias abracadabook.fr *.abracadabook.fr
DocumentRoot /home/abracadabook/www/
<Directory /home/abracadabook/www/>
Options -Indexes
AllowOverride All
</Directory>
</VirtualHost>
When I type the ip address of my server, it displays the apache default page. But after setting up my windows hosts file (I'm on windows but the server's on linux), when I try accessing abracadabook.fr the site is loaded and the root directory is right (/home/abracadabook/www) and it displays the normal index of my website. But the problem is that the site is not accessible from another client machine.
When I try to access to it from a PC which host file is not set up, nothing will load even when I access it with the ip address.
I searched in many boards and forum but never found the solution.
I hope you can help me.
Regardly,
(PS Sorry for my bad english)
Turns out I had not the good informations.
I followed this tutorial step by step and it works well now.
Kimsufi DNS setting Tutorial (French)

Allowing 0.0.0.0 access in WAMP

Everything is setup correctly, but I'm getting "403..... Forbidden You don't have permission to access / on this server." error's when I access my IP address or my TLD. Any help?
In your VirtualHost, make sure that you have access permissions set in the Directory block...
order allow,deny
allow from all
Check your DocumentRoot folder for an .htaccess file, it can override the above.
Aside from that, you can also get this error when your VirtualHost does not contain the proper ServerName or ServerAlias and the request ends up falling into the default httpd.conf setup.
Also consider trying out another WAMP package.
xampp (free) -
WampDeveloper Pro (commercial) -
WampServer (free)
You are probably making requests from ::1, which is IP6 127.0.0.1.
So just update your <Directory "c:/wamp/www/"> section at C:\wamp\bin\apache\ApacheX.X.X\conf\httpd.conf sections to:
Order Deny, Allow
Deny from all
Allow from 127.0.0.1
Allow from ::1
Remember to also do it in all conf files of C:\wamp\alias
This way you preserve the apache security.

Magento not accessible since tried to move to multi website setup. Apache issue?

I wish I had never seen this article:
http://www.magentocommerce.com/knowledge-base/entry/tutorial-multi-site-multi-domain-setup
I have Apache 2.2 installed on my XP machine and until a while ago I had a Magento site that I could test the development of a custom module on. I decided that I wanted to have multiple websites and multiple stores so that I could test that my modules configuration variables set at the different scopes (global, website, and store) were working as expected.
So I followed the instructions in the above Magento article. I created a website and gave it a name of “paulsplace.com”. I created a couple of Stores under that website. I then went to System/Configuration/General/Web and, with the scope set to paulsplace.com, I set the unsecured and secured URLs to http://paulsplace.com/ and https://paulsplace.com/ and hit Save Config - what a mistake!!
I got a 404 error. And now I can’t get to my magento front end or back end.
I tried a couple of things:
I added these lines to my hosts lookup file:
127.0.0.1 paulsplace.com
127.0.0.1 www.paulsplace.com
I then uncommented this line in my httpd,conf file:
Include conf/extra/httpd-hosts.conf
and added the following to the conf/extra/httpd-hosts.conf file:
<VirtualHost *:80>
ServerAdmin me#myemail.com
DocumentRoot "C:/Applications/Apache Software Foundation/Apache2.2/htdocs"
ServerName paulsplace.com
ErrorLog "logs/paulsplace.com-error.log"
CustomLog "logs/paulsplace.com-access.log" common
</VirtualHost>
and restarted Apache.
If I browse to “http://www.paulsplace.com” I now get a page that just says “It works!”. Same for “http://paulsplace.com” and “http://www.paulsplace.com/magento/index.php”.
I tried a few more things - I added this line to httpd.conf:
AccessFileName htaccess
(I did this because Windows Explorer didn’t let me create a file starting with a dot; I could do it from the command prompt, but I believe what I have done should be ok).
I changed AllowOverride to All from None:
<Directory />
Options FollowSymLinks
AllowOverride All
Order deny,allow
Deny from all
</Directory>
<Directory "C:/Applications/Apache Software Foundation/Apache2.2/htdocs">
AllowOverride All
</Directory>
and in C:\Applications\Apache Software Foundation\Apache2.2\htdocs\htaccess (a file that I created), I entered:
SetEnvIf Host www\.paulsplace\.com MAGE_RUN_CODE=pws1
SetEnvIf Host www\.paulsplace\.com MAGE_RUN_TYPE=website
SetEnvIf Host ^paulsplace\.com MAGE_RUN_CODE=pws1
SetEnvIf Host ^paulsplace\.com MAGE_RUN_TYPE=website
(pws was the value I used for the “Code” when creating my store).
Please tell me how I can put this right. I feel like I’m taking one step forward and three backward at the moment.
Any help really would be greatly appreciated.
<VirtualHost *:80>
ServerAdmin me#myemail.com
DocumentRoot "Change this to point at your magento install"
ServerName paulsplace.com
ErrorLog "logs/paulsplace.com-error.log"
CustomLog "logs/paulsplace.com-access.log" common
SetEnv MAGE_RUN_TYPE website
SetEnv MAGE_RUN_CODE pws1
</VirtualHost>
If changing anything in System Configuration borks your system, you can always clear out the bad values in the database directly, and clear your Magento cache. Do a
select * from core_config_data where value LIKE '%paulsplace.com%'
This will give you the two rows that were added when you clicked save. Remove the rows. Next, clear out all the files in
var/cache/*
to clear your cache. Then restore your Apache config to what it was before you started monkeying around. This should restore your site back to its previous state, and you can continue to experiment with things.