Cannot access to web server via local IP address o

2019-02-04 18:18发布

问题:

Recently I've install Ubuntu 12.10 on my dev machine. also I've installed apache 2.2 & Php 5.3.8 and Php 5.2.17 and MySQL. Everything works fine and I can browses my sites and projects via 127.0.0.1 & Localhost keyword and Hostname But I cannot access my sites or Apache web server via Local ip address (192.168.1.5). I run this model on Laptop with Ubuntu 11.10 and can access via 192.168.1.x.

Do you have any idea about this issue please let me to know your XP in this case ?

thanks a million about your patient... Farzam.

回答1:

Perhaps your Apache is bounded to localhost only. Look in your Apache configuration file (httpd.conf) for

Listen 127.0.0.1:80

and replace it with:

Listen 80

or

Listen *:80

Also check the Firewall settings, look for a the line below in the same file:

Allow from 127.0.0.1

and try changing it to:

Allow from all


回答2:

You should replace the listen line as shown below:

Listen 0.0.0.0:80



回答3:

Try:

sudo ufw allow from 192.168.1.5


回答4:

I add Directory tag:

                Options Indexes FollowSymLinks
                AllowOverride All
                Require all granted


回答5:

Windows Firewall did not have an exception for port 80. Somehow IIS worked fine, but would not allow Apache port 80. Even disabling the Windows Firewall Service did not allow it.

Search Windows for "Firewall" and Create a new rule. Choose Port, enter 80, Call it: HTTP or whatever, Save. Restart Apache service.



回答6:

"Windows Firewall did not have an exception for port 80. Somehow IIS worked fine, but would not allow Apache port 80. Even disabling the Windows Firewall Service did not allow it.

Search Windows for "Firewall" and Create a new rule. Choose Port, enter 80, Call it: HTTP or whatever, Save. Restart Apache service." - This worked for me. After I enabled the ports 8080 on the firewall on Win Server 2012 (I use port 8080).