Oily Rag 1: CD Part 1: Difference between revisions

m
Reverted edits by Upazixorys (Talk); changed back to last version by Ric
No edit summary
m (Reverted edits by Upazixorys (Talk); changed back to last version by Ric)
 
Line 1: Line 1:
=[http://olitudyxej.co.cc Page Is Unavailable Due To Site Maintenance, Please Visit Reserve Copy Page]=
{{Uc nav oily rag 1 CD}}
{{Uc nav oily rag 1 CD}}
'''Uniform Server 3.5-Apollo running from a CD'''
'''Uniform Server 3.5-Apollo running from a CD'''
Line 37: Line 36:
Make the following changes to '''httpd.conf''' located in '''*\udrive\usr\local\apache2\conf''' first save the original to folder (Uniform Server/uscd) and name it old_httpd.conf.
Make the following changes to '''httpd.conf''' located in '''*\udrive\usr\local\apache2\conf''' first save the original to folder (Uniform Server/uscd) and name it old_httpd.conf.


{|cellpadding="4" cellspacing="1" style="background:#222222"
{|cellpadding="4" cellspacing="1" style="background:#222222"
|-style="background:#cccccc"
|-style="background:#cccccc"
!Line
!Line
!Action
!Action
!Comment
!Comment
|-style="background:#e6e6e6"
|-style="background:#e6e6e6"
|valign="top"|
|valign="top"|
83
83
|align="right"|
|align="right"|
Change from:<br>
Change from:<br>
To:
To:
|
|
PidFile logs/httpd.pid&lt;br&gt;
PidFile logs/httpd.pid<br>
'''PidFile c:/us35temp/apache/logs/httpd.pid'''
'''PidFile c:/us35temp/apache/logs/httpd.pid'''
|-style=&quot;background:#f5f5f5&quot;
|-style="background:#f5f5f5"
|valign=&quot;top&quot;|
|valign="top"|
457
457
|align=&quot;right&quot;|
|align="right"|
Change from:&lt;br&gt;
Change from:<br>
To:
To:
|
|
ErrorLog logs/error.log&lt;br&gt;
ErrorLog logs/error.log<br>
'''ErrorLog c:/us35temp/apache/logs/error.log'''
'''ErrorLog c:/us35temp/apache/logs/error.log'''
|-style=&quot;background:#e6e6e6&quot;
|-style="background:#e6e6e6"
|valign=&quot;top&quot;|
|valign="top"|
483
483
|align=&quot;right&quot;|
|align="right"|
Change from:&lt;br&gt;
Change from:<br>
To:
To:
|
|
CustomLog logs/access.log combined&lt;br&gt;
CustomLog logs/access.log combined<br>
'''#CustomLog logs/access.log combined'''
'''#CustomLog logs/access.log combined'''
|}
|}
Line 86: Line 85:
'''''Note'':''' The chances are you will not see the file extension .cnf, don’t worry about it, for some reason Windows likes to hide this.
'''''Note'':''' The chances are you will not see the file extension .cnf, don’t worry about it, for some reason Windows likes to hide this.


{|cellpadding=&quot;4&quot; cellspacing=&quot;1&quot; style=&quot;background:#222222&quot;
{|cellpadding="4" cellspacing="1" style="background:#222222"
|-style=&quot;background:#cccccc&quot;
|-style="background:#cccccc"
!Line
!Line
!Action
!Action
!Comment
!Comment
|-style=&quot;background:#e6e6e6&quot;
|-style="background:#e6e6e6"
|valign=&quot;top&quot;|
|valign="top"|
35
35
|align=&quot;right&quot;|
|align="right"|
Change from:&lt;br&gt;
Change from:<br>
To:
To:
|
|
datadir = &quot;/usr/local/mysql/data/&quot;&lt;br&gt;
datadir = "/usr/local/mysql/data/"<br>
'''datadir = &quot;c:/us35temp/mysql/data/&quot;'''
'''datadir = "c:/us35temp/mysql/data/"'''
|-style=&quot;background:#f5f5f5&quot;
|-style="background:#f5f5f5"
|valign=&quot;top&quot;|
|valign="top"|
36
36
|align=&quot;right&quot;|
|align="right"|
Change from:&lt;br&gt;
Change from:<br>
To:
To:
|
|
tmpdir = &quot;/tmp&quot;&lt;br&gt;
tmpdir = "/tmp"<br>
'''tmpdir = &quot;c:/us35temp/mysql/tmp&quot;'''
'''tmpdir = "c:/us35temp/mysql/tmp"'''
|}
|}
After making the changes copy my-small.cnf to folder (Uniform Server/uscd) and name it '''new_my-small.cnf'''
After making the changes copy my-small.cnf to folder (Uniform Server/uscd) and name it '''new_my-small.cnf'''
Line 118: Line 117:
Make the following changes to '''php.ini''' located in '''*\udrive\usr\local\php''' first save the original to folder (Uniform Server/uscd) and name it old_php.ini.
Make the following changes to '''php.ini''' located in '''*\udrive\usr\local\php''' first save the original to folder (Uniform Server/uscd) and name it old_php.ini.


{|cellpadding=&quot;4&quot; cellspacing=&quot;1&quot; style=&quot;background:#222222&quot;
{|cellpadding="4" cellspacing="1" style="background:#222222"
|-style=&quot;background:#cccccc&quot;
|-style="background:#cccccc"
!Line
!Line
!Action
!Action
!Comment
!Comment
|-style=&quot;background:#e6e6e6&quot;
|-style="background:#e6e6e6"
|valign=&quot;top&quot;|
|valign="top"|
348
348
|align=&quot;right&quot;|
|align="right"|
Change from:&lt;br&gt;
Change from:<br>
To:
To:
|
|
error_log = logs/logs.log&lt;br&gt;
error_log = logs/logs.log<br>
'''error_log = c:/us35temp/php/logs/logs.log'''
'''error_log = c:/us35temp/php/logs/logs.log'''
|-style=&quot;background:#f5f5f5&quot;
|-style="background:#f5f5f5"
|valign=&quot;top&quot;|
|valign="top"|
499
499
|align=&quot;right&quot;|
|align="right"|
Change from:&lt;br&gt;
Change from:<br>
To:
To:
|
|
upload_tmp_dir = /tmp&lt;br&gt;
upload_tmp_dir = /tmp<br>
'''upload_tmp_dir = c:/us35temp/php/tmp'''
'''upload_tmp_dir = c:/us35temp/php/tmp'''
|-style=&quot;background:#e6e6e6&quot;
|-style="background:#e6e6e6"
|valign=&quot;top&quot;|
|valign="top"|
884
884
|align=&quot;right&quot;|
|align="right"|
Change from:&lt;br&gt;
Change from:<br>
To:
To:
|
|
session.save_path = &quot;/tmp&quot;&lt;br&gt;
session.save_path = "/tmp"<br>
'''session.save_path = &quot;c:/us35temp/php/tmp&quot;'''
'''session.save_path = "c:/us35temp/php/tmp"'''
|}
|}
After making the changes copy php.ini to folder (Uniform Server/uscd) and name it '''new_php.ini'''
After making the changes copy php.ini to folder (Uniform Server/uscd) and name it '''new_php.ini'''
Line 159: Line 158:
Make the following changes to '''config.inc.php''' located in '''*\udrive\home\admin\www\phpMyAdmin''' first save the original to folder (Uniform Server/uscd) and name it old_config.inc.php .
Make the following changes to '''config.inc.php''' located in '''*\udrive\home\admin\www\phpMyAdmin''' first save the original to folder (Uniform Server/uscd) and name it old_config.inc.php .


{|cellpadding=&quot;4&quot; cellspacing=&quot;1&quot; style=&quot;background:#222222&quot;
{|cellpadding="4" cellspacing="1" style="background:#222222"
|-style=&quot;background:#cccccc&quot;
|-style="background:#cccccc"
!Line
!Line
!Action
!Action
!Comment
!Comment
|-style=&quot;background:#e6e6e6&quot;
|-style="background:#e6e6e6"
|valign=&quot;top&quot;|
|valign="top"|
449
449
|align=&quot;right&quot;|
|align="right"|
Change from:&lt;br&gt;
Change from:<br>
To:
To:
|
|
$cfg['UploadDir'] = '/etc/phpmyadmin'; &lt;br&gt;
$cfg['UploadDir'] = '/etc/phpmyadmin'; <br>
'''$cfg['UploadDir'] = 'c:/us35temp/phpmyadmin/etc/phpmyadmin';'''
'''$cfg['UploadDir'] = 'c:/us35temp/phpmyadmin/etc/phpmyadmin';'''
|-style=&quot;background:#f5f5f5&quot;
|-style="background:#f5f5f5"
|valign=&quot;top&quot;|
|valign="top"|
452
452
|align=&quot;right&quot;|
|align="right"|
Change from:&lt;br&gt;
Change from:<br>
To:
To:
|
|
$cfg['SaveDir'] = '/etc/phpmyadmin';&lt;br&gt;
$cfg['SaveDir'] = '/etc/phpmyadmin';<br>
$cfg['SaveDir'] = 'c:/us35temp/phpmyadmin/etc/phpmyadmin';  
$cfg['SaveDir'] = 'c:/us35temp/phpmyadmin/etc/phpmyadmin';  
|-style=&quot;background:#e6e6e6&quot;
|-style="background:#e6e6e6"
|valign=&quot;top&quot;|
|valign="top"|
458
458
|align=&quot;right&quot;|
|align="right"|
Change from:&lt;br&gt;
Change from:<br>
To:
To:
|
|
$cfg['TempDir'] = '/tmp';&lt;br&gt;
$cfg['TempDir'] = '/tmp';<br>
'''$cfg['TempDir'] = 'c:/us35temp/phpmyadmin/tmp';'''  
'''$cfg['TempDir'] = 'c:/us35temp/phpmyadmin/tmp';'''  
|}
|}
Line 201: Line 200:
Obviously no changes are required for standard operation however some modification are needed to run from a CD. When run; our new Server_Start.bat needs to perform some additional tasks:
Obviously no changes are required for standard operation however some modification are needed to run from a CD. When run; our new Server_Start.bat needs to perform some additional tasks:


:* '''Create''' folder c:\us35temp and any sub-folders&lt;br&gt;
:* '''Create''' folder c:\us35temp and any sub-folders<br>
:: (This caters for both MySQL and Apache, Apache needs nothing else it will happily create the necessary files here)
:: (This caters for both MySQL and Apache, Apache needs nothing else it will happily create the necessary files here)


:* '''Copy''' the entire data (database) from MySQL&lt;br&gt;
:* '''Copy''' the entire data (database) from MySQL<br>
:: (The only thing of importance files copied from a CD will have their read attribute set to avoid this potential problem use xcopy.)
:: (The only thing of importance files copied from a CD will have their read attribute set to avoid this potential problem use xcopy.)


Line 214: Line 213:
Below I have provided a detailed description of the new commands added to Server_Start.bat. These are placed towards the top of the file.  
Below I have provided a detailed description of the new commands added to Server_Start.bat. These are placed towards the top of the file.  


{|cellspacing=&quot;0&quot; cellpadding=&quot;4&quot;
{|cellspacing="0" cellpadding="4"
|-style=&quot;background:#f5f5f5&quot;
|-style="background:#f5f5f5"
|set ustemp=c:\us35temp
|set ustemp=c:\us35temp
|Using the '''set''' command a variable '''ustemp''' is created its value is the complete path c:\us35temp to our temporary file on the c drive. To use this variable in a batch file it is contained between two % symbols.
|Using the '''set''' command a variable '''ustemp''' is created its value is the complete path c:\us35temp to our temporary file on the c drive. To use this variable in a batch file it is contained between two % symbols.
|-style=&quot;background:#e6e6e6&quot;
|-style="background:#e6e6e6"
|IF NOT EXIST %ustemp% md %ustemp%
|IF NOT EXIST %ustemp% md %ustemp%
|When the batch file is run it checks to see '''if''' the folder already '''exist'''s on the c drive if not it '''m'''akes a ''d'''rive (folder) defined by our variable %ustemp%
|When the batch file is run it checks to see '''if''' the folder already '''exist'''s on the c drive if not it '''m'''akes a ''d'''rive (folder) defined by our variable %ustemp%
|-style=&quot;background:#f5f5f5&quot;
|-style="background:#f5f5f5"
|IF NOT EXIST %ustemp% goto :ABORT
|IF NOT EXIST %ustemp% goto :ABORT
|Because this folder is so important we check to see if it was created. If it does not exist we jump to the line  named :ABORT and start running  code from there. If it exists continue to execute next line of code.
|Because this folder is so important we check to see if it was created. If it does not exist we jump to the line  named :ABORT and start running  code from there. If it exists continue to execute next line of code.
|-style=&quot;background:#e6e6e6&quot;
|-style="background:#e6e6e6"
|Several sub-folders are now created.
|Several sub-folders are now created.
|For sub-folders the process is similar, create and check.
|For sub-folders the process is similar, create and check.
|-style=&quot;background:#f5f5f5&quot;
|-style="background:#f5f5f5"
|XCOPY&amp;nbsp;&quot;%CD%\udrive\usr\local\mysql\data&quot;&amp;nbsp;%ustemp%\data\&amp;nbsp;/s&amp;nbsp;/q&lt;br&gt;&lt;br&gt;Note: Any path that contains a space '''MUST''' be enclosed in quotes.
|XCOPY&nbsp;"%CD%\udrive\usr\local\mysql\data"&nbsp;%ustemp%\data\&nbsp;/s&nbsp;/q<br><br>Note: Any path that contains a space '''MUST''' be enclosed in quotes.
|XCOPY is a powerful command its general syntax is '''XCOPY&amp;nbsp;source&amp;nbsp;destination&amp;nbsp;switches'''&lt;br&gt;'''Source:''' We want to copy everything in the MySQL data folder, including sub-folders hence the switch&lt;strong&gt; /s&lt;/strong&gt; Windows likes to have a complete path (relative paths are a problem). This batch file can be placed anywhere, to find anywhere we use the variable '''%CD%''' current directory (folder) this is created automatically when this batch file is run. It's the complete path up to and including the folder name.
|XCOPY is a powerful command its general syntax is '''XCOPY&nbsp;source&nbsp;destination&nbsp;switches'''<br>'''Source:''' We want to copy everything in the MySQL data folder, including sub-folders hence the switch<strong> /s</strong> Windows likes to have a complete path (relative paths are a problem). This batch file can be placed anywhere, to find anywhere we use the variable '''%CD%''' current directory (folder) this is created automatically when this batch file is run. It's the complete path up to and including the folder name.


'''Destination:''' Complete path to the folder where the database is to be copied, %ustemp%\data\ gives '''c:\us35temp\data\''' without the ending back slash Windows can not decide if its a folder or file hence that back slash is needed.
'''Destination:''' Complete path to the folder where the database is to be copied, %ustemp%\data\ gives '''c:\us35temp\data\''' without the ending back slash Windows can not decide if its a folder or file hence that back slash is needed.


'''Switches:''' I have covered '''/s''' which forces all sub-folders and their content to be copied. Unless you like to see rows upon rows of commands flashing by make sure you add a '''/q''' switch this stands for quite mode and stops  all this unwanted information.
'''Switches:''' I have covered '''/s''' which forces all sub-folders and their content to be copied. Unless you like to see rows upon rows of commands flashing by make sure you add a '''/q''' switch this stands for quite mode and stops  all this unwanted information.
|-style=&quot;background:#f5f5f5&quot;
|-style="background:#f5f5f5"
|goto :CONTINUE
|goto :CONTINUE
|Jump pass the next few lines and resume at the line named :CONTINUE
|Jump pass the next few lines and resume at the line named :CONTINUE
|-style=&quot;background:#e6e6e6&quot;
|-style="background:#e6e6e6"
|:ABORT
|:ABORT
|A line or location where you can jump to using the &lt;strong&gt;go to&lt;/strong&gt; command in this case our  abort section, we found an  error so give up.
|A line or location where you can jump to using the <strong>go to</strong> command in this case our  abort section, we found an  error so give up.
|-style=&quot;background:#f5f5f5&quot;
|-style="background:#f5f5f5"
|echo Sorry the folder %ustemp% or one of its sub-folders could not be created.&lt;br&gt; echo Can not continue hence aborting&lt;br&gt;pause&lt;br&gt;EXIT
|echo Sorry the folder %ustemp% or one of its sub-folders could not be created.<br> echo Can not continue hence aborting<br>pause<br>EXIT
|A few lines that we echo back to a user informing why we are given up. To give that person a chance to read the message pause halts the program and waits for a key to be pressed. At that point the EXIT command is executed and the batch file terminates.
|A few lines that we echo back to a user informing why we are given up. To give that person a chance to read the message pause halts the program and waits for a key to be pressed. At that point the EXIT command is executed and the batch file terminates.
|-style=&quot;background:#e6e6e6&quot;
|-style="background:#e6e6e6"
|:CONTINUE
|:CONTINUE
|A line or location where you can jump to using the '''go to''' command in this case our new lines of code are complete and appear to be working hence continue to run Uniserver batch file
|A line or location where you can jump to using the '''go to''' command in this case our new lines of code are complete and appear to be working hence continue to run Uniserver batch file
Line 250: Line 249:
'''''[[#top | Top]]'''''
'''''[[#top | Top]]'''''
==== new_Server_Start.bat ====
==== new_Server_Start.bat ====
&lt;pre&gt;
<pre>
rem File Name: new_Server_Start.bat
rem File Name: new_Server_Start.bat
rem Location: Uniform Server
rem Location: Uniform Server
Line 310: Line 309:


:Copy complete database  
:Copy complete database  
XCOPY &quot;%CD%\udrive\usr\local\mysql\data&quot; %ustemp%\mysql\data\ /s /q
XCOPY "%CD%\udrive\usr\local\mysql\data" %ustemp%\mysql\data\ /s /q


goto :CONTINUE
goto :CONTINUE
Line 331: Line 330:
rem ### Apache not running. Check for drive letter if not set (%1) use default.
rem ### Apache not running. Check for drive letter if not set (%1) use default.
set Disk=%1
set Disk=%1
if &quot;%Disk%&quot;==&quot;&quot; set Disk=w
if "%Disk%"=="" set Disk=w


rem ### Create the virtual disk, if it fails go to Hint
rem ### Create the virtual disk, if it fails go to Hint
subst %Disk%: &quot;udrive&quot;
subst %Disk%: "udrive"
if errorlevel 1 goto :HINT
if errorlevel 1 goto :HINT


Line 352: Line 351:


rem ### Start Apache server
rem ### Start Apache server
start %programit%uniserv.exe &quot;%apacheit%&quot; &quot;%closeit%&quot;
start %programit%uniserv.exe "%apacheit%" "%closeit%"


rem ### Start Apanel
rem ### Start Apanel
Line 358: Line 357:


rem ### Start MySQL server - skip if requested not to start (%2)
rem ### Start MySQL server - skip if requested not to start (%2)
if &quot;%2&quot;==&quot;nomysql&quot; goto :NOMYSQL
if "%2"=="nomysql" goto :NOMYSQL
start \usr\local\mysql\bin\mysqld-opt.exe --defaults-file=/usr/local/mysql/bin/my-small.cnf
start \usr\local\mysql\bin\mysqld-opt.exe --defaults-file=/usr/local/mysql/bin/my-small.cnf
:NOMYSQL
:NOMYSQL


rem ### Does user want to run a command prompt, if not END  
rem ### Does user want to run a command prompt, if not END  
if &quot;%3&quot;==&quot;console&quot; goto :CONSOLE
if "%3"=="console" goto :CONSOLE
goto :END
goto :END


Line 391: Line 390:
rem restore original working directory
rem restore original working directory
popd
popd
&lt;/pre&gt;
</pre>


'''''[[#top | Top]]'''''
'''''[[#top | Top]]'''''
Line 404: Line 403:
Below I have provided a detailed description of the new commands added to Stop.bat. These are placed at the end of the file.
Below I have provided a detailed description of the new commands added to Stop.bat. These are placed at the end of the file.


{|cellpadding=&quot;4&quot; cellspacing=&quot;0&quot;
{|cellpadding="4" cellspacing="0"
|-style=&quot;background:#f5f5f5&quot;
|-style="background:#f5f5f5"
|ping -n 20 localhost &amp;gt; nul
|ping -n 20 localhost &gt; nul
|This line serves no other purpose than to introduce a delay. Our temporary folder cannot be deleted until process using it terminate. I have found no way of detecting when a process ends from a batch file and then continue to the next command. Hence this little kludge delays for a certain time in the hope the processes have terminated before attempting to delete the folder. A last resort is to run stop.bat again, not elegant but works. Results returned from ping are dumped to the black hole file named nul.
|This line serves no other purpose than to introduce a delay. Our temporary folder cannot be deleted until process using it terminate. I have found no way of detecting when a process ends from a batch file and then continue to the next command. Hence this little kludge delays for a certain time in the hope the processes have terminated before attempting to delete the folder. A last resort is to run stop.bat again, not elegant but works. Results returned from ping are dumped to the black hole file named nul.


'''-n count''' Number of echo requests to send
'''-n count''' Number of echo requests to send
|-style=&quot;background:#e6e6e6&quot;
|-style="background:#e6e6e6"
|RMDIR&amp;nbsp;/s&amp;nbsp;/q&amp;nbsp;c:\us35tempset
|RMDIR&nbsp;/s&nbsp;/q&nbsp;c:\us35tempset
|'''RMDIR''' Remove directory (deletes a named folder) we provide the full path to that folder.&lt;br&gt;'''Switches:''' There are two switches without '''/s''' you are requested to confirm each sub-folder deletion. Quite mode is enable by '''/q''' this prevents the display of every deletion.
|'''RMDIR''' Remove directory (deletes a named folder) we provide the full path to that folder.<br>'''Switches:''' There are two switches without '''/s''' you are requested to confirm each sub-folder deletion. Quite mode is enable by '''/q''' this prevents the display of every deletion.
|}
|}


'''''[[#top | Top]]'''''
'''''[[#top | Top]]'''''
==== new_Stop.bat ====
==== new_Stop.bat ====
&lt;pre&gt;
<pre>
rem File Name: new_Sop.bat
rem File Name: new_Sop.bat
rem Location: Uniform Server
rem Location: Uniform Server
Line 450: Line 449:
rem otherwise RMDIR fails and the bat must be re-run  
rem otherwise RMDIR fails and the bat must be re-run  
echo Please Wait removing files
echo Please Wait removing files
ping -n 15 localhost &gt; nul
ping -n 15 localhost > nul
:clean up remove dir
:clean up remove dir
RMDIR /s /q c:\us35temp
RMDIR /s /q c:\us35temp
Line 456: Line 455:
rem restore original working directory
rem restore original working directory
popd
popd
&lt;/pre&gt;
</pre>


'''''[[#top | Top]]'''''
'''''[[#top | Top]]'''''