Oily Rag 1: CD Part 1: Difference between revisions

no edit summary
(New page: {{Uc nav oily rag 1 CD}} '''Uniform Server 3.5-Apollo running from a CD''' Uniform Server’s architecture allows it to be run without making any changes from any location on any '''read/...)
 
No edit summary
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 36: Line 37:
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:&lt;br&gt;
To:
To:
|
|
PidFile logs/httpd.pid<br>
PidFile logs/httpd.pid&lt;br&gt;
'''PidFile c:/us35temp/apache/logs/httpd.pid'''
'''PidFile c:/us35temp/apache/logs/httpd.pid'''
|-style="background:#f5f5f5"
|-style=&quot;background:#f5f5f5&quot;
|valign="top"|
|valign=&quot;top&quot;|
457
457
|align="right"|
|align=&quot;right&quot;|
Change from:<br>
Change from:&lt;br&gt;
To:
To:
|
|
ErrorLog logs/error.log<br>
ErrorLog logs/error.log&lt;br&gt;
'''ErrorLog c:/us35temp/apache/logs/error.log'''
'''ErrorLog c:/us35temp/apache/logs/error.log'''
|-style="background:#e6e6e6"
|-style=&quot;background:#e6e6e6&quot;
|valign="top"|
|valign=&quot;top&quot;|
483
483
|align="right"|
|align=&quot;right&quot;|
Change from:<br>
Change from:&lt;br&gt;
To:
To:
|
|
CustomLog logs/access.log combined<br>
CustomLog logs/access.log combined&lt;br&gt;
'''#CustomLog logs/access.log combined'''
'''#CustomLog logs/access.log combined'''
|}
|}
Line 85: Line 86:
'''''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="4" cellspacing="1" style="background:#222222"
{|cellpadding=&quot;4&quot; cellspacing=&quot;1&quot; style=&quot;background:#222222&quot;
|-style="background:#cccccc"
|-style=&quot;background:#cccccc&quot;
!Line
!Line
!Action
!Action
!Comment
!Comment
|-style="background:#e6e6e6"
|-style=&quot;background:#e6e6e6&quot;
|valign="top"|
|valign=&quot;top&quot;|
35
35
|align="right"|
|align=&quot;right&quot;|
Change from:<br>
Change from:&lt;br&gt;
To:
To:
|
|
datadir = "/usr/local/mysql/data/"<br>
datadir = &quot;/usr/local/mysql/data/&quot;&lt;br&gt;
'''datadir = "c:/us35temp/mysql/data/"'''
'''datadir = &quot;c:/us35temp/mysql/data/&quot;'''
|-style="background:#f5f5f5"
|-style=&quot;background:#f5f5f5&quot;
|valign="top"|
|valign=&quot;top&quot;|
36
36
|align="right"|
|align=&quot;right&quot;|
Change from:<br>
Change from:&lt;br&gt;
To:
To:
|
|
tmpdir = "/tmp"<br>
tmpdir = &quot;/tmp&quot;&lt;br&gt;
'''tmpdir = "c:/us35temp/mysql/tmp"'''
'''tmpdir = &quot;c:/us35temp/mysql/tmp&quot;'''
|}
|}
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 117: Line 118:
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="4" cellspacing="1" style="background:#222222"
{|cellpadding=&quot;4&quot; cellspacing=&quot;1&quot; style=&quot;background:#222222&quot;
|-style="background:#cccccc"
|-style=&quot;background:#cccccc&quot;
!Line
!Line
!Action
!Action
!Comment
!Comment
|-style="background:#e6e6e6"
|-style=&quot;background:#e6e6e6&quot;
|valign="top"|
|valign=&quot;top&quot;|
348
348
|align="right"|
|align=&quot;right&quot;|
Change from:<br>
Change from:&lt;br&gt;
To:
To:
|
|
error_log = logs/logs.log<br>
error_log = logs/logs.log&lt;br&gt;
'''error_log = c:/us35temp/php/logs/logs.log'''
'''error_log = c:/us35temp/php/logs/logs.log'''
|-style="background:#f5f5f5"
|-style=&quot;background:#f5f5f5&quot;
|valign="top"|
|valign=&quot;top&quot;|
499
499
|align="right"|
|align=&quot;right&quot;|
Change from:<br>
Change from:&lt;br&gt;
To:
To:
|
|
upload_tmp_dir = /tmp<br>
upload_tmp_dir = /tmp&lt;br&gt;
'''upload_tmp_dir = c:/us35temp/php/tmp'''
'''upload_tmp_dir = c:/us35temp/php/tmp'''
|-style="background:#e6e6e6"
|-style=&quot;background:#e6e6e6&quot;
|valign="top"|
|valign=&quot;top&quot;|
884
884
|align="right"|
|align=&quot;right&quot;|
Change from:<br>
Change from:&lt;br&gt;
To:
To:
|
|
session.save_path = "/tmp"<br>
session.save_path = &quot;/tmp&quot;&lt;br&gt;
'''session.save_path = "c:/us35temp/php/tmp"'''
'''session.save_path = &quot;c:/us35temp/php/tmp&quot;'''
|}
|}
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 158: Line 159:
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="4" cellspacing="1" style="background:#222222"
{|cellpadding=&quot;4&quot; cellspacing=&quot;1&quot; style=&quot;background:#222222&quot;
|-style="background:#cccccc"
|-style=&quot;background:#cccccc&quot;
!Line
!Line
!Action
!Action
!Comment
!Comment
|-style="background:#e6e6e6"
|-style=&quot;background:#e6e6e6&quot;
|valign="top"|
|valign=&quot;top&quot;|
449
449
|align="right"|
|align=&quot;right&quot;|
Change from:<br>
Change from:&lt;br&gt;
To:
To:
|
|
$cfg['UploadDir'] = '/etc/phpmyadmin'; <br>
$cfg['UploadDir'] = '/etc/phpmyadmin'; &lt;br&gt;
'''$cfg['UploadDir'] = 'c:/us35temp/phpmyadmin/etc/phpmyadmin';'''
'''$cfg['UploadDir'] = 'c:/us35temp/phpmyadmin/etc/phpmyadmin';'''
|-style="background:#f5f5f5"
|-style=&quot;background:#f5f5f5&quot;
|valign="top"|
|valign=&quot;top&quot;|
452
452
|align="right"|
|align=&quot;right&quot;|
Change from:<br>
Change from:&lt;br&gt;
To:
To:
|
|
$cfg['SaveDir'] = '/etc/phpmyadmin';<br>
$cfg['SaveDir'] = '/etc/phpmyadmin';&lt;br&gt;
$cfg['SaveDir'] = 'c:/us35temp/phpmyadmin/etc/phpmyadmin';  
$cfg['SaveDir'] = 'c:/us35temp/phpmyadmin/etc/phpmyadmin';  
|-style="background:#e6e6e6"
|-style=&quot;background:#e6e6e6&quot;
|valign="top"|
|valign=&quot;top&quot;|
458
458
|align="right"|
|align=&quot;right&quot;|
Change from:<br>
Change from:&lt;br&gt;
To:
To:
|
|
$cfg['TempDir'] = '/tmp';<br>
$cfg['TempDir'] = '/tmp';&lt;br&gt;
'''$cfg['TempDir'] = 'c:/us35temp/phpmyadmin/tmp';'''  
'''$cfg['TempDir'] = 'c:/us35temp/phpmyadmin/tmp';'''  
|}
|}
Line 200: Line 201:
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<br>
:* '''Create''' folder c:\us35temp and any sub-folders&lt;br&gt;
:: (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<br>
:* '''Copy''' the entire data (database) from MySQL&lt;br&gt;
:: (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 213: Line 214:
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="0" cellpadding="4"
{|cellspacing=&quot;0&quot; cellpadding=&quot;4&quot;
|-style="background:#f5f5f5"
|-style=&quot;background:#f5f5f5&quot;
|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="background:#e6e6e6"
|-style=&quot;background:#e6e6e6&quot;
|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="background:#f5f5f5"
|-style=&quot;background:#f5f5f5&quot;
|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="background:#e6e6e6"
|-style=&quot;background:#e6e6e6&quot;
|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="background:#f5f5f5"
|-style=&quot;background:#f5f5f5&quot;
|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&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 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.
|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.


'''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="background:#f5f5f5"
|-style=&quot;background:#f5f5f5&quot;
|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="background:#e6e6e6"
|-style=&quot;background:#e6e6e6&quot;
|:ABORT
|:ABORT
|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.
|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.
|-style="background:#f5f5f5"
|-style=&quot;background:#f5f5f5&quot;
|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
|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
|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="background:#e6e6e6"
|-style=&quot;background:#e6e6e6&quot;
|: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 249: Line 250:
'''''[[#top | Top]]'''''
'''''[[#top | Top]]'''''
==== new_Server_Start.bat ====
==== new_Server_Start.bat ====
<pre>
&lt;pre&gt;
rem File Name: new_Server_Start.bat
rem File Name: new_Server_Start.bat
rem Location: Uniform Server
rem Location: Uniform Server
Line 309: Line 310:


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


goto :CONTINUE
goto :CONTINUE
Line 330: Line 331:
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 "%Disk%"=="" set Disk=w
if &quot;%Disk%&quot;==&quot;&quot; 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%: "udrive"
subst %Disk%: &quot;udrive&quot;
if errorlevel 1 goto :HINT
if errorlevel 1 goto :HINT


Line 351: Line 352:


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


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


rem ### Start MySQL server - skip if requested not to start (%2)
rem ### Start MySQL server - skip if requested not to start (%2)
if "%2"=="nomysql" goto :NOMYSQL
if &quot;%2&quot;==&quot;nomysql&quot; 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 "%3"=="console" goto :CONSOLE
if &quot;%3&quot;==&quot;console&quot; goto :CONSOLE
goto :END
goto :END


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


'''''[[#top | Top]]'''''
'''''[[#top | Top]]'''''
Line 403: Line 404:
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="4" cellspacing="0"
{|cellpadding=&quot;4&quot; cellspacing=&quot;0&quot;
|-style="background:#f5f5f5"
|-style=&quot;background:#f5f5f5&quot;
|ping -n 20 localhost &gt; nul
|ping -n 20 localhost &amp;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="background:#e6e6e6"
|-style=&quot;background:#e6e6e6&quot;
|RMDIR&nbsp;/s&nbsp;/q&nbsp;c:\us35tempset
|RMDIR&amp;nbsp;/s&amp;nbsp;/q&amp;nbsp;c:\us35tempset
|'''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.
|'''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.
|}
|}


'''''[[#top | Top]]'''''
'''''[[#top | Top]]'''''
==== new_Stop.bat ====
==== new_Stop.bat ====
<pre>
&lt;pre&gt;
rem File Name: new_Sop.bat
rem File Name: new_Sop.bat
rem Location: Uniform Server
rem Location: Uniform Server
Line 449: Line 450:
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 > nul
ping -n 15 localhost &gt; nul
:clean up remove dir
:clean up remove dir
RMDIR /s /q c:\us35temp
RMDIR /s /q c:\us35temp
Line 455: Line 456:
rem restore original working directory
rem restore original working directory
popd
popd
</pre>
&lt;/pre&gt;


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

edits