Increase the size of /tmp

Once the process of the server increase, /tmp drive space may not able to cater your server need. So if you are using the cPanel, there is a script for you to increase it. Below is the step.

(1) Open /scripts/securetmp and edit the link as below

my $tmpdsksize = 512000;

Note: This is increase to 512MB

(2) stop cpanel, httpd, mysql service first as we do not have new session file go there when we increase the size.

service httpd stop
service mysql stop
service cpanel stop

(3) Take a copy of all the session file in /tmp

cp -apr /tmp /tmp_bak

(4) Check what processes are still writing to /tmp and kill it

lsof |grep /tmp

(5) Unmount /tmp

umount /tmp

(6) Run the script that you edit in step 1

/scripts/securetmp

(7) Verify it have done

df -h

(8) Copy back the session file

cp -apr /tmp_bak/* /tmp/

(9) Start back all service

service mysql start
service cpanel start
service httpd start

Done, bingo!

Change the collation for all tables in a MySQL database

How to change the database collation is easy, but how to change all the table collation? You can use script as below

This example is change all table collation to utf8_general_ci

<?php
$db = mysql_connect('localhost','dbuser','password');
if(!$db) echo "Cannot connect to the database - incorrect details";
mysql_select_db('dbname'); $result=mysql_query('show tables');
while($tables = mysql_fetch_array($result)) {
foreach ($tables as $key => $value) {
mysql_query("ALTER TABLE $value COLLATE utf8_general_ci");
}}
echo "The collation of your database has been successfully changed!";
?>

Note:
dbuser= database user
password= database user password
dbname= database name

Reset administrator username and password in SmarterMail

To reset the primary administrator login and password in SmarterMail, follow the instructions below:

(1) Stop the SmarterMail Service

(2) Open Windows Explorer (My Computer)

(3) Go to C:\Program Files\SmarterTools\SmarterMail (or wherever you installed SmarterMail)

(4) Open the Service subdirectory

(5) Make a backup copy of the file MailConfig.xml

(6) Right-click on MailConfig.xml and choose Open With -> Notepad

(7) Find the section that looks like this:

<!-- ** System Admin *************************** -->
<!-- ** To reset admin password, delete these items ** -->
<!-- ** and then restart the SmarterMail Service.   ** -->
<!-- ***************************************** -->
<sysadminusername> ... </sysadminusername>
<sysadminpassword> ... </sysadminpassword>
<!-- ***************************************** --> </p>

(8) Delete those lines and save the file

(9) Start the SmarterMail Service

(10) You should now be able to log in to SmarterMail by using the following:

Email: admin
Password: admin

How to install wildcard SSL in II6

I assume that all know how to install the SSL for the IIS6. This topic is how to apply the wildcard SSL in IIS6.

For II6, it may need to apply the certificate for all the subdomain.

Basically it involve 2 part, IIS and cmd.

IIS Part

(1) Open IIS

(2) Go to the subdomain entry

(3) Right click and select Properties, then go to the Directory Security Tab

(4) Click on the Server Certificate under the Secure communications

(5) It will prompt out one message box, click Next, select the option Assign an existing certificate. After that select the wildcard SSL that install previously and apply it.

(6) After that go back to the subdomain entry properties again. Select the Web Site Tab, select Advanced and make sure the port 443 using the dedicated IP that assign to the domain before.

(7) Apply it and it done for the IIS part.

CMD Part

(1) Open CMD

(2) Go to path C:\Inetpub\AdminScripts

(3) Run the script as below

cscript.exe adsutil.vbs set /w3svc/site identifier/SecureBindings “:443:host header

Note:
site identifier : Please check on the IIS and it will have the value of it for each entry

host header: the host header for the Web site

For example, your site domain is test.abc.com and site identifier is 1234, script will be as below

cscript.exe adsutil.vbs set /w3svc/1234/SecureBindings “:443:test.abc.com”

(4) Once done, iisreset it