[Clipart] [PATCH] cchost ccadmin/index.php

Bryce Harrington bryce at bryceharrington.org
Sat Feb 11 13:57:58 PST 2006


Hi Jon,

Here's a patch to the install script.  I adjusted some of the settings
to be written more consistently, and added some to the documentation and
comments, as there were a couple areas I found confusing.

Bryce

--- cchost-1.0.3/ccadmin/index.php	2006-02-11 12:17:03.000000000 -0800
+++ cchost-bwh/ccadmin-hidden/index.php	2006-02-11 13:16:21.000000000 -0800
@@ -118,8 +118,13 @@
 
     <h2>Securing the Site</h2>
 
-    <p>You must rename the <b>/ccadmin</b> subdirectory in order to secure the site from unauthorized usage. ccHost 
-    won't run until you do this.</p>
+    <p>You must rename the <b>/ccadmin</b> subdirectory and change its
+    access permissions in order to secure the site from unauthorized usage. ccHost 
+    won't run until you do this.  For example:</p>
+    <pre>
+    mv cchost/ccadmin cchost/ccadmin-hidden
+    chmod 700 cchost/ccadmin-hidden
+    </pre>
 
     <h2>Go forth...</h2>
 
@@ -147,7 +152,7 @@
     $v['file_uploads']['i'] = ' ';
 
     $v['upload_max_filesize']['v'] = ini_get('upload_max_filesize');
-    $v['upload_max_filesize']['s'] = '10';
+    $v['upload_max_filesize']['s'] = '10M';
     $v['upload_max_filesize']['m'] = 'Determines the overall maxium file upload size. (Typical MP3 song is encoded at 1M per minute.)';
     preg_match('/([0-9]*)/',$v['upload_max_filesize']['v'],$m);
     $i = intval($m[1]);
@@ -155,7 +160,7 @@
     $v['upload_max_filesize']['k'] = $i < 10 ? false : true;
 
     $v['post_max_size']['v'] = ini_get('post_max_size');
-    $v['post_max_size']['s'] = '10';
+    $v['post_max_size']['s'] = '10M';
     $v['post_max_size']['m'] = 'Determines the maxium file upload size from an HTML form.';
     preg_match('/([0-9]*)/',$v['post_max_size']['v'],$m);
     $i = intval($m[1]);
@@ -198,7 +203,9 @@
     <p>There are several things you should know about uploading files to a PHP environment.</p>
     <p>The default settings for a PHP install may not be the ideal. A list of all PHP settings, where they can
     be changed and what version they apply to can be found <a href="http://us3.php.net/manual/en/ini.php#ini.list">here</a>.</p>
-    <p>Below are some settings you should be aware of. You might want to print or save this page for future reference.</p>
+    <p>Below are some settings you should be aware of. You might want to
+    print or save this page for future reference.  These can be updated
+    in your php.ini file; on gentoo this is located at: /etc/php/apache2-php4/php.ini</p>
 
     <table class="ini_table">
     <tr><th>Setting Name</th><th>Description</th><th>Current<br />Value</th><th>Suggested<br />Value</th></tr>
@@ -398,7 +405,7 @@
 
             if( !$link )
             {
-                $f['dbuser']['e'] = 'MySQL Error: ' . mysql_error();
+                $f['dbuser']['e'] = 'MySQL Error: ' . mysql_error() . " for CONNECT";
                 $ok = false;
             }
         }
@@ -408,7 +415,7 @@
     {
         if( !@mysql_select_db($f['database']['v']) )
         {
-            $f['database']['e'] = "MySQL Error: " . mysql_error();
+            $f['database']['e'] = "MySQL Error: " . mysql_error() . " for SELECT";
             $ok = false;
         }
         else
@@ -416,7 +423,7 @@
             if( !mysql_query("CREATE TABLE table_test ( test_column int(1) )") )
             {
                 $ok = false;
-                $f['database']['e'] = "MySQL Error: " . mysql_error();
+                $f['database']['e'] = "MySQL Error: " . mysql_error() . " for CREATE.";
             }
             else
             {
@@ -499,12 +506,15 @@
 In order to enable Rewrite rules ('pretty URLs') you must include the following lines
 in your Apache configuration (virtual host or .htaccess):
 <div style="text-align:left;white-space:pre;font-family:Courier New, courier, serif;font-size:smaller;">
-RewriteEngine On
-RewriteBase $sbase
-RewriteCond %{REQUEST_FILENAME} !-d
-RewriteCond %{REQUEST_FILENAME} !-f
-RewriteRule ^(.*)$ /index.php?ccm=/$1 [L,QSA]
+<Directory "/var/www/localhost/htdocs/cchost">
+  RewriteEngine On
+  RewriteBase $sbase
+  RewriteCond %{REQUEST_FILENAME} !-d
+  RewriteCond %{REQUEST_FILENAME} !-f
+  RewriteRule ^(.*)$ /index.php?ccm=/$1 [L,QSA]
+</Directory>
 </div>
+You'll need to restart apache in order for these settings to take effect.
 END;
         // n - Name
         // t - Input type (see print_install_form())
@@ -547,10 +557,11 @@
         'h' => 'Almost always \'localhost\'' ),
 
     'logfile_dir' => array( 'n' => 'Path to ccHost logfiles',      'e' => '', 't'  => 'text', 'v' => '' , 'q' => 0,
-        'h' => 'Where should ccHost write log files to? (e.g. \'../outofsight\')' ),
+        'h' => 'Where should ccHost write log files to? (e.g. \'/var/log/cchost\')' ),
 
     'getid3'      => array( 'n' => 'Path to GetID3',         'e' => '', 't'  => 'text', 'v' => '' , 'q' => 0,
-        'h' => 'Root directory of GetID3 Library (the one with getid3.php in it)' ),
+        'h' => 'Root directory of GetID3 Library (the one with
+        getid3.php in it, e.g. \'/var/www/localhost/htdocs/cchost/getid3\')' ),
 
     'cookiedom'   => array( 'n' => 'Cookie Domain',          'e' => '', 't'  => 'text', 'v' => '' , 'q' => 0,
         'h' => 'Leaving this blank is fine (and may be necessary in some configurations'),



More information about the clipart mailing list