krz/ifconfig.php

A private ifconfig service. networking php self-hosted utility

ifconfig.php

what

php script. shows your ip address, user agent, and related info. same idea as ifconfig.me and ifconfig.co.

output as html (default), plain text, xml, or json. single values on request.

use

live at ip.cmc.pub:
- ?q=text   all, plain text
- ?q=xml    all, xml
- ?q=ip     ip only
- ?q=ua     user agent only
curl -L -X GET https://ip.cmc.pub/\?q\=text

apache rewrite so /ifconfig/xml works without the query string:

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ifconfig$ ifconfig.php [L]
RewriteRule ^ifconfig/(.*)$ /ifconfig.php?q=$1 [L]

develop

install php and composer. fedora:

sudo dnf install php-cli composer

maxmind-db dependency:

composer require maxmind-db/reader:~1.0
composer update

geolite2 database. not in the repo: maxmind-licensed, ~69mb, and stale the day after you download it. sign up for a free maxmind account, then:

https://www.maxmind.com/en/accounts/current/geoip/downloads

download GeoLite2-City in mmdb form and put GeoLite2-City.mmdb next to ifconfig.php. without it the page still serves, minus the geo block.

dev server:

sudo php --server localhost:8080 --docroot .

About

PHP 77.9%Org 22.1%

3 contributorscmcSergey BriskinSergey Briskin

Clone

SSH
git clone ssh://git@gitbay.org/krz/ifconfig.php.git
HTTPS
git clone https://gitbay.org/krz/ifconfig.php.git