Friday, June 21, 2013

Manually Patch ESXi 5.1

- download necessary patches from VMWare
- upload patch file to a datastore local to the ESXi installation (place patches into patch directory)
- place server into maintenance mode

If you have the vCLI tools installed onto your computer you can execute patch remotely
- command prompt and navigate to the bin directory of the CLI tools, execute the following command to apply the update

esxcli --server=192.168.0.25 --username=root software vib update --depot=/vmfs/volumes/DATASTORE/DIRECTORY/ESXi510-201305001.zip

- reboot the server to complete the update

Without the CLI tools available you will have to SSH into the ESXi server to execute and apply the update.
- start the SSH service on the ESXi host; Configuration Tab, Security Profile, Properties in the upper right, highlight SSH, Options button
- SSH into the ESXi host as root
- execute the command to apply the update,

esxcli software vib update --depot=/vmfs/volumes/DATASTORE/DIRECTORY/ESXi510-201305001.zip

- reboot the server to complete the update

Wednesday, June 5, 2013

Powershell command to backup / copy

Use this Powershell command to copy / backup files to remote filesystem.

Copy-Item "C:DIRECTORYTOCOPY*" "DESTINATIONDIR" -Recurse -Force | Out-Null

Change the DIRECTORYTOCOPY & DESTINATIONDIR to appropriate parameters.
- recurse option forces it to copy subfolders and contents
- force option tells it to create new folders in destination that are missing
out-null tells it to finish this line before moving on to the next line of code

Save as a .ps1 extension, then create a batch file to call the .ps1 file.  The batch file can be scheduled.

Monday, June 3, 2013

Apache - Site Maintenance page

Site Under Maintenance Page

In apache config file make sure,
RewriteEngine On

Then add the following lines somewhere (usually within the appropriate virtual host container),

     RewriteCond %{DOCUMENT_ROOT}/maintenance.html -f
     RewriteCond %{REQUEST_FILENAME} !/maintenance.html
     RewriteCond %{REQUEST_FILENAME} !/logo.jpg
     RewriteCond %{REQUEST_FILENAME} !/loading.gif
     RewriteRule ^.*$ /maintenance.html [L]


Then inside the root of the virtual host's directory, add the above files called for your maintenance page. 

When you want to turn the page ON, simply make sure the maintenance.html file is there.

To turn the page OFF, simply rename the maintenance.html file to maintenance.html.REMOVE