How do I load a sql.gz file to my database? (importing)

Many of us use phpmyadmin to utilize any sort of importing and exporting of MySQL databases. But what if there was an easier way and faster solution. You will need SSH access to your VPS or dedicated server box. Its a one liner:

zcat /path/to/file.sql.gz | mysql -u ‘root’ -p ‘password’ your_database

zcat = decompresses the data of all the input files, and writes the result on the standard output. zcat concatenates the data in the same way cat does. The names of compressed input files are expected to end in .Z, .gz, or .bz2.

path = you must know full path of your sql file

-u username = in this example we are using root as the username, however you can use a username of your particular mysql that you are importing.

-p = is the password for your username above

your_database = name of the database where you are importing your sql.gz file.

That’s it, fairly simple. If you run into any issues don’t hesitate to contact us.

Run OPTIMIZE TABLE to defragment tables for better performance

If you are noticing slugging performance wits your MySQL database, this simple tutorial is for you. This is particularly important for websites that have a large MySQL database. Please note that you must have root access and SSH access to proceed further. Log into your web hosting via SSH and follow below.

Run this command:

Code:

mysqlcheck -u root –auto-repair –optimize –all-databases

If you notice issues you can fix tables by issuing:

Code:

mysqlcheck -A -r -p

If everything has been fixed it is highly recommended to restart your MySQL server:

/etc/init.d/mysql restart

That is all, you should see increase in your MySQL queries and of course better performance.

Renewing or installing Universal SSL on Mail – Dovecot

If you are providing a universal SSL to your mail server, you will need to install an SSL and of course properly link it from your Dovecot configuration file.

This is not a guide how to achieve above but more of what to do after you have successfully installed an SSL. Your Dovecot will hang on to the old SSL certificate until your restart it. Last step people seem to forget and spend endless hours trying to figure out what went wrong in regards to installation or renewal of the SSL certificate. But really all Dovecot needs is a restart.

Service dovecot restart

That’s it!. You will notice your new SSL actually kick in and start to work again.

Domain Name Registration .COM US$10.99

It’s difficult to stay competitive in the domain name registration business (pricing wise). How it works is the more registrations you process the higher the tier, the lower the price. Therefore, we are happy to announce we have reached a new tier which is allowing us to offer domain name registrations at US$10.99. The price is the SAME for renewal and transfer. Please note that our price will not fluctuate on daily basis like some domain name registrars. We will maintain same pricing model unless there is a change to the base price which we have no control over.

We passing off our savings to you the customer. Thank you!

 

How to leverage browser caching

What is browser caching?

Every time a browser loads a webpage it has to download all the web files to properly display the page. This includes all the HTML, CSS, JavaScript and images.

Some pages might only consist of a few files and be small in size – maybe a couple of kilobytes. For others however there may be a lot of files, and these may add up to be several megabytes large. Twitter.com for example is 3 MB+.

The issue is two fold.

These large files take longer to load and can be especially painful if you’re on a slow internet connection (or a mobile device). Each file makes a separate request to the server. The more requests your server gets simultaneously the more work it needs to do, only further reducing your page speed.

Browser caching can help by storing some of these files locally in the user’s browser. Their first visit to your site will take the same time to load, however when that user revisits your website, refreshes the page, or even moves to a different page of your site, they already have some of the files they need locally.

This means the amount of data the user’s browser has to download is less, and fewer requests need to be made to your server. The result? Decreased page load times.

Here’s something you can add to your apache htaccess file and see if it improves loading times for you:

 

##EXPIRES CACHING
ExpiresActive On
ExpiresByType image/jpg “access 1 month”
ExpiresByType image/jpeg “access 1 month”
ExpiresByType image/gif “access 1 month”
ExpiresByType image/png “access 1 month”
ExpiresByType text/css “access 1 month”
ExpiresByType application/pdf “access 1 month”
ExpiresByType text/x-javascript “access 1 month”
ExpiresByType application/javascript “access 1 month”
ExpiresByType image/x-icon “access 1 year”
ExpiresDefault “access 1 week”
##EXPIRES CACHING

Let us know what you think?

EDIT: Its actually ##EXPIRES CACHING no need to have # after caching.

Benefits of dedicated IP vs. shared IP

Large business and corporations don’t really have to decide if they should be obtaining a dedicated IP or shared IP. Most of the larger enterprises end up obtaining a dedicated server which of course comes with dedicated IP’s. However, start-ups, and small-businesses do have to make that choice sometime during their venture if they should remain shared or simply get a dedicated IP.

Advantages of a dedicated IP address:

  • You can access your server before pointing any domain to your server’s IP address in DNS
  • You can access your server in case of a DNS error or failure
  • You can point any and as many domains as you like to the IP address of your server, and unlimited subdomains of those domains as well. You will not have to “declare” these by using the “add-on domain” function of a control panel — everything can be done at the DNS level. The disposition of requests to those domains is entirely your choice as well; You can map them into the filespace of the server in any way you like (using mod_rewrite on Apache, for example).
  • It is beneficial for email sender’s reputation. Establish and be accountable for one’s own IP reputation. In simple sense, your emails won’t get grouped with other less diligent senders and therefore ensures better Inbox placement.
  • It is good for a business identity.
  • It is “sometimes” required for particular third-party applications/scripts.
  • Your site is high traffic and needs dedicated resources to maintain performance.

If any of the bullet points are important to you, then it is time to get your own dedicated IP.

Spam Links showing up in WordPress

I was contacted by a client who had experienced odd links / advertisements showing up in his WordPress setup. Furthermore, he had experienced emails bouncing back from his Contact Us form. The client has a dedicated servers with 5 ip addresses. Other websites are not experiencing any issues nor are the other 4 ip addresses. The odds are his entire server was not compromised.

Upon examining his infected website it appeared that majority of the links traced back to: http://www.genericstts.com. Some of the keywords that were used in linkage were: Play Craps Online, Play Bingo Online, and Meilleurs Casino en ligne.

This was a multiple task, first we needed to find out why his dedicated server was blacklisted and second, we needed to find out what was causing these links / advertisements.

There was absolutely no point in trying to un-blacklist his ip address because we needed to solve his website spam problem.

The obvious solution was to find if its a plugin or theme causing this or the actual WordPress that was compromised. After narrowing it down, it appeared that a plugin was compromised.

This is where you need to make a decision. Do you just wipe the entire system or delete just the plugin or trace the issue and try to eliminate the malware manually and keep the plugin and the website in tact. It all depends how much information you have stored in your wordpress setup, how much time you want to spend, or how much money you want to spend for someone to spend the time to narrow down the problem. The client wanted to trace the issue down. According to Fox IT, the proper solution should be to eliminate the user and to wipe the system down.

Now you can try and install clamav or maldet to see if it will find the malware and remove it for you, or you can try to find the issue manually.

I did it manually, since I knew which plugin was infected I took a look at each file manually. As it turns out it was a .PNG file that was infected. It did drop itself in two different spots. After getting rid of the two .PNG files, I also made sure you couldn’t write into those two directories.

After getting rid of the malware, I went to de-list the blacklisted IP.

All was back to normal.

If you require any sort of malware removal on your dedicated server (or shared) CONTACT US