Code

How to Check mod_rewrite Module in Apache/LiteSpeed is Loaded

To check if mod_rewrite Module is loaded in Apache/LiteSpeed follow the following steps

1. For system with cPanel, log to SSH in issue the following commands

/usr/local/apache/bin/httpd -D DUMP_MODULES | grep rewrite

If it return the following, then mod_rewrite is loaded

Syntax OK
rewrite_module (static)

2. For system with no cPanel, check “httpd.conf” file. If the following is in the file then it should be loaded.

LoadModule rewrite_module libexec/apache2/mod_rewrite.so

PHP Code to Display Server IP Address

Use the following code if you want to display Server IP Address. Simply copy the code in text file & save as .php file in the server.

For Linux with Apache/Litespeed Server use

<?php
echo $_SERVER['SERVER_ADDR'];
?>

For Windows 2008 R2 with IIS 7.5 Server use

<?php
echo $_SERVER['LOCAL_ADDR'];
?>