cPanel: Howto Resize tmp

This article will guide you how to resize the tmp drive from your cPanel server.

To get rid of /tmp drive keep on full, you may follow the following step,
1.  Stop the following services,

service httpd stop
service mysql stop

2. Un-mount the following drive

umount /var/tmp
umount /usr/tmp (if you are using VPS)
umount /tmp

3. Remove the temporary space

rm -f /usr/tmpDSK

4. Assign the tmp drive space (in bytes).

replace 512000 [value] -- /scripts/securetmp

Assign /tmp to 1GB
eg. replace 512000 1024000 -- /scripts/securetmp

5. Execute and apply it.

/scripts/securetmp

6. Start the services again,

service mysql start
service httpd start

 

cPanel: php_network_getaddresses: getaddrinfo failed: Name or service not known

I found out this problem just after the disk replace on backup drive but have no idea why it is occurred. However, the fixes is found.

With this issue, you may find the following error,

In SquirrelMail:

Warning: fsockopen() [function.fsockopen]: unable to connect to localhost:143 (php_network_getaddresses: getaddrinfo failed: Name or service not known) in /usr/local/cpanel/base/3rdparty/squirrelmail/plugins/login_auth/functions.php on line 129

In HordeMail:

Login failed because your username or password was entered incorrectly.

In RoundCube:

Connection to IMAP server failed.

To resolve this problem, try to check the following issue,
1. If /etc/nsswitch.conf is exists.
2. If the permission of /etc/nsswitch.conf is 644, else do,

chmod 644 /etc/nsswitch.conf

3. check if /etc/nsswitch.conf come with any content. Update your system to get the fresh content.

Linux: Sysstat (sar)

The sar utility which is use monitor the history system performance data on your system.

To use the sar command, simply enter sar from the system,

# sar

To check the memory statistic,

# sar -r

To check the disk statistic,

# sar -d

To check network statistic,

# sar -n

To check processor statistic,

# sar -P ALL

To check certain date statistic let say 8th of the month

# sar -f /var/log/sa/sar09

Linux: Command to check Perl Modules

instmodsh, a shell to examine installed modules. Used to easily list all the installed module from your server/PC.

[email protected] [~]# instmodsh
Available commands are:
   l            - List all installed modules
   m <module>   - Select a module
   q            - Quit the program
cmd?

By hitting ‘l’, it will show you the list of installed module,

cmd? l
Installed modules are:
   Acme::Spork
   Apache::Admin::Config
   AppConfig
   Archive::Tar
   Archive::Tar::Streamed
   Archive::Zip
   Attribute::Handlers
   Authen::Libwrap
   Authen::SASL
   BSD::Resource
   Bundle::Interchange
   Business::OnlinePayment
   Business::OnlinePayment::AuthorizeNet
   Business::UPS
...
...

 

cPanel: How to disable mod_security2 for account or path

To disable mod_security2 from cPanel server,

1. Create the following folder.

/usr/local/apache/conf/userdata/std/2/username/domain.com

2. Create a file name disabled_modsec2.conf in the above path.
3. Enter the following line if you want to disable mod_security2 for whole domain.

<IfModule mod_security2.c>
SecRuleEngine Off
</IfModule>

For specific path,

<LocationMatch your_path>
<IfModule mod_security2.c>
SecRuleEngine Off
</IfModule>
</LocationMatch>

4. Run the following script from root access.

/scripts/ensure_vhost_includes –user=username

 Alternatively,
Edit the following file,

/usr/local/apache/conf/modsec2.conf

Enter the information below,

SecRule SERVER_NAME "domain.com" phase:1,nolog,allow,ctl:ruleEngine=off

Replace the domain.com will do.

Windows: How to change Windows RDP Port Number

To change your Windows RDP (Remote Desktop Protocol) port number to other,

1. Open Registry Editor,

C:\> regedit

2. Navigate to,

HKEY_LOCAL_MACHINE -> System -> CurrentControlSet -> Control ->Terminal Server -> WinStations -> RDP-Tcp

3. Look at “Port number” and select Decimal.

4. Change to any number that you need and perform a reboot if it is not apply immediately.

Centos: Check Raid device installed

To check if RAID device install to your server, simply run the following command from your  terminal.

# lspci | grep -i raid

With the above, you may simply get the raid device information.

[email protected] [~]# lspci|grep -i raid
04:00.0 RAID bus controller: LSI Logic / Symbios Logic MegaRAID SAS 2108 [Liberator] (rev 05)

cPanel: Accessing cPanel through a firewall with cPanel Proxy

By default, cPanel, WHM and Webmail using custom port instead of port 80. Hence, you might not able to access to the cPanel, WHM and webmail through a firewall enabled network such as company, University or public network.

To get this issue fixed with cPanel 11.x and later, you may enable cPanel Proxy which is designed by cPanel to allow you access through normal web port 80.

To enable cPanel Proxy, make sure that you have the following setting enabled in WHM-> Tweak Settings.

– Proxy subdomains
– Proxy subdomain creation
– Proxy subdomain override

To enable proxy domain on account wide,

/scripts/proxydomains –user=<username> add

where username is the cPanel username.

To enable proxy domain on a single domain,

/scripts/proxydomains –domain=<domain.com> add

where domain.com is your domain name such as mickgenie.com

Lastly, to remove the proxy domain, change the “add” to “remove”.

Howto: Change Windows Server 2003 RDP Port

By default, Windows Terminal Server and Remote Desktop Protocol (RDP) listen on TCP port 3389.

To change the port to your custom port, you may refer to below:-

1. Open the registry editor.
2. Navigate to,

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp

3. Find the “PortNumber” and change to your needed port.

To be secure, reboot your server to apply new port.