Sysadmin papilusion apache2 11 01 2012 - Seizam/seizamcore GitHub Wiki

Table of Contents

What is the behaviour ?

  • When Apache handle a request to papilusion.seizam.com or papilusion.reverse.seizam.com:
    • doc root is /var/seizam/w
    • Alias /files /var/seizam/files
    • Alias /icons/ /usr/share/apache2/icons/
    • Alias /payment /var/seizam/payment
    • Alias /extensions /var/seizam/w/extensions
    • Alias /resources /var/seizam/w/resources
    • Alias /skins /var/seizam/w/skins
    • Alias /robots.txt /var/seizam/w/robots.txt
    • Alias /favicon.ico /var/seizam/w/favicon.ico
    • Alias /img_auth.php /var/seizam/w/img_auth.php/
    • Alias /load.php /var/seizam/w/load.php/
    • Alias /api.php /var/seizam/w/api.php/
    • Alias / /var/seizam/w/index.php/
    • Access to /files is public, put /files/private require a username and password from /var/seizam/files/private/.htpasswd
    • PHP can handle 10 minutes execution time and 200 MB max for file uploads
  • When Apache handle a request to locahost:
    • / display some system informations using phpsysinfo (installed in /usr/share/phpsysinfo)
    • /phpmyadmin (you need a password)
    • /apc to display some APC state informations (this is the default apc.php bundled with APC doc, you need a password to access to User Cache Entries tab)
    • /phpinfo to execute and display result of phpinfo(); PHP command
    • these 4 tools are only accessible if the connection comes from 127.0.0.1
    • from your remote terminal, you can access them by using SSH port forwarding: ssh -L 8080:localhost:80 papilusion.seizam.com
  • Other request:
    • doc root is /var/www
    • currently, this is a HTML page redirecting to www.seizam.com

How did we configure that?

Many steps have been done before. Please refer to previous sysadmin reports about apache, phpmyadmin and apc viewer tool

Session

  • user : root
  • host : papilusion.reverse.seizam.com
  • date : 11/01/12 10:36
  • curpath : /root

Commands

Files

[1]\* Edit /etc/apache2/conf.d/security

--- old	2012-01-11 11:03:53.000000000 +0100
+++ new	2012-01-11 11:05:39.000000000 +0100
@@ -25,4 +25,4 @@
 #
-#ServerTokens Minimal
-ServerTokens OS
+ServerTokens Minimal
+#ServerTokens OS
 #ServerTokens Full
@@ -37,4 +37,4 @@
 #
-#ServerSignature Off
-ServerSignature On
+ServerSignature Off
+#ServerSignature On
 

[2]\* Edit /etc/apache2/sites-enabled/010-localhost-admin-tools

--- old	2012-01-11 12:59:37.000000000 +0100
+++ new	2012-01-11 13:02:08.000000000 +0100
@@ -69,2 +69,18 @@
 
+
+	# PHPINFO
+	# -------
+
+	Alias /phpinfo /usr/share/phpinfo/phpinfo.php
+
+        <Directory /usr/share/phpinfo>
+                Options none
+                DirectoryIndex phpinfo.php
+
+                Order deny,allow
+                Deny from all
+                Allow from 127.0.0.1
+        </directory>
+
+
 </virtualhost>

[3]\* Edit /usr/share/phpinfo/phpinfo.php

--- old	2012-01-11 13:03:14.000000000 +0100
+++ new	2012-01-11 13:03:34.000000000 +0100
@@ -0,0 +1 @@
+<?php phpinfo(); ?>

[4]\* Edit /usr/share/php-apc/apc.php

--- old	2012-01-11 13:36:22.000000000 +0100
+++ new	2012-01-11 13:37:00.000000000 +0100
@@ -40,4 +40,4 @@
 											//  this work!
-defaults('ADMIN_USERNAME','apc'); 			// Admin Username
-defaults('ADMIN_PASSWORD','password');  	// Admin Password - CHANGE THIS TO ENABLE!!!
+defaults('ADMIN_USERNAME','root'); 			// Admin Username
+defaults('ADMIN_PASSWORD','????????');  	// Admin Password - CHANGE THIS TO ENABLE!!!
 

[5]\* Edit /usr/share/phpsysinfo/config.php

--- old	2012-01-11 15:17:57.000000000 +0100
+++ new	2012-01-11 15:21:51.000000000 +0100
@@ -97,3 +97,3 @@
  */
-define('PSI_REFRESH', 60000);
+define('PSI_REFRESH', 0);
 
@@ -130,3 +130,3 @@
  */
-define('PSI_BYTE_FORMAT', 'auto_binary');
+define('PSI_BYTE_FORMAT', 'auto_decimal');
 
@@ -210,3 +210,3 @@
  */
-define('PSI_SHOW_MOUNT_CREDENTIALS', false);
+define('PSI_SHOW_MOUNT_CREDENTIALS', true);

@@ -246,3 +246,3 @@
  */
-define('PSI_HIDE_NETWORK_INTERFACE', '');
+define('PSI_HIDE_NETWORK_INTERFACE', 'eth0');

[6]\* Edit /etc/apache2/sites-enabled/010-localhost-admin-tools

--- old	2012-01-11 15:22:18.000000000 +0100
+++ new	2012-01-11 15:24:30.000000000 +0100
@@ -4,2 +4,20 @@
 
+
+
+	# PHPSYSINFO
+	# ----------
+
+	DocumentRoot /usr/share/phpsysinfo
+
+        <Directory /usr/share/phpsysinfo>
+                Options none
+                DirectoryIndex index.php
+
+                Order deny,allow
+                Deny from all
+                Allow from 127.0.0.1
+        </directory>
+
+
+
 	# PHPMYADMIN

 

[7]\* Edit /usr/share/phpsysinfo/includes/os/class.Linux.inc.php

--- old	2012-01-11 15:41:15.000000000 +0100
+++ new	2012-01-11 15:42:16.000000000 +0100
@@ -575,3 +575,3 @@
         $this->_usb();
-        $this->_network();
+//        $this->_network();
         $this->_memory();
⚠️ **GitHub.com Fallback** ⚠️