I am trying to make my Apache server publicly accessible. I opened port 80 in my router and my windows firewall , It didn't work. my router ISP is disabled. When I check port , i find it closed. THIS IS MY APACHE CONFIGURATION (WHAT I CHANGED IN MY HTTPD FILE:
<Directory />
Options FollowSymLinks
AllowOverride None
Order allow,deny
allow from all
</Directory>
LoadModule rewrite_module modules/mod_rewrite.so
Is there any thing i should to solve this problem
THANKS IN ADVANCE
You need to configure port forwarding on your router in order to get all incoming traffic redirected to your local web server
Be sure you're using a static IP address when you added your pc server in your modem and you're using both TCP/UDP as an additional action to take care that we have connection access to all
Also be sure you're using Nat Port forwarding Not Port Mapping
and added your LAN IP not WAN IP
Some routers requires you to check a box to Enable Port forwarding after adding it
and I suggest you to check that now maybe you haven't noticed
Try programming a simple TCP or UDP server for open connection/listening test
otherwise try search and get one at GitHub or SourceForge then check port online with your Host IP Address while (listening)
But also take caution that you testing port for your specific protocol
If port is opened then the problem in your configuration and you have to re-read it backwards carefully
Else..then the problem in your router port forwarding configuration not in apache
and you have to check Lan-IP/Port-Start/End/Enabled etc..
If still having problems then please be more specific in your question and try
attaching screenshot of your port settings
Post your configuration
If you tried specific open source server program will be helpful to post the code
At the end i advice you to use Client/Server opensource script or program with a friend remotely
instead of checking online and that also if you have troubles finding one.
Try with this conf:
Name: local server
App name: HTTP
IP Address: 192.168.1.10 #your local server ip.
Port:
Start: 80
End: 80
Traffic Type: TCP
Related
As a newbie set up mediawiki in apache httpd on my linux pc. In the corresponding .conf file "require all granted'" is set. The pc was assigned static IP 192.168.0.2 by the router. The port 80 of the pc is opened for any device. I visited http://192.168.0.2/mediawiki/index.php from the host. It worked as expected. Now I tried to visit the same address from my android phone connected to the same network and I was presented with the message "127.0.0.1 refused to connect" by chrome. I noticed that the part http://192.168.0.2 had been replaced by https://127.0.0.1 in the address bar. The same thing also occurred on Firefox on my phone. I can still visit http://192.168.0.2 from my phone and it works just fine. So what is happening here and how to solve this problem?
EDIT: The problem is solved. Mediawiki has this LocalSettings.php file which gets automatically created during installation. It contains a field "$wgServer" which is the "The protocol and server name to use in fully-qualified URLs" as shown in the documentation. This value was automatically set to "http://127.0.0.1" during the installation. Thereby whenever I was trying to connect to mediawiki from my phone I was actually getting redirected to that same phone. I changed the value to "http://192.168.0.2" and now everything is working fine!
Looks like something happened at the connection from your mobile phone to the pc hosting the web server.
Your configuration looks fine even tho you provided almost no details at all: according to your description, I suspect the problem is on your phone or on your router because the domain and url switched from 192.168.0.2 to 127.0.0.1 and the protocol switched from http to https.
You should try the same test from another pc connected to the same network.
You can have a better understanding of what's happening, testing the connection from command line using curl:
$ curl -v http://192.168.0.2/mediawiki/index.php
The output will give you some details of what's going on if the redirect was requested by the webserver or not.
My guess is that your apache is configured to listen to 127.0.0.1 or localhost (it's the default). Open httpd.conf or your virtual host configuration file and look for Listen. Here's some snippets from the official documentation:
The Listen directive tells the server to accept incoming requests only on the specified port(s) or address-and-port combinations. If only a port number is specified in the Listen directive, the server listens to the given port on all interfaces. If an IP address is given as well as a port, the server will listen on the given port and interface. Multiple Listen directives may be used to specify a number of addresses and ports to listen on. The server will respond to requests from any of the listed addresses and ports.
For example, to make the server accept connections on both port 80 and port 8000, on all interfaces, use:
Listen 80
Listen 8000
To make the server accept connections on port 80 for one interface, and port 8000 on another, use
Listen 192.0.2.1:80
Listen 192.0.2.5:8000
More information at
https://httpd.apache.org/docs/2.4/bind.html
I have nginx running at port 80.
After installing apache2, I set its port to 82 (both in ports.conf and 000-default.conf).
I have tried opening the ip (i.e a.b.c.d:82) but its not opening. But if I set port to 80 and stop nginx then its opening.
I tried opening ip with the below format:
a.b.c.d:82
a.b.c.d - opening nginx site
I also tried setting dns to abc.mydomain.com and opened
abc.mydomain.com (opening nginx site)
abc.mydomain.com:82 (not opening anything)
How to access it using apache with some port other than 80 ?
Please let me know for more questions.
Thanks.
The discussion and investigation in the chat revealed that this actually was about a remote system, not a local development setup. That means that typically a package filter ("firewall") is in between client and sever. When using a non standard port for a "well known protocol" you need to open that port in the servers firewall for incoming traffic.
In this case using Ubuntu's ufw tool had been used to setup a simple package filter. Configuring the custom port 82 and allowing incoming traffic to it solved the issue at hand.
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.
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
You should replace the listen line as shown below:
Listen 0.0.0.0:80
Try:
sudo ufw allow from 192.168.1.5
I add Directory tag:
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
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.
in my case i work on nestjs and
previously i run my project on app.listen(3001) like this
first i change to this app.listen(3001,'192.168.xx.xx')
now i want to access my project on the another computer using ip on the network (LAN)
so it is now allow us to access any particular port after ip address
means if i access 192.198.xx.xx then i can access the address.
but if i append port like this 192.198.xx.xx:3001 then it not let me allow to access ip address so in this case i resolve my problem by run following cmd
sudo service ufw stop
sudo iptables -nvL
sudo iptables -nvL|less
sudo iptables -F
"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).
I'm using xampp as a testing host, but I want to be able to access it from anywhere. currently I can access it through localhost only, and through lan by typing my local ip, but not by typing my external ip from anywhere. I tried setting up apache vhosts, but I'm not sure what to put there, examples online aren't very clear, and I don't even know if it works. so if someone could give me a heads up, I'd appreciate!
Log into your router and set up port forwarding to your computer with xampp on it. You probably want to forward port 80 (default for http) to your computer's LAN IP. Then you should be able to access your xampp setup over the Internet by going to your external IP address.
first you need to make sure the incoming traffic on port 80 is not blocked by your firewall or ISP - see this video demo
then you need to configure your Router to forward:
incoming requests to your External IP port 80 towards your Internal IP port 80 - video demo here
and finally test if port open - see this demo
I installed Apache with WAMP. I want to make my computer as a server for my web page for make some experiment on my web site.But I can`t open my server in Internet. I can see it in http://localhost/mysite/index.html but when I try to reach it in another computer like http://myserverip/mysite/index.html it says server not responding. I am using wireless router and also forwarded to my LAN ip.
A few ideas:
check that apache is bound to your PC's internal IP rather than just localhost - run netstat -an and verify that you have local address 0.0.0.0:80 not 127.0.0.1:80
check that you're definitely forwarding port 80 from the router to your PC
check that you're not firewalling off the traffic, i.e. make sure there's an exception in the windows firewall for port 80 (and 443 if you're using HTTPS), or a program exception for httpd, or even try turning off the firewall temporarily whilst debugging this
find out if your ISP is blocking this - some won't let you run web servers from your home connection; you could try a different web port to see if that helps?
try connecting from some other machine - there could be some proxy configuration that's upsetting looping back into your PC