Supporting legacy code, using global variables and register_globals with PHP 5.4.x

 Recently we ran into some issues with some of our old sites that are relying on the register_globals  for variable access after upgrading to PHP 5.4 which wisely no longer supports this kind of setup.  Using globals in this fashion  is a horrible practice, but sometimes you gotta maintain some legacy code. To use global variables you can add a line of code to htaccess that will run a “globalizer” file before loading the main page on every page load and extract the required variables. globalizer.php file <!--?php...

read more

Apache mod_status, which site uses which process and resources

 If you need detailed information about Apache processes and which site is using them. Edit your httpd_conf file, and change the following directives: <Location /secret-name-server-status> SetHandler server-status Order deny,allow Deny from none Allow from all </Location> You can set Allow from [specific IP address or range] for greater security Also change un-comment the # by removing the # character: ExtendedStatus On Then, go to Listen On directives, and add an unused port: Listen 4567 Save changes, restart apache...

read more

CentOS and Apache – password protect with .htaccess and .htpasswd

 To protect /stats sub-directory: Edit /home/.htpasswd file user:encryptedpassword Add .htaccess file to /home/usr/usrname/stats/.htaccess AuthUserFile /home/.htpasswd AuthGroupFile /dev/null AuthName EnterPassword AuthType Basic require user usrNAMEhere ===

read more