WAMP server error 403 Forbidden - php

Disclaimer: I know this question has been asked before by many others, but I have read quite a few of those posts and none of the solutions have worked.
I changed the httpd.conf file from
Require local
to
Allow from all
Keep in mind that every time it doesn't work I change the code back to normal and try a different solution.
I can access it from my own computer but when I ask my friend to try the site it give him error 403 forbidden and tells him he has no access to '/'

If your original httpd.conf has the Require syntax then it is Apache 2.4
The Allow from all is Apache 2.2 syntax. Its best NOT to mix them up within the same httpd.conf file
If you really want to allow any ip in the universe to use your web site and you are running Apache 2.4 then us
Require all granted
Alternativeley if you just want to be able to get to your web server from your local network something like this is safer
Require ip 192.168.1
Note: use of only 3 of the 4 quartiles, gives access to any ip that starts 192.168.1 i.e any ip on the local network subnet
Documetation for Apache mod_authx_code can be found here

Related

404 error page is allowing access to my database

I'm new to programming and I'm developing an online application using Laravel, with XAMPP (on Windows) to host the database. Now when I test the login page I have noticed that when someone types a wrong URL
Example: localhost/mysitename/home/wrong name
it is displaying a 404 error page with a "go home" button at the bottom which can direct anyone to the database through phpMyAdmin.
Is there any way to fix this?
For starters, restrict your phpMyadmin to only the local host or an IP address on your local network. Find the conf file and make the following changes. Adjust the IP to something that you know.
/etc/phpmyadmin/apache.conf
<Directory /usr/share/phpmyadmin>
Add the following lines at the top:
Order Deny,Allow
Deny from All
Allow from 127.0.0.1
Next - You really need to look into how to correctly configure Apache and other web services before exposing your front-end.

Allow access to wamp server on WAN

I'm developing a site in local, and I would like to allow access to it to my friend through the web.
So I opened ports in my router and Firewall, but now I'm stuck configuring Apache.
Looked for it and it seems it's around those lines but I can't get it to work, when trying to connect, I get the forbidden message, so it seems port configuration is ok and it's really on server configuration...
<Directory />
AllowOverride none
Require all denied
</Directory>
And further
<Directory "${INSTALL_DIR}/cgi-bin">
AllowOverride None
Options None
Require all granted
</Directory>
First of all, am I right?
And if so, I just don't what to allow or write...
note : WAMP version 3.0
fullversion is : 3.0.6 for a 64 bits platform.
I'vre tried combination if ruleset, bu t I can't get my hand on it
Just open your website link in your browser and get your IP-Address from your network you are currently connected. Give the IP to your friend and the port number. He will become able to access it.
For example, your wifi/ethernet IP is 192.168.10.8 and port is 3000, so your friend give such 192.168.10.8:3000 in his browser and he will access it. Thanks

compile php one time for allways

I am making php program to run on local network and I want to give it to some other peoples to use. but I don't want to ask them to install XAMPP or other programs like this. (XAMPP is about 100 MB and they cant download it) is there any other way to make Apache and MySQL server easier on a system. for example they run a batch file and the file make server on port 80 and copy my scripts on its htdocs (or something like this) folder.
My second problem in XAMPP is PhpMyAdmin, which allow all devices in local network to manage my program databases and change them. I need a trick to disable PhpMyAdmin in client devices.
Sorry for bad English. :)
Xampp on windows is set to allow phpmyadmin from your local network. To disable access from your network, Open httpd-xampp.conf located in xampp-folder\apache\conf\extra\httpd-xampp.conf Somewhere down in the bottom of this configuration file is the LocationMatch node Even though you would think the default Order is set to deny, allow with Deny from all. This configuration by default is set to Allow from 192.168.0.#. Remove this ip range and you are set. Change this
<LocationMatch "^/(?i:(?:xampp|security|licenses|phpmyadmin|webalizer|server-status|server-info))">
Order deny,allow
Deny from all
Allow from ::1 127.0.0.0/8 \
fc00::/7 10.0.0.0/8 172.16.0.0/12 \
fe80::/10 169.254.0.0/16
ErrorDocument 403 /error/XAMPP_FORBIDDEN.html.var
</LocationMatch>
Don’t forget to restart Apache. Now http://localhost/phpmyadmin will result 403 Forbidden error.
If your computer and the other computers(computers which like to access) in the same network, the other computers can have access to the web application from the browser by inserting localhost/yourproject to [your-ip-address]/yourproject. Not only computer but also from your mobile device.
The only and the other way is hosting on the web.

Am able to access site via my IP, but not localhost anymore

I'm working on a wordpress website installed on my box using WAMP, so I've always typed in 'localhost' into the address bar in order to access the site.
I've always had the apache rewrite module enabled
I then had the idea of allowing people on our LAN to access the site via my LAN IP.
To do this I edited this line of Apache's httpd.conf file (per instructions on this page http://www.sourcecodester.com/tutorials/php/5155/how-access-wampserver-another-computer-lan.html) :
# Controls who can get stuff from this server.
#
# Require all granted
# onlineoffline tag - don't remove
Order Deny,Allow
Deny from all
Allow from 127.0.0.1
Allow from ::1
Allow from localhost
(I changed 'Deny from all' to 'Allow from all')
Saved the file,
accessed my box via IP on an iPad mini, then another windows PC.
Come back to the machine that is running WAMP and I'm developing the site on, click one of the navigation links on the page, then I get the 500 Internal Server Error
So I can now only see the wamp menu and the site by typing my own IP in. Some images aren't loaded, and I get Error 500 when trying to login by typing my IP with '/wp-admin' after it (meaning that I can't log in to wordpress to edit anything either)
What is the problem here? I really need to be able to access 'localhost' and continue developing the website, but I can not figure this one out!
Thank you
Try to access localhost/your-wp-dir-path/wp-admin/options-general.php and in
WordPress Address (URL) option give value as http://localhost/your-wp-dir-path

403 when attempting to use ajax to POST to the apps directory in Magento; only on 1 of 4 servers

I wrote a very simple Magento module that sends an email but doesn't use Magento's core emailing system. I'm using ajax to POST to email.php
I've tested this to oblivion in three separate environments: local, development, and staging. It works flawlessly on all three.
Now when I took these changes live on a fourth server, all post requests return the following:
POST http://mydomain.com/dir/path/email.php 403 (Forbidden)
And all post requests log the following to my error log:
client denied by server configuration: /var/www/vhosts/mydomain.com/httpdocs/dir/path/email.php, referer: http://mydomain.com/myCategory/myProduct
Everything appears to be exactly the same between the four servers. I've checked permissions and httpd.config as well as .htaccess files.
I can add the following to the /apps/.htaccess to get everything to work on live, however I can't keep it this way for obvious reasons.
<Limit POST>
order deny,allow
deny from all
allow from all
</Limit>
I thought there was a possibility that the magneto root .htaccess file could be the culprit but the staging and dev servers are clones of the live site.
Basically, I've checked everything I can think of on the server side of things. I'm completely perplexed as to why my module would work on three separate servers but not on the live site. Is there anything file related that could be causing this? Maybe firewall rules? The generic error in my log file is making this difficult to troubleshoot.

Categories