Life of a Geek Admin

The Daily adventures of a true geek administrator

Life of a Geek Admin - The Daily adventures of a true geek administrator

How install Apache 2.4 PHP 5.4.16 and MariaDB 5.5.31 on Windows 7

As a followup to my post on How install Apache 2.4 PHP 5.4 and MySQL 5.5.21 on Windows 7, I decided to install the latest Apache 2.4 / PHP 5.4.16 and MariaDB 5.5 with PhPMyAdmin. The difference is using MariaDB and PHP 5.4.16.

Apache 2.4 Install

First download Apache 2.4.4 from http://www.apachelounge.com/download/ (httpd-2.4.4-win32-ssl_0.9.8.zip) Apache 2.4.4-win32-ssl_0.9.8.zip.

Extract the zip and copy it to the root of C:\. This will be C:\Apache24 when it is all done.

PHP 5.4.16

Download PHP 5.4.16 VC9 x86 Thread Safe from http://windows.php.net/download/ . Extract and rename folder to php and move to C:\.

PHP 5.4.10 and newer configuration

Edit Apache’s config file, c:\Apache24\conf\httpd.conf and add the following lines to the bottom of the file.

LoadModule php5_module "c:/php/php5apache2_4.dll"
AddHandler application/x-httpd-php .php
# configure the path to php.ini
PHPIniDir "C:/php"

While we are at it we can add index.php to Apache’s list just incase we want to have a starting page as php.

Find Directory index and add index.php

DirectoryIndex index.html index.php

Next we need to input a value  for ServerName variable. You will have to un-comment it. Save the changes to the config file. Next move to the Register Apache Service step.

Register Apache Service

Now let’s register Apache as a service. Open a command prompt and type.

c:\apache24\bin\httpd -k install

Note: If you receive and error that MSVRC100.dll is missing you will need to download and install Visual C++ 2010 x86 Runtime. You can retrieve that from http://www.microsoft.com/en-us/download/details.aspx?displaylang=en&id=5555.

If do not want Apache starting automatically at start-up/reboot:

GUI Way

  • START | RUN
  • Type in services.msc, hit Enter or click OK
  • Locate Apache2 service and double-click (or right-click for Properties)
  • Find the caption Startup type: (in the middle of the dialog box), use the pull-down and select Manual
  • Click OK

Command line

C:\> sc config Apache2.4 start= demand

Add

c:\Apache24; c:\Apache24\bin

to PATH in Environment variables. PATH ENVIRONMENT (System Properties | Advanced | Environment Variables | System variables | Path).
Example:
;c:\php;c:\apache24;c:\apache24\bin;

Now lets check Apache settings by issuing the command, c:\Apache24\bin\httpd -S

PHP Edits

Now we have to do a few edits to the php.ini file to tell it to load support for mysql and the location for the extensions. Since there is not a already set php.ini file we need to rename one of the two examples to php.ini.

Rename c:\php\php.ini-development to php.ini

Now let’s edit php.ini
Uncomment extension directory.

; Directory in which the loadable extensions (modules) reside.
; http://php.net/extension-dir
; extension_dir = "./"
; On windows:
extension_dir = "ext"

Uncomment mysql modules
extension=php_mysql.dll
extension=php_mysqli.dll
extension=php_mbstring.dll

Save the changes and open a command prompt. Check to make sure it shows loaded modules.

C:\> php -m

So now we have Apache running and configured to use php. Lets create a file called info.php, save it and see if Apache parses the info correctly to display the results.

Open Notepad or your favorite Windows editor and type and save the following.

 <?php
phpinfo();
?>

Open your browser and type, localhost/info.php for the location and you should receive alot of information about PHP.

MariaDB
Download and install mariadb-5.5.31-winx64.msi. Change installation directory to C:\MariaDB 5.5 instead of Program files as there could be permissions issues. Once the installation is completed you can let the configuration wizard run and setup the database server. The defaults will work just fine, but remember what you set the password to for root.

PHPMyAdmin
PHPMyAdmin is a very nice tool to use for administering your MySQL installation.
Download and install phpmyadmin-3.5.8.1-english.zip.
Extract the file and move to c:\apache24\htdocs. Rename directory to phpmyadmin.
Create a config directory under phpmyadmin. Open a browser and type localhost/phpmyadmin/setup/index.php to complete the installation.

At this point you should have a working Apache / PHP / MariaDB installation running and ready for you to start developing !!!

How to install Apache 2.4 PostgreSQL 9.2.4 and PHP 5.4 on Windows 7

In following along with previous posts and installing Apache stack on Windows systems I thought I might cover installing Apache 2.4, PostgreSQL 9 and PHP 5.4 on a Windows system. In this case a Windows 7 Professional 64 bit installation.

Apache 2.4 Install

First download Apache 2.4.4 from http://www.apachelounge.com/download/ (httpd-2.4.4-win32-ssl_0.9.8.zip) Apache 2.4.4-win32-ssl_0.9.8.zip.

Extract the zip and copy it to the root of C:\. This will be C:\Apache24 when it is all done.

PHP 5.4.16

Download PHP 5.4.16 VC9 x86 Thread Safe from http://windows.php.net/download/ . Extract and rename folder to php and move to C:\.

PHP 5.4.10 and newer configuration

Edit Apache’s config file, c:\Apache24\conf\httpd.conf and add the following lines to the bottom of the file.

LoadModule php5_module "c:/php/php5apache2_4.dll"
AddHandler application/x-httpd-php .php
# configure the path to php.ini
PHPIniDir "C:/php"

While we are at it we can add index.php to Apache’s list just incase we want to have a starting page as php.

Find Directory index and add index.php

DirectoryIndex index.html index.php

Next we need to input a value  for ServerName variable. You will have to un-comment it. Save the changes to the config file. Next move to the Register Apache Service step.

Register Apache Service

Now let’s register Apache as a service. Open a command prompt and type.

c:\apache24\bin\httpd.exe -k install

Note: If you receive and error that MSVRC100.dll is missing you will need to download and install Visual C++ 2010 x86 Runtime. You can retrieve that from http://www.microsoft.com/en-us/download/details.aspx?displaylang=en&id=5555.

If do not want Apache starting automatically at start-up/reboot:

GUI Way

  • START | RUN
  • Type in services.msc, hit Enter or click OK
  • Locate Apache2 service and double-click (or right-click for Properties)
  • Find the caption Startup type: (in the middle of the dialog box), use the pull-down and select Manual
  • Click OK

Command line

C:\> sc config Apache2.4 start= demand

Add

c:\Apache24; c:\Apache24\bin

to PATH in Environment variables. PATH ENVIRONMENT (System Properties | Advanced | Environment Variables | System variables | Path).
Example:
;c:\php;c:\apache24;c:\apache24\bin;

Now lets check Apache settings by issuing the command, c:\Apache24\bin\httpd -S

PHP Edits

Now we have to do a few edits to the php.ini file to tell it to load support for PostgreSQL and the location for the extensions. Since there is not a already set php.ini file we need to rename one of the two examples to php.ini.

Rename c:\php\php.ini-development to php.ini

Now let’s edit php.ini
Uncomment extension directory, if it doesn’t exist you will need to create it.

; Directory in which the loadable extensions (modules) reside.
; http://php.net/extension-dir
; extension_dir = "./"
; On windows:
extension_dir = "ext"

Uncomment PostgreSQL modules
extension=php_pgsql.dll

Save the changes and open a command prompt. Check to make sure it shows loaded modules.

C:\> php -m

So now we have Apache running and configured to use php. Lets create a file called info.php, save it and see if Apache parses the info correctly to display the results.

Open Notepad or your favorite Windows editor and type and save the following.

 <?php
phpinfo();
?>

Open your browser and type, localhost/info.php for the location and you should receive alot of information about PHP.

PostgreSQL

Download PostgreSQL 9.2.4 x86-64from EnterpriseDB site http://www.enterprisedb.com/products-services-training/pgdownload#windows. Select x86-32 if you are running a 32 bit version of Windows.

Start the installation of PostgreSQL. The installation will prompt for a location. Change the location to C:\PostgreSQL\9.2 and click next.

postgres1

The next prompt will be for the data directory. It will inherit what you set before which is good, click next.

postgres2

Set the root password for the database. Make sure to take note of the password. Click Next.

postgres3

Click next to accept the default port of 5432

postgres4

Next you will be prompted for the default locale. Click next to accept it.

postgres5

Click next to start the installation.

postgres6

Once the installation is completed you will be asked if you want to allow Stack Builder to download and install tools, this is your choice. Click Finish when completed.

postgres7

At this point PostgreSQL will start and you can verify by opening pgAdmin II and connect to it.

postgres8

Now you have a running system with PostgreSQL as your database, Apache 2.4 and PHP 5.4 on a Windows 7 system.

 

How to Fix Flash Player Crashing on Firefox 20

After a recent upgrade of Firefox to 20.01 Adobe Flash player starting crashing on sites. After Googling around I found that most were saying to upgrade or downgrade Flash. Tried them all with no change until I ran across a suggestion to install the debug version of Flash which did the trick.

Download the Windows Flash Player 11.7 Plugin content debugger (for Netscape-compatible browsers) (EXE, 17.21MB) and install and that’s it!

Disappearing Space on Windows 2008 R2 Caused by System Volume Information and Shadow Copies

Recently ran into an issue where a 400 GB drive was showing low space but looking at the files found that only 20 GB was being consumed. Upon checking on the drive turned on show hidden on the server in a folder called System Volume Information.

The System Volume Information folder is a hidden system folder that the System Restore tool (XP, Vista/7/8) uses to store its information and restore points, it is also used by shadow copies for  backups and other purposes on Windows 2003/2008 and 2012. There is a System Volume Information folder on every partition on your computer.

So how do you reclaim the space, well there are two ways either through the GUI or the command line to recover space that system restore is not using. Special Note: if you do this on SQL servers it will stop the MSSQL service.

CLI Method

Open a command prompt with the “Run as Administrator” option. Type in vssadmin list shadowstorage

vss1

As you can see the output shows used Space, Allocated Space and Maximum Space.

We can also see what available restore information is available by running vssadmin list shadows

vss2

So now let’s get to reclaiming the space on one of the drives. In the issue I had with disappearing space was with the F:\ drive. So to reclaim it I want to resize the maximum allocated space setting to 1 GB. The syntax is:

vssadmin resize shadowstorage /on=[here add the drive letter]: /For=[here add the drive letter]: /Maxsize=[here add the maximum size]

For Example:

vssadmin resize shadowstorage /on=F: /For=F: /Maxsize=1GB

vss3

To validate the changes took run vssadmin list shadowstorage.

vss4

Repeat the steps to make the changes to other drives and the space will be recovered.

GUI Method

Double click on Computer to see your drives. Right click on the drive in question and select Properties. Click on the shadow copies tab.

vss5

Select the drive in the list and click on the settings button. Check the Use Limit box and type in the amount in MB to which you want to set (1024 for 1GB) and click OK. Repeat for other drives until completed.

vss6

You are all done and now have more space.

 

How to clear ARP Cache in Windows 2003 / 2008

There are many tools and different ways to troubleshoot TCP/IP network issues. One of those steps could involve clearing the ARP (Address Resolution Protocol) cache. One area where clearing the ARP cache can help is if you are seeing web pages not loading, ability to ping certain IP addresses.
Clearing the ARP cache is easy to do. Open a a command prompt Start > Run > type cmd and click OK. Enter in the following command.

netsh interface ip delete arpcache

It will  take 2 – 20 minutes for the ARP cache to update on the server.

To display the ARP cache type

arp -a

To delete an address from the ARP cache type

arp -d <ip_address>

Add static entry to ARP table

arp -s <ip address> <mac address>

Example

arp -s 192.168.1.20 00-cc-00-61-f6-19

 

Optimal Network Adaptor Settings for VMXNET3 and Windows 2008 R2

There is an ongoing debate between many admins on what are the best settings for the VMXNET3 driver on Windows 2008 R2 settings and I suppose there will be many more. In this postI will attempt to point out some of the options and recommended settings for the VMXNET3 adaptor.

 Global Settings

Receive Side Scaling (RSS)

Receive-Side Scaling (RSS) resolves the single-processor bottleneck by allowing the receive side network load from a network adapter to be shared across multiple processors. RSS enables packet receive-processing to scale with the number of available processors. This allows the Windows Networking subsystem to take advantage of multi-core and many core processor architectures.

By default RSS is set to enabled. To disable RSS you must open a command prompt and type:

netsh int tcp set global rss=disabled

There is also a second RSS settings that is in the VMXNET3 adaptor properties under the Advanced tab, which is disabled by default. Enable it by selecting from the dropdown.

This is a beneficial setting if you have multiple vCPU’s on the server. If this is a single vCPU then you will receive no benefit.

If you have multiple vCPU’s it is recommended to have RSS enabled.

netsh int tcp set global rss=enabled

References

http://technet.microsoft.com/en-us/network/dd277646.aspx

TCP Chimney Offload

TCP Chimney Offload is a networking technology that helps transfer the workload from the CPU to a network adapter during network data transfer. In Windows Server 2008, TCP Chimney Offload enables the Windows networking subsystem to offload the processing of a TCP/IP connection to a network adapter that includes special support for TCP/IP offload processing.

For VMXNET3 on ESXi 4.x, 5.0 and 5.1 TCP Chimney Offload is not supported; turning this off or on has no affect. This is discussed in several places.

References

http://www-01.ibm.com/support/docview.wss?uid=isg3T1012648

http://support.microsoft.com/kb/951037

The Microsoft KB951037 article is of interest because it includes a table that shows how TCP Chimney interacts with programs and services and gives insight to where you can gain the most from this feature. By default this setting is enabled.

As for the use of TCP Chimney Offload is to disable as it is not recognized by VMXNET3. To disable do the following.

Open a command prompt with administrative credentials.

At the command prompt, type the following command, and then press ENTER:

netsh int tcp set global chimney=disabled

To validate or view TCP Chimney

netsh int tcp show global

Recommended setting: disabled

 NetDMA State

NetDMA provides operating system support for direct memory access (DMA) offload. TCP/IP uses NetDMA to relieve the CPU from copying received data into application buffers, reducing CPU load.

Requirements for NetDMA

  • NetDMA must be enabled in BIOS
  • CPU must support Intel I/O Acceleration Technology (I/OAT)

You cannot use TCP Chimney Offload and NetDMA together.

Recommended setting: disabled

TCP Receive Windows Auto-Tuning Level

This feature determines the optimal receive window size by measuring the BDP and the application retrieve rate and adapting the window size for ongoing transmission path and application conditions.

Receive Window Auto-Tuning enables TCP window scaling by default, allowing up to a 16MB maximum receive window size. As the data flows over the connection, it monitors the connection, measures its current BDP and application retrieve rate, and adjusts the receive window size to optimize throughput. This replaces the TCPWindowSize registry value.

Receive Window Auto-Tuning has a number of benefits. It automatically determines the optimal receive window size on a per-connection basis. In Windows XP, the TCPWindowSize registry value applies to all connections. Applications no longer need to specify TCP window sizes through Windows Sockets options. And IT administrators no longer need to manually configure a TCP receive window size for specific computers.

By default this setting is enabled, to disable it open a command prompt with administrative permission and type:

netsh int tcp set global autotuninglevel=disabled

Recommended setting: disabled

References

http://technet.microsoft.com/en-us/magazine/2007.01.cableguy.aspx

Add-On Congestion Control Provider

The traditional slow-start and congestion avoidance algorithms in TCP help avoid network congestion by gradually increasing the TCP window at the beginning of transfers until the TCP Receive Window boundary is reached, or packet loss occurs. For broadband internet connections that combine high TCP Window with higher latency (high BDP), these algorithms do not increase the TCP windows fast enough to fully utilize the bandwidth of the connection.

Compound TCP, CTCP increases the TCP send window more aggressively for broadband connections (with large RWIN and BDP). CTCP attempts to maximize throughput by monitoring delay variations and packet loss. It also ensures that its behavior does not impact other TCP connections negatively.

By default, it is on by default under Server 2008. Turning this option on can significantly increase throughput and packet loss recovery.

To enable CTCP, in elevated command prompt type:

netsh int tcp set global congestionprovider=ctcp

To disable CTCP:

netsh int tcp set global congestionprovider=none

Possible options are:  ctcp, none, default (restores the system default value).

Recommended setting: ctcp

ECN Capability

ECN (Explicit Congestion Notification) is a mechanism that provides routers with an alternate method of communicating network congestion. It is aimed to decrease retransmissions. In essence, ECN assumes that the cause of any packet loss is router congestion. It allows routers experiencing congestion to mark packets and allow clients to automatically lower their transfer rate to prevent further packet loss. Traditionally, TCP/IP networks signal congestion by dropping packets. When ECN is successfully negotiated, an ECN-aware router may set a bit in the IP header (in the DiffServ field) instead of dropping a packet in order to signal congestion. The receiver echoes the congestion indication to the sender, which must react as though a packet drop were detected.

ECN is disabled by default, as it is possible that it may cause problems with some outdated routers that drop packets with the ECN bit set, rather than ignoring the bit.

To change ECN, in elevated command prompt type:

netsh int tcp set global ecncapability=default

Possible settings are: enabled, disabled, default (restores the state to the system default).

The default state is: disabled

ECN is only effective in combination with AQM (Active Queue Management) router policy. It has more noticeable effect on performance with interactive connections and HTTP requests, in the presence of router congestion/packet loss. Its effect on bulk throughput with large TCP Window is less clear.

Currently, it is not recommended enabling this setting, as it has negative impact on throughput.

Recommended setting is disabled

netsh int tcp set global ecncapability=disabled

Direct Cache Access (DCA)

Direct Cache Access (DCA) allows a capable I/O device, such as a network controller, to deliver data directly into a CPU cache. The objective of DCA is to reduce memory latency and the memory bandwidth requirement in high bandwidth (Gigabit) environments. DCA requires support from the I/O device, system chipset, and CPUs.

To enable DCA:

netsh int tcp set global dca=enabled

Available states are: enabled, disabled.

Default state: disabled

Recommended setting is disabled

To disable DCA:

netsh int tcp set global dca=disable

These are just settings that I have used successfully in the VMware environment and work well. You can pick and choose the settings that work best for your environment.

How To Fix VMware Error IP address already assigned to another adapter

There has been times when you have deleted a NIC in VMware and to the eye it looks like it is gone but really it is still there and it rears it’s ugly head when you try to re-add it to a Windows VM. You will receive errors similar to the following.

The IP address XXX.XXX.XXX.XXX you have entered for this network adapter is 
already assigned to another adapter Name of adapter. Name of adapter is hidden 
from the network and Dial-up Connections folder because it is not physically in
 the computer or is a legacy adapter that is not working. If the same address is 
assigned to both adapters and they become active, only one of them will use this address. 
This may result in incorrect system configuration. Do you want to enter a different 
IP address for this adapter in the list of IP addresses in the advanced dialog box?

XXX.XXX.XXX.XXX is usually the IP address of the system you are working on. According to VMware support this error can occur also if

  • You have upgraded VMware virtual network adapters (for example, when you migrate a virtual machine from an older to a new version of VMware software).
  • You have added and removed network adapters multiple times.
  • You may see this if you recently performed a P2V and the resulting virtual machine still has the physical NICs and drivers for those NICs present. These ghost NICs have the old IP address and the virtual NIC cannot be assigned the same IP address.

This issue occurs if a network adapter with the same IP address is in the Windows registry but is hidden in the Device Manager (My Computer > Properties > Hardware > Device Manager). This hidden adapter is called a ghosted network adapter.

Using the Show hidden devices option in the Device Manager (View > Show hidden devices) does not always show the ghosted adapter to which that IP Address is assigned.

So how do we fix it? First make the ghosted network adapter visible in the Device Manager and uninstall the ghosted network adapter from the registry:

  1. Click Start > Run.
  2. Type cmd and press Enter.
  3. At the command prompt, run this command:
set devmgr_show_nonpresent_devices=1

Note: If this command does not work (a possibility in Windows Server 2000 and 2003), you may need to add the parameter to Windows and set its value:

a. Right-click the My Computer desktop icon and choose Properties.
b. Click the Advanced tab and select Environment Variables.
c.  In the System variables section, click New.
d.  Set the Variable name to devmgr_show_nonpresent_devices and set the Variable value to 1 to enable the parameter.
e.  Click OK to add the variable to Windows.

4. Start the Device Manager by running this command from the same command prompt:

start devmgmt.msc

5. Click View > Show Hidden Devices.
6. Expand the Network Adapters tree (click the plus sign next to the Network adapters entry).
7. Right-click the dimmed network adapter, then click Uninstall.
8. Once all of the grayed out NICs are uninstalled, assign the IP address to the virtual NIC.

Note: To assign the IP address to the virtual NIC on the command line, run the command:

netsh interface ip set address "Local Area Connection #" static IP_Address Subnet_Mask Default_Gateway

For example:

netsh interface ip set address "Local Area Connection 2" static 192.168.1.101 255.255.255.0 192.168.1.1

9. Close the Device Manager.

That should fix the issue stopping you from adding a new NIC in your VM.

How To Enable Named Pipes and TCP/IP for Microsoft SQL Server 2008 R2 SQLExpress

During a recent installation of HP Insight Manager 7.1 on Windows 2008 R2 server the prerequisites failed complaining about you must enable named pipes and TCP/IP for the existing database service Microsoft SQL Server 2008. After a default install they are usually disabled. This applies to Microsoft SQL Server 2008 Express as well.

To enable named pipes and TCP/IP for Microsoft SQL Server 2008

Click Start > All Programs > Microsoft SQL Server 2008 R2 > Configuration Tools > SQL Server Configuration Manager.
Under SQL Server 2008 Network Configuration > Protocols for MSSQLSERVER:

Double-click the protocol name TCP/IP and set the property ENABLED to Yes.
Double-click the protocol name Named Pipes and set the property ENABLED to Yes.

sqlexpress1
Next we will need to restart mssqlserver service, type the following commands in the command prompt window.

net stop mssqlserver
net start mssqlserver

And that’s all there is to do.

How To Start and Stop Services Using PowerShell Remotely

Admit it, you’re an admin that likes to do everything possible from the desk or laptop and if possible from a command line because automation is our friend.

With the addition of PowerShell this is getting more of the norm for Windows and starting and stopping services remotely is probably one of the most used. To perform this task we will need to several cmdlets, some

  • get-service
  • stop-service
  • start-service
  • restart-service

So for this post we will be stopping and starting the Windows Update Service. First we need to find the name of the service, we can do this using the get-service cmdlet and findstr commands.

PS C:\> get-service -ComputerName cvgwin2008tst | findstr /c:"Windows Update"
Running  wuauserv           Windows Update

From this command we see get-service -ComputerName <computername> and then use the pipe symbol and use findstr with the /c: switch for using specified text as a literal search string and the status, name and display name are shown.

So we know wuauserv is the name of the service. So next lets create a variable called $service and populate it with this information.

PS C:\> $service = get-service -ComputerName cvgwin2008tst -Name wuauserv
PS C:\> $service
Status   Name               DisplayName
------   ----               -----------
Running  wuauserv           Windows Update

So now we want to stop the service but there is a catch, the stop-service cmdlet doesn’t support the -ComputerName parameter but it does support the -InputObject parameter. So let’s stop the service and make the command gives a status of what it is doing using the -Verbose parameter.

PS C:\> Stop-Service -InputObject $service -Verbose
VERBOSE: Performing operation "Stop-Service" on Target "Windows Update (wuauserv)"

Run $service and see that it has been stopped.

PS C:\> $service
Status   Name               DisplayName
------   ----               -----------
Stopped  wuauserv           Windows Update

Now using the start-service cmdlet let’s fire it back up.

PS C:\> Start-Service -InputObject $service -Verbose
VERBOSE: Performing operation "Start-Service" on Target "Windows Update (wuauserv)".
PS C:\> $service
Status   Name               DisplayName
------   ----               -----------
Running  wuauserv           Windows Update

Now that all pieces are in place you can save all the commands as a ps1 and just run a single command!

 

How To Remove Sleep Option from the Vista Shutdown Menu

Recently ran into an issue with a Windows Vista desktop system that the client kept putting the system to sleep with the desktop and was causing issues. If this was a laptop I wouldn’t want to remove the Sleep option from the menu, but being a desktop it was not such a big issue.

  • Click Start, Run
  • Type “regedit”
  • To disable sleep for all users, go to HKey_Local_Machine\Software\Policies\Microsoft\
  • In the right pane, right click and choose New > Key and type Power
  • Create another key, in the right pane, right click and choose New > Key and type PowerSettings
  • Create a final key in the right pane, right click and choose New > Key and type abfc2519-3608-4c2a-94ea-171b0ed546ab

nosleep

  • Now, in the right pane, right click and choose DWord (32 bit)-value and type ACSettingIndex
  • Double click the new entry and set it’s value to 0 (Hexadecimal)
  • Reboot or logoff and logon and sleep is gone from the shutdown menu.

nosleep2

If you want to put the sleep option back all you have to do is delete the HKey_Local_Machine\Software\Policies\Microsoft\Power key.

Switch to our mobile site