Blocking on port 80 of apache

0

An application for a control is being developed inside the company, but when I try to use apache on other machines to get access it returns a lock

  

Forbidden

     

You do not have permission to access / backup on this server.   Apache / 2.4.18 (Win64) PHP / 5.6.19 Server at 192.168.123.22 Port 80

Note: If you put it on 8080 it does recognize it normally, but it needs to be at 80, we're using the latest apache version.

    
asked by anonymous 28.10.2016 / 17:12

2 answers

4

Forbidden means that you are accessing Apache, but the page is not authorized, I mean this is not a problem with the port, it's just a permissions problem.

>

WampServer

You are probably using WampServer , if this is the case just click on Put online ( or Put online if it's in English like this:

OtherthanWampServer

IfyouareusinganothertypeofserverthatusesApacheyoushouldedithttpd.conf

Itshouldlooksomethinglike(use+Ftolooksomethinglikethis):

<Directory"d:/wamp/www">
     Order Deny,Allow
     Deny from all
     Allow from 127.0.0.1
     Allow from ::1
     Allow from localhost
</Directory>

In this case it blocks everyone and only releases the last 3, so just add what you want to release, in case ip is 192.168.123.22 (if it is fixed), then it would look something like:

<Directory "c:/wamp/www">
     Order Deny,Allow
     Deny from all
     Allow from 127.0.0.1
     Allow from ::1
     Allow from localhost
     Allow from 192.168.123.22 #Ip da sua maquina
</Directory>

And then I restarted Apache, restart the computer (sometimes just doing logoff on Windows)

Or remove everything (make a backup of httpd.conf first, before editing anything)

And then I restarted Apache.

You said that only occurs with port 80, this is because the settings can be in VirtualHost :

<VirtualHost *:80>
    ServerName localhost
    DocumentRoot c:/wamp/www
    <Directory  "c:/wamp/www/">
        Options +Indexes +FollowSymLinks +MultiViews
        AllowOverride All
        Require local
    </Directory>
</VirtualHost>

Require local may be the reason for the lock as well (remember before removing anything do a backup).

Documentation: link

    
28.10.2016 / 19:00
2

Open the command prompt in administrative mode and run:

netstat -np TCP | find ":80"

The IPs on the left are your local IP. The above command will return tens or hundreds of results if you are browsing or with something connected to the internet.

A quick way to filter and get the point is to put your IP in the command

Example, if your IP is 192.168.1.10

netstat -abnop TCP | find "192.168.1.10:80"

This will return empty if there is nothing.

If you have something, it will return:

TCP    192.xx    192.xx    ESTABLISHED    4444

The last number is the PID of the process in question.

To find out the name of the process:

tasklist /fi "pid eq 4444"

Return:

Image Name      PID      Session Name    Session#     Mem Usage
processo.exe    4444     nome_sessao     2            10k

So you get the name of the program that is occupying the port you want, in this case port 80.

Two programs can not occupy the same port.

If you want Apache on this port that is in use, you should either stop the other program or switch it to another port.

Note: Your question still seems confusing because the error message for when the port is in use is different from the message that is in the question.

The message is usually related to the read and write permission of a particular physical location.

    
28.10.2016 / 17:54