Showing posts with label Windows. Show all posts
Showing posts with label Windows. Show all posts

Thursday, June 4, 2015

Can't connect to MySQL server on 'localhost' (10055)"


Cause of MySQL Error 10055?

This is more of an Operating System Error than a MySQL error.  Each time your website runs a query you open a connection to the Database, run the query, then close the connection.  Each time this happens your Server allocates a dynamic port for use by MySQL and your Website.  For Websites like mine which may run 2000+ Queries per second, this means that 2000+ dynamic ports must be set aside for these connections.  Sometimes your server gets under load and the operating system can't recycle these ports fast enough, leading you to run out of ports and then your server throws a 10055 Error.

By default Windows Server 2008 R2 has 16838 Ports designated for Dynamic use.  The default ranges are 49152 - 65535.  However this can be extended to a wider range of ports.

Fix MySQL Error 10055:

To fix the problem you need to increase the number of dynamic ports.
Running the following Commands will give give you 50000 ports for dynamic use.

On Windows Server 2008 R2
Open command Prompt

Type the following:
netsh int ipv4 set dynamicport tcp start=10000 num=50000
Press Enter

Type the following
netsh int ipv4 set dynamicport udp start=10000 num=50000
Press Enter

Monday, June 1, 2015

Protected directory cannot be enabled: "columns siteId, path are not unique"

Symptoms

When trying to add a new customer and protected directory in Parallels Plesk, the protected directory cannot be enabled:
Error message : ProtDir_IIS::update() failed: Add Protected Directory failed: columns siteId, path are not unique (Error code 1)

Cause

The protected directory was not synchronized properly.

Resolution

Synchronize the protected directories database using the following command:

"%plesk_cli%\repair.exe"  --synchronize-protected-directories-storage

Friday, April 10, 2015

Commonly Used Ports -Part 3

<<Previous Part 2


Port    TCP       UDP             DESCRIPTION


21   TCP   UDP    FTP control (command)
22   TCP   UDP    Secure Shell 
23   TCP   UDP    Telnet protocol—unencrypted text communications
24   TCP   UDP    Priv-mail : any private mail system.
25   TCP   UDP    Simple Mail Transfer Protocol 
26   TCP   UDP    Unassigned
27   TCP   UDP    NSW User System FE
29   TCP   UDP    MSG ICP
33   TCP   UDP    Display Support Protocol
35   TCP   UDP    Any private printer server protocol
37   TCP   UDP    TIME protocol
39   TCP   UDP    Resource Location Protocol
40   TCP   UDP    Unassigned
42   TCP   UDP    ARPA Host Name Server Protocol
42   TCP   UDP    Windows Internet Name Service
43   TCP   UDP    WHOIS protocol
47   TCP   UDP    NI FTP
49   TCP   UDP    TACACS Login Host protocol
50   TCP   UDP    Remote Mail Checking Protocol
51   TCP   UDP    IMP Logical Address Maintenance
52   TCP   UDP    XNS (Xerox Network Systems) Time Protocol
53   TCP   UDP    Domain Name System (DNS)
54   TCP   UDP    XNS (Xerox Network Systems) Clearinghouse
55   TCP   UDP    ISI Graphics Language (ISI-GL)
56   TCP   UDP    XNS (Xerox Network Systems) Authentication
56   TCP   UDP    Route Access Protocol (RAP)
57   TCP   UDP    any private terminal access
58   TCP   UDP    XNS (Xerox Network Systems) Mail
64   TCP   UDP    CI (Travelport) (formerly Covia) Comms Integrator
67   TCP   UDP    Bootstrap Protocol (BOOTP) Server; also used by DHCP
68   TCP   UDP    Bootstrap Protocol (BOOTP) Client; also used by DHCP
69   TCP   UDP    Trivial File Transfer Protocol (TFTP)
70   TCP   UDP    Gopher protocol
71   TCP   UDP    NETRJS protocol
72   TCP   UDP    NETRJS protocol
73   TCP   UDP    NETRJS protocol
74   TCP   UDP    NETRJS protocol
77   TCP   UDP    Any private Remote Job Entry
79   TCP   UDP    Finger protocol
80   TCP   UDP    Hypertext Transfer Protocol (HTTP)

Thursday, April 9, 2015

Commonly Used Ports -Part 2

<< Previous Part 1                                                           Next Part 3 >>


Port    TCP      UDP       DESCRIPTION


0             UDP        Reserved
1     TCP   UDP        TCP Port Service Multiplexer (TCPMUX)
2     TCP   UDP       CompressNET[5] Management Utility
3     TCP   UDP       CompressNET[5] Compression Process
4     TCP   UDP       Unassigned
5     TCP   UDP       Remote Job Entry
6     TCP   UDP       Unassigned
7     TCP   UDP       Echo Protocol
8     TCP   UDP       Unassigned
9     TCP   UDP       Discard Protocol 
9             UDP       Wake-on-LAN
10    TCP   UDP       Unassigned
11    TCP   UDP       Active Users (systat[disambiguation needed] service)
12    TCP   UDP       Unassigned
13    TCP   UDP       Daytime Protocol (RFC 867)
14    TCP   UDP       Unassigned
15    TCP   UDP       Previously netstat service
16    TCP   UDP       Unassigned
17    TCP   UDP       Quote of the Day
18    TCP   UDP       Message Send Protocol
19    TCP   UDP       Character Generator Protocol (CHARGEN)
20    TCP   UDP       FTP data transfer

Friday, March 20, 2015

BOOT Process Of Windows Server 2008

Here’s the brief description of Windows Server 2008 Boot process.
  1. System is powered ON
  2. The CMOS loads the BIOS and then runs POST
  3. Looks for the MBR on the bootable device
  4. Through the MBR the boot sector is located and the BOOTMGR is loaded
  5. BOOTMGR looks for active partition
  6. BOOTMGR reads the BCD file from the \boot directory on the active partition
  7. The BCD (boot configuration database) contains various configuration parameters( this information was previously stored in the boot.ini)
  8. BOOTMGR transfer control to the Windows Loader (winload.exe) or winresume.exe in case the system was hibernated.
  9. Winloader loads drivers that are set to start at boot and then transfers the control to the windows kernel.
STEP 1:
 The first step is to see what hardware is available and its condition by using the power-on self

test (POST) routine. Next, BIOS executes the initial program load (IPL), which locates the

boot device and, if the device is a hard disk, the master boot record (MBR) is read from

the first sector on the disk. Otherwise, the equivalent information is obtained from the

boot device. From this information, partition information is obtained, the boot sector is

read, and the Windows Boot Manager (Bootmgr.exe) is started. On the screen, you see the

memory check, the identification of hardware, and the search for a boot device.

STEP 2:
 Windows Boot Manager reads the boot configuration data (BCD) and, if there is

more than one boot partition, asks the user to choose a partition and its OS. If a choice is

not made before the timeout, the default partition and OS is loaded. If you are booting

Windows Server 2008, the Windows Boot Loader (Winload.exe) is started. If you have

more than one hardware profile, you are given the option of pressing the spacebar to

select the hardware profile you want to use, for example, if you have a laptop that you

sometimes use with a docking station. If you press the spacebar , you can choose the

hardware profile you want; otherwise, the default profile is used.

Thursday, March 19, 2015

Windows Server 2003 Booting Process

BIOS: performs Power On Self Test (POST)
BIOS: loads MBR from the boot device specified/selected by the BIOS
MBR: contains a small amount of code that reads the partition table, the first partition marked as active is determined to be the system volume
MBR: loads the boot sector from the system volume
BOOT SECTOR: reads the root directory of the system volume at loads NTLDR
NTLDR: reads BOOT.INI from the system volume to determine the boot drive (presenting a menu if more than 1 entry is defined)
NTLDR: loads and executes NTDETECT.COM from the system volume to perform BIOS hardware detection
NTLDR: loads NTOSKRNL.EXE, HAL.DLL, BOOTVID.DLL (and KDCOM.DLL for XP upwards) from the boot (Windows) volume
NTLDR: loads \WINDOWS\SYSTEM32\CONFIG\SYSTEM which becomes the system hive HKEY_LOCAL_MACHINE\System
NTLDR: loads drivers flagged as “boot” defined in the system hive, then passes control to NTOSKRNL.EXE
NTOSKRNL.EXE: brings up the loading splash screen and initializes the kernel subsystem
NTOSKRNL.EXE: starts the boot-start drivers and then loads & starts the system-start drivers
NTOSKRNL.EXE: creates the Session Manager process (SMSS.EXE)
SMSS.EXE: runs any programs specified in BootExecute (e.g. AUTOCHK, the native API version of CHKDSK)
SMSS.EXE: processes any delayed move/rename operations from hotfixes/service packs replacing in-use system files
SMSS.EXE: initializes the paging file(s) and the remaining registry hives
** before this step completes, bugchecks will not result in a memory dump as we need a working page file on the boot (Windows) volume **
SMSS.EXE: starts the kernel-mode portion of the Win32 subsystem (WIN32K.SYS)
SMSS.EXE: starts the user-mode portion of the Win32 subsystem (CSRSS.EXE)
SMSS.EXE: starts WINLOGON.EXE
WINLOGON.EXE: starts the Local Security Authority (LSASS.EXE)
WINLOGON.EXE: loads the Graphical User Identification and Authentication DLL (MSGINA.DLL by default)
WINLOGON.EXE: displays the logon window
WINLOGON.EXE: starts the services controller (SERVICES.EXE)
** at this point users can logon **
SERVICES.EXE: starts all services markes as automatic
———
NOTES:
The SYSTEM volume is the partition from which the boot process starts, containing the MBR, boot sector, NTLDR, NTDETECT.COM & BOOT.INI

The BOOT volume is the partition which contains the Windows folder – this can be a logical partition

Thursday, February 26, 2015

Commonly Used Ports -Part1

This is a list of commonly used ports                                               Next Part 2 >>

cPanel

      cPanel     2082
      cPanel - SSL     2083
      WHM     2086
      WHM - SSL     2087
      Webmail     2095
      Webmail - SSL     2096

Plesk Panel

      Plesk Control Panel     8880
      Plesk Control Panel - SSL     8443
      Plesk Linux Webmail     N/A*
      Plesk Windows Webmail (SmarterMail)     9998**
      Plesk Webmail   8383

Email

      POP3     110
      POP3 - SSL     995
      IMAP     143
      IMAP - SSL     993
      SMTP     25
      SMTP Alternate     26
      SMTP Alternate     587
      SMTP - SSL     465

Web

      HTTP     80
      SSL     443
      FTP     21
      FTPs     990
      SFTP     22
      SFTP Shared/Reseller Servers     2222
      Webdisk     2077
      Webdisk - SSL     2078
      MySQL     3306
      MSSQL     1433
      SSH     22
      SSH Shared/Reseller Servers     2222

Other

      Virtuozzo     4643
      DotNet Panel     9001
      DotNet Panel Login     80

      RDP (Remote Desktop Protocol)     3389                                               Next Part 2 >>

Monday, February 23, 2015

cPanel vs. Plesk - Side by Side Functionality Comparison

WHM / cPanel versus Plesk 10

WHM/cPanel and Plesk are both feature rich control panels with similar functionality.  They are, however, organized completely differently, have a different security model and use slightly different terminology.

We have several tables comparing each side by side:
  • Functionality & Common Tasks 
  • Account Setup & Security Model 
  • Terminology 

Functionality & Common Tasks


Plesk Panel for Windows service logs and configuration files

Control Panel

  • Logs:
    • Access log: %plesk_dir%\admin\logs\W3SVC<IIS site ID>\ex<date>.log
    • PHP errors: %plesk_dir%\admin\logs\php_error.log
    • Panel log: %plesk_dir%\admin\logs\panel.log
    • Debug logs: %plesk_dir%\admin\logs\plesklog_debugXXXXXXXX.log (create DWORD value Debug=1 in "HKLM\SOFTWARE\PLESK\PSA Config\Config")
  • Service control:
    • Stop: net stop plesksrv /Y
    • Start: net start plesksrv && net start poppassd
    • Restart: net stop plesksrv /Y && net start plesksrv && net start poppassd
  • Configuration:
    • %plesk_dir%\admin\php.ini
    • %plesk_dir%\admin\conf\panel.ini
    • IIS manager > Sites/Application Pools > PleskControlPanel

Web Presence Builder

  • Logs:
    • Error logs: %plesk_dir%\sb\logs\
    • Install/upgrade logs: %plesk_dir%\sb\tmp\
  • No service control (working on IIS)
  • Configuration:
    • %plesk_dir%\sb\config

phpMyAdmin

  • Logs:
    • %plesk_dir%\admin\logs\W3SVC<IIS site ID>\ex<date>.log
  • No service control (working via the plesksrv service).
  • Configuration:
    • %plesk_dir%\admin\htdocs\domains\databases\phpMyAdmin\config.inc.php

ASP.Net Enterprise Manager

  • Configuration:
    • IIS manager > Sites > sqladmin(default) > View Applications > /mssql

myLittleAdmin 2000/2005

  • Configuration:
    • IIS manager > Sites > sqladmin(default) > View Applications > /myLittleAdmin
    • %plesk_vhosts%\sqladmin\myLittleAdmin\2005\config.xml

MailEnable

  • Logs:
    • %plesk_dir%\Mail Servers\Mail Enable\Logging
  • Service control:
    • Stop: net stop meimaps && net stop melcs && net stop memtas && net stop mepops && net stop mepocs && net stop mesptpcs
    • Start: net start meimaps && net start melcs && net start memtas && net start mepops && net start mepocs && net start mesptpcs
    • Restart: net stop meimaps && net stop melcs && net stop memtas && net stop mepops && net stop mepocs && net stop mesptpcs && net start meimaps && net start melcs && net start memtas && net start mepops && net start mepocs && net start mesptpcs
  • Configuration:
    • %plesk_dir%\Mail Servers\Mail Enable\Bin\MailEnable.msc

Named / BIND

  • Logs:
    • Windows Event Viewer
  • Service control:
    • Stop: net stop named
    • Start: net start named
    • Restart: net stop named && net start named
  • Configuration:
    • %plesk_dir%\dns

Sunday, January 11, 2015

Backup and Restore MYSQL Database

Back up and Restore MySQL database from the command line

Backing up via the command line:


Type the following at the prompt with the appropriate USERNAME and DATABASE name:
mysqldump -u USERNAME -p DATABASE > dump.sql

You will be prompted for your database password and then the DATABASE will be dumped to a plain-text file called dump.sql.

Restoring via the command line:

First drop and recreate the database as needed:

Drop the database
mysqladmin -u USERNAME -p drop DATABASE

Recreate the database
mysqladmin -u USERNAME -p create DATABASE

Import the backup data
mysql -u USERNAME -p DATABASE < dump.sql

Monday, December 29, 2014

"xmlrpc error: Expected to have 1 children, found 0"

APPLIES TO:
  • Parallels Plesk 11.0 for Linux
  • Parallels Plesk 11.5 for Linux
  • Parallels Plesk 11.0 for Windows
  • Parallels Plesk 11.5 for Windows
  • Parallels Plesk 10.4 for Windows
  • Parallels Plesk 10.3 for Windows

Symptoms

Parallels Plesk shows the following error:
xmlrpc error: Expected <param> to have 1 children, found 0
---------------------- Debug Info -------------------------------
0: common_func.php3:4675
        of_get_all_keys()
1: common_func.php3:4675
        pkey_fetch_key_list()
2: KeyInfoForm.php:171
        KeyInfoForm->get_bye_online_url(string 'new', string '')
3: KeyInfoForm.php:77
        KeyInfoForm->assign()
4: key_info.php:43
        require(string 'C:\Program Files\Parallels\Plesk\admin\htdocs\server\key_info.php')
5: plesk.php:66

Cause

The file %plesk_dir%\admin\repository\registry.xml is empty.

Resolution

  1. Remove the file %plesk_dir%\admin\repository\registry.xml.
  2. Click the OK button on the error screen or log into the Plesk Control Panel again.
  3. Click the Retrieve Keys button on the License Management screen to re-apply the license.

Sunday, December 28, 2014

Unable to remove an IP address "Error: The IP address is already used for hosting"

APPLIES TO:
Parallels Plesk 11.5 for Linux
Parallels Plesk 11.5 for Windows

Symptoms
An attempt to delete an IP address from Parallels Plesk Panel failwith the following error:
Error: The IP address `<ip_address>` is already used for hosting. 
However, in Tools & Settings > IP Addresses, no sites are shown to use this IP address.

Cause
This is caused by a Plesk database inconsistency. The psa.IpAddressesCollections table
was not correctly updated when IP addresses were changed for domains.
Resolution
Create a psa database backup.

Windows:
"%plesk_dir%\MySQL\bin\mysqldump.exe" -uadmin -P8306 -p<PleskPasswordHere> psa > c:\psadump.sql
Linux: 
   mysqldump -uadmin -pcat /etc/psa/.psa.shadow psa > /tmp/psa.date +%F_%H.%M.sql

Find out which id is assigned to the IP address in question, and find any (sub)domains that have this IP address assiged:

mysql> select @ip_id := id from IP_Addresses where ip_address='10.10.10.10';
mysql> SELECT d.name, d.webspace_id, ipac.ipCollectionId,ip.ip_address FROM DomainServices ds INNER JOIN IpAddressesCollections ipac ON ds.ipCollectionId = ipac.ipCollectionId INNER JOIN domains d ON d.id = ds.dom_id  JOIN IP_Addresses ip on ipac.ipaddressid=ip.id WHERE (ds.type = 'web' OR ds.type = 'mail') and ipac.ipAddressId = @ip_id;

Make sure the 10.10.10.10 IP address is replaced with the one to be deleted. 

Find records in the IpAddressesCollections table that correspond to the IP address in question:

mysql> select * from IpAddressesCollections where ipaddressid=@ip_id;

Find out which id is assigned to the IP address that
 should be used for the (sub)domains from the previous output, then 
update the corresponding records of the IpAddressesCollections table:

For example, the 10.10.10.11 IP address should be assigned to example.com:

mysql> set @domain_name := 'example.com';
mysql> select @ip_id_new := id from IP_Addresses where ip_address='10.10.10.11';
mysql> update IpAddressesCollections ipac  INNER JOIN DomainServices ds ON ds.ipCollectionId = ipac.ipCollectionId INNER JOIN domains d ON d.id = ds.dom_id  JOIN IP_Addresses ip on ipac.ipaddressid=ip.id set ipac.ipAddressId=@ip_id_new WHERE (ds.type = 'web' OR ds.type = 'mail') and ipac.ipAddressId = @ip_id and d.name=@domain_name;

Ref:http://kb.sp.parallels.com/en/122207


Monday, December 22, 2014

Resizing VHDX in Windows 2012 using PowerShell

In order to be able to resize the VHD you need to follow few steps first. You can do that from the GUI, however in my experience your best rate of success is to use the PowerShell. Please note that this apply only to Hyper-V in Windows 2012 and above, there isn’t a process available yet for the previous versions of Hyper-V

Below are the steps of how to do that, just as an explanation in order to be able to resize the VHD we need to resize the partition inside the Virtual machine, as to let the vhd file know that this space is free and its safe to remove it.

The command below will provide all the steps required to resize the vhd, however it requires the server to be shut down. The steps are as follow:

1. Shut down the VM
2. Mount the VHD using mount-vhd command with command line as follow:

mount-vhd path\drive.vhdx -passthru | get-disk | get-partition | get-volume

This command will provide you with information of what drive letter the partitions inside vhdx files have been assigned as well as the size details (remember that from Windows 2008 and up the system create a 100-300MB partition on the main drive used in booting process, don’t resize it)

3. The next command is resize-partition, that is to resize the size of the partition inside the vhdx to the size you want it to be

resize-partition –driveletter D -size 40GB

-driveletter is the drive letter we get from the first command, and –size is the size to what we want to shrink the partition to.

4. Next we will dismount the vhd using dismount-vhd:

dismount-vhd path\drive.vhdx

5. The last command is actual resizing of the VHD, to do that we use: resize-vhd command:

resize-vhd path\drive.vhdx -ToMinimumSize

Thursday, November 20, 2014

Installing and configuring MailEnable

Guide to installing and configuring MailEnable. Includes pre and post installation requirements.

Configuring the environment
Before installing MailEnable, ensure that the environment has been configured correctly. This includes configuring network connectivity and the Public DNS Server. MailEnable should be configured in an environment with a static IP address but (although not recommended) can be configured to work in environments with dynamic IP addresses using products like dyndns or dns2go, etc.

1. Before installing MailEnable, ensure that the machine can access the Internet (i.e.: ping www.mailenable.com ).
Ensure that other computers can ping the server's IP Address from the Internet (note: technically computers do not need to be able to ping the server, but they will definitely need to be able to connect to TCP/IP Ports 110 and 25 of the server). In most cases, this requires some firewall configuration. For those unfamiliar with configuring firewalls, the best approach is to open all ports and then secure the server by blocking access to specific ports or services as appropriate. If experiencing difficulties with configuring the firewall, consult the respective manuals/resources associated with the operating system and communications infrastructure.

2. Ensure that the correct entries are registered in the DNS. The first step to doing this is to determine who has control of your public DNS records. Contact your ISP or DNS provider to determine who holds the records for the domain. This will allow you to determine who can create new DNS records for the domain. When hosting mail for a domain, each domain being hosted requires a number of DNS records to be created.

It is important to understand the role of DNS and how it relates to running mail servers.

Installing the MailEnable software
Now that the environment is configured, MailEnable can be installed. The product manuals explain how to install MailEnable.  These are installed with the product or available from our website here: http://www.mailenable.com/references.asp

Once MailEnable has been installed, check the MailEnable Diagnostic Report to ensure that all services are configured correctly.

Configuring the MailEnable software
MailEnable provides a 'quick start' guide with basic instructions on configuring and running the MailEnable software.
Quick Start Guide: http://www.mailenable.com/support/MailEnable_Quick_Start_Guide.pdf

Exploring and configuring MailEnable features
Each version of MailEnable has specific features. Review the manual of each respective edition to review and configure some of the more advanced features. See http://www.mailenable.com/references.asp