Archive

Archive for the ‘Windows Server’ Category

Enabling Search for Local Administrator Account in Windows Server 2016

November 2, 2016 Leave a comment

By default, Windows Server 2016 will severely limit the access rights of the local administrator account.

Here are the steps to promote the account so that you can use it as a normal account

Run gpedit.msc

Goto Computer Configuration > Administrative Template > Windows Components > Search

Set Allow Cortana to Disabled

image

Next goto Computer Configuration > Windows Settings > Security Settings > Local Policies > Security Options

Set User Account Control: Admin Approval Mode for the Built-in Administrator Account to Enabled

image

Now reset the machine and the local administrator will behave like a normal user account

Advertisements

Creating a Master, Slave, Slave Nameserver setup using Vesta Control Panel

July 14, 2015 5 comments

You can easily setup a master, slave DNS using Vesta CP with a single command line found at

https://vestacp.com/docs/#how-to-setup-dns-cluser

However should you bring this to the next level and use it for your “enterprise” web hosting, there are a few things you need to do

 

You might be tempted to setup Vesta in the following way, where all the webhosts will sync to NS01 and then have NS01 sync the dns config over to NS02.

image

Unfortunately Vesta does not allow you to do this, BUT it does allow the setup as shown below, where each of the web servers will send the dns updates to each of the named servers.

image

 

Setting up the NameServers (NS01, NS02)

Now given that Vesta will install and setup different components depending on the amount of ram of the machine, for NS01 and NS02, it would be wise to go with 512MB ram so that it will install the bare minimum.

Once you have installed Vesta on the servers, its time for some clean up

  1. Delete the unused packages
  2. cd $VESTA/bin
    ./v-delete-user-package palegreen
    ./v-delete-user-package gainsboro
    ./v-delete-user-package slategrey

  3. Create the dns-cluster user, who will own all the domains that was synchronized over

    ./v-add-user dns-cluster [password] [email] default [firstname] [lastname]

  4. Stop all the unnecessary services

    ./v-stop-service httpd
    ./v-stop-service nginx
    ./v-stop-service exim
    ./v-stop-service dovecot
    ./v-stop-service vsftpd

  5. Login to Vesta using your web browser, and disable the necessary services at the Firewall section
    1. Accepted services: SSH, DNS, Vesta, Ping
    2. Blocked services: Web, FTP, SMTP, POP3, IMAP, DB

Setting up the Master > Slave DNS (Web01, Web02 > NS01, NS02)

Remember that Vesta allows you to add an unlimited number of slave DNS for each master server

So for web01, and web02, run the following commands:

cd $VESTA/bin
./v-add-remote-dns-host ns01 8083 admin [ns01 admin password]
./v-add-remote-dns-host ns02 8083 admin [ns02 admin password]

 

You can verify that this is done by doing to server setup and ensuring that DNS is set to cluster and confirm that the following cron job exists

image

 

Testing the setup

Now goto web01 and/or web02 and create a few domains, on ANY accounts and at for the 6th minute of the hour, goto ns01 and ns02 to confirm that the changes are synchronized

 

Now what about URGENT cases

If there are cases where you urgently need to sync over, you can run this command on all of your web servers for each named server that you have: v-sync-dns-cluster [target host]

e.g
v-sync-dns-cluster ns01
v-sync-dns-cluster ns02

Categories: HyperV, Vesta

Installing CentOS 6.6 on HyperV 2012R2

July 11, 2015 Leave a comment
  • Download CentOS ISO file: You can download the latest version of CentOS at http://wiki.centos.org/Download
  • Setup a HyperV VM for CentOS
    • At least 1 CPU
    • The amount of RAM will affect the installation GUI, VM with too little RAM will be reduced to a DOS like setup guide, whereas those with higher RAM will get a nice fancy GUI
    • No need for legacy network drivers, you can use the new 10GB network adapters normally used by HyperV
    • A minimum of 20GB HDD
    • Follow the guides and screen caps below if you need a detailed step by step guide
  • Once the OS is installed successfully, reboot
  • Login using the root account that was created during the installation
  • Issue the following 2 commands (these 2 commands are very important, failure to do this can result in unexplained hanging of the VM) 

    yum -y install hyperv-daemons
    yum -y update

  • If you wish for your installation to auto check for updates every night, issue the following commands

    #install yum cron job
    yum -y install yum-cron

    #enable nightly update
    /etc/init.d/yum-cron start

    #Enable at boot time
    chkconfig yum-cron on

Congrats, you now have a working CentOS in HyperV that auto updates itself every night to always be on the safe side of security 🙂

Setup in a Low Ram Environment

If you are running in a low ram environment, CentOS will not load the GUI setup environment, and you have to content with DOS based screens.

  1. Typically I would skip the media test since this is from an ISO file, if you are doing this off a DVD, might be wise to check, but be prepared to wait
    image_thumb[12]
  2. Then you will be prompted to setup a root password
    image_thumb[13]
  3. Once done, its now time to setup the disk. For convenience, I usually go for replacing the entire drive (its empty anyway)
    image_thumb[14]
  4. Simple matter of clicking write changes to disk to commit those changes
    image_thumb[15]
  5. Sit back and wait for installation to complete
    image_thumb[16]

 

Setup in a High Ram Environment

  1. Things look different if you have enough RAM, you get treated to a nice GUI
  2. Start by choosing your country and language
  3. You will then need to format the disk attached to the VM
    image_thumb19
  4. There after, setup the hostname
    image_thumb20
  5. As well as the networking details
    image_thumb21
  6. Then its onto the date/time settings
    image_thumb22
  7. And the root password
    image_thumb23
  8. Disk layout
    image_thumb24
  9. Confirmation of disk layout
    image_thumb25
  10. Type of installation, if you are going to install Vesta Control Panel, choose minimal
    image_thumb26
  11. Now sit back and wait for the installation to complete
    image_thumb27
Categories: HyperV

Running Bitnami LAMP stack in HyperV

September 21, 2014 1 comment

Bitnami has several nice prebuilt linux machines that is very useful for quick deploy.

 

In order to make it easier, you just need to setup a base image for the Bitnami LAMP stack VM

 

Download these first

Bitnami LAMP Stack: Goto https://bitnami.com/stack/lamp and grab the vmware virtual machine image

Microsoft Virtual Machine Converter Solution Accelerator 2.0: Goto http://www.microsoft.com/en-sg/download/details.aspx?id=42497 and grab the msi file

 

Convert VMDK to VHD

Run an administrative powershell instance and run the following 2 commands

# Import the MVMC cmdlets
Import-Module ‘C:\Program Files\Microsoft Virtual Machine Converter\MvmcCmdlet.psd1’

 

#Convert the VMDK to VHDX

ConvertTo-MvmcVirtualHardDisk -SourceLiteralPath bitnami-lampstack-5.4.32-0-ubuntu-14.04.vmdk -DestinationLiteralPath bitnami-lampstack-5.4.32-0-ubuntu-14.04.vhdx -VhdType DynamicHardDisk -VhdFormat Vhdx

 

Once the conversion is complete, use the HyperV –> Edit Disk function to compact the VHDX to save space

Create HyperV VM

Once done, just create a normal VM, there is no need to restrict yourself to the legacy network adapters, the new one works fine

 

image

 

Setting up your bitnami VM

Follow the guide found at http://wiki.bitnami.com/Virtual_Appliances_Quick_Start_Guide

 

You can also refer to https://jefferytay.wordpress.com/2014/09/20/common-setup-commands-for-ubuntu-12-x-onwards/ for some of the more administrative functions

 

Updating Integration Services

Issue the following command: sudo pico /etc/initramfs-tools/modules

 

Add these 4 items to the end of the file

hv_vmbus
hv_storvsc
hv_blkvsc
hv_netvsc

image

Now rebuild the boot image

sudo update-initramfs –u

image

The guest OS needs to be rebooted:

sudo shutdown -r now

After the virtual machine reboots, run the following command to check if the modules are enabled:

lsmod

image

Categories: HyperV

Windows Server Storage Spaces–Auto attach disk

May 8, 2014 Leave a comment

Sometimes when you reformat a server, the volume in the storage spaces is not auto attached.

 

to set it to automatically load use the following powershell

Set-VirtualDisk -FriendlyName Mirror -IsManualAttach 0

Categories: Windows Server

Disabling/Removing IIS Shared Configuration

March 1, 2014 Leave a comment

 

If you are using IIS Shared Configuration and changed the password for the account accessing the file path, you might encounter the following error

The World Wide Web Publishing Service service depends on the Windows Process Activation Service service which failed to start because of the following error:
The user name or password is incorrect.

The Windows Process Activation Service service terminated with the following error:
The user name or password is incorrect.

Windows Process Activation Service (WAS) is stopping because it encountered an error. The data field contains the error number.

 

Internet Information Services (IIS) Manager will also start with a weird error message and then prompts you to login

 

All these points to an inability to access the shared configuration

 

How to resolve?

 

  1. Stop IIS (iisreset /stop)
  2. Goto C:\Windows\System32\inetsrv\config
    image
  3. Open redirection.config inside notepad
    image
  4. Change the <configurationRedirection> part to <configurationRedirection />
  5. Start IIS again (iisreset)
Categories: IIS, Windows Server

Windows Server–DFSR Cheat Sheet

January 20, 2013 Leave a comment

Command: dfsrdiag pollad

Use this command to force DFS to poll AD for configuration updates

Typically used when changes to DFS are not being implemented, use this to force the update

 

Command: dfsradmin membership set /rgname:[replication group name]
/rfname:[replication folder name] /memname:[primary server name] /isprimary:true

 

Use this command to set a particular server as the primary member

Typically used when you add a new folder target in DFS and want it to sync from another server, or to set one of the server as a primary member. IsPrimary will be false once the sync is completed

 

Command: robocopy [destination] /copyall /s /xd dfsrprivate /r:1 /w:1

Robocopy the entire folder from source to destination, used to preseed the destination so that DFS will not take too long to sync

 

Location of DFS debug files: C:\windows\debug

Categories: Windows Server