Lokomotywa
Lokomotywa

Reputation: 2844

Apache Config variables

I have some difficulties to understand the apache variables described in here:

https://httpd.apache.org/docs/2.4/expr.html#vars

What I need to use in my directive:

  1. The IP of the webserver the apache is running on

  2. The IP of the client trying to access the server

  3. The URL (string) the client is trying to access

  4. Alternatively, a boolean telling me whether the current request is coming from the server itself


As far as I understand, REMOTE_ADDR must be the client's IP. But where is the Servers ID hidden? SERVER_ADDR does not exist...

Upvotes: 0

Views: 928

Answers (1)

hugomztl
hugomztl

Reputation: 113

  1. SERVER_ADDR depending if your server provide it, else try HTTP_HOST
  2. REMOTE_ADDR
  3. REQUEST_FILENAME/REQUEST_URI
  4. There is no native function provided by Apache doing that but I let you check this topic you may find what you looking for.

Upvotes: 1

Related Questions