Config Apache Server to take an ip from an access point

Alles, was den Apache betrifft, kann hier besprochen werden.

Config Apache Server to take an ip from an access point

Postby baldhead » 29. June 2023 14:57

Hi,

I'm a newbie with config a Apache server to work. I installed xampp on my windows desktop and in ip 127.0.0.1 the installation is working. I have a wi-fi connection, only for local tests and i have a ethernet connection that have internet access. I put a usb-wireless adapter on it, and, this adapter connects to an access point that i have installed dd-wrt on it. The access point( AP ) is running a dhcp server on ip 192.168.1.1.

How i can configure the Apache web server to take an ip from this dhcp server on AP ?

I am required to use the same ip that my desktop got from the AP, or should I get a unique ip for the apache server ?

Thank's.
baldhead
 
Posts: 2
Joined: 29. June 2023 14:52
XAMPP version: 8.2.4 / PHP 8.2.4
Operating System: Windows 11

Re: Config Apache Server to take an ip from an access point

Postby Nobbie » 29. June 2023 22:20

Nothing to do. Enter the WLAN IP into your browser and Apache should answer. Per Default Apache "listens" to all IPs connected to the PC.
Nobbie
 
Posts: 13176
Joined: 09. March 2008 13:04

Re: Config Apache Server to take an ip from an access point

Postby baldhead » 30. June 2023 02:10

I want to access the apache server from a esp32 that will connect with the same access point.
I want to test a ota update in my only local wi-fi network.

I put a ip that my wi-fi adapter take from dhcp server, running on Access Point, and it worked:
Listen 192.168.1.201:80

How to setup apache server to listen on a dynamic taken ip address of a wi-fi network adapter on windows 11 ?

The ip is from a only local wi-fi access point that have a dhcp running on it (dd wrt installed).

I tried to configure like this, in httpd.conf file, but not worked:
Listen ip.address.of.Wi-Fi:80

Thank's.
baldhead
 
Posts: 2
Joined: 29. June 2023 14:52
XAMPP version: 8.2.4 / PHP 8.2.4
Operating System: Windows 11

Re: Config Apache Server to take an ip from an access point

Postby Altrea » 30. June 2023 09:30

Apache is not capable to do this. You can either configure Apache to listen on specific static IP adresses and ports, or on all available.
But Apache does not register its own network interface, and Apache can not be configured to just listen on the ip addresses of a specicif network interface.
the network interface needs to be provided by the operating system and apache cannot read out a dynamic ip address*

* Apache can resolve a hostname by DNS, but it produces more problem than helps
We don't provide any support via personal channels like PM, email, Skype, TeamViewer!

It's like porn for programmers 8)
User avatar
Altrea
AF Moderator
 
Posts: 11933
Joined: 17. August 2009 13:05
XAMPP version: several
Operating System: Windows 11 Pro x64

Re: Config Apache Server to take an ip from an access point

Postby Nobbie » 30. June 2023 11:36

As i said, Apache listens on ALL ip's and ports per default. To establish this behaviour, remove all LISTEN commands from your configuration. If you have any LISTEN in your config, Apache will listen only to that ip. You can have multiple LISTEN commands in your config, Apache will listen to each of them only. And (as already said) if you have none LISTEN commands, Apache will listen to all ip and all ports.

Apache cannot determine, which ip's are assigned to the network nodes of the PC. Either configure your Access Point to assign a fixed IP to the Apache Server, then you could enter the appropriate LISTEN to the Apache Config, or use dynamic IP via DHCP and do not specify any LISTEN to Apache. Using a fixed IP for the Apache Server is the way i use to go.

P.S.: If you dont want Apache to listen to ALL ports, but to to all IPs on Port 80, you may specify Port 80 only:

LISTEN 80

You can add another LISTEN for Port 443, if you need SSL:

LISTEN 80
LISTEN 443

Apache will then listen to all IPs on Port 80 and Port 443 only. That should be a proper configuration in your case.
Nobbie
 
Posts: 13176
Joined: 09. March 2008 13:04


Return to Apache

Who is online

Users browsing this forum: No registered users and 126 guests