Tuesday, February 25, 2014

0 Comments
Posted in Arrangement, Art, Business

Add a W3 Total Cache Flush Button to All WordPress Admin Pages

If you’re a fan of the popular W3 Total Cache plugin, then you probably find yourself clicking that “Empty All Caches” button quite a bit when making updates to your WordPress site.

Admin Flush W3TC Cache is a new, simple plugin that adds an “Empty All Caches” button to every page in the WordPress admin.



Clicking the link clears all caches and returns you to the current page. The idea is to eliminate a few extra clicks needed to go to the Performance options. Instead you can just clear the cache from wherever you are. Download Admin Flush W3TC Cache for free from the WordPress plugin repository.

Wednesday, February 12, 2014

0 Comments
Posted in Arrangement, Art, Business

How to use iptables

Usage

The iptables utility is typically pre-installed on your linux distribution, but isn’t actually running any rules. You’ll find the utility here on most distributions:
/sbin/iptables

Blocking a Single IP Address

You can block an IP by using the -s parameter, replacing 10.10.10.10 with the address that you are trying to block. You’ll note in this example that we used the -I parameter (or –insert works too) instead of the append, because we want to make sure this rule shows up first, before any allow rules.
/sbin/iptables -I INPUT -s 10.10.10.10 -j DROP

Allowing All Traffic from an IP Address

You can alternately allow all traffic from an IP address by using the same command as above, but replacing DROP with ACCEPT. You need to make sure that this rule appears first, before any DROP rules.
/sbin/iptables -A INPUT -s 10.10.10.10 -j ACCEPT

Blocking a Port From All Addresses

You can block a port entirely from being accessed over the network by using the the –dport switch and adding the port of the service you want to block. In this example, we’ll block the mysql port:
/sbin/iptables -A INPUT -p tcp --dport 3306 -j DROP

Allowing a Single Port from a Single IP

You can add the -s command along with the –dport command to further limit the rule to a specific port:
/sbin/iptables -A INPUT -p tcp -s 10.10.10.10 --dport 3306 -j ACCEPT

Viewing the Current Rules

You can view the current rules using the following command:
/sbin/iptables -L
This should give you an output similar to the following:
Chain INPUT (policy ACCEPT)
target     prot opt source               destination         
ACCEPT     all  --  192.168.1.1/24  anywhere            
ACCEPT     all  --  10.10.10.0/24       anywhere             
DROP       tcp  --  anywhere             anywhere            tcp dpt:ssh 
DROP       tcp  --  anywhere             anywhere            tcp dpt:mysql
The actual output will be a bit longer, of course.

Clearing the Current Rules

You can clear out all the current rules by using the flush parameter. This is very useful if you need to put the rules in the correct order, or when you are testing.
/sbin/iptables --flush

Distribution-Specific

While most Linux distributions include a form of iptables, some of them also include wrappers which make the management a little easier. Most often these “addons” take the form of init scripts which take care of initializing iptables on startup, though some distributions also include full-blown wrapper applications which attempt to simplify the common case.

Gentoo

The iptables init script on Gentoo is capable of handling many common scenarios. For starters, it allows you to configure iptables to load on startup (usually what you want):
rc-update add iptables default
Using the init script, it is possible to load and clear the firewall with an easy-to-remember command:
/etc/init.d/iptables start
/etc/init.d/iptables stop
The init script handles the details of persisting your current firewall configuration on start/stop. Thus, your firewall is always in the state you left it. If you need to manually save a new rule, the init script can handle this as well:
/etc/init.d/iptables save
Additionally, you can restore your firewall to the previous saved state (for the case where you were experimenting with rules and now want to restore the previous working configuration):
/etc/init.d/iptables reload
Finally, the init script can put iptables into a “panic” mode, where all incoming and outgoing traffic is blocked. I’m not sure why this mode is useful, but all Linux firewalls seem to have it.
/etc/init.d/iptables panic
Warning: Don’t initiate the panic mode if you are connected to your server via SSH; you will be disconnected! The only time you should put iptables into panic mode is while you are physically in front of the computer.

Saturday, January 25, 2014

0 Comments
Posted in Arrangement, Art, Business

Outlook 2011 (Mac): Syncing IMAP Folders

Microsoft Outlook 2011 allows folders to be imported when using IMAP to sync email accounts. 

Some folders have to be manually imported. 

Import Folders into Outlook

1. With Outlook open, select Tools tab > IMAP folders.

Screen shot of step one
 
2. The user should see a list of folders that are available to import into Outlook. 
  • Select the desired folder and select the Subscribe button located in the top right corner of the window.
  • The user must select each folder and click Subscribe again for every folder they wish to import.
Screen shot of step two

3. The newly subscribed folders will be located in the right hand toolbar of Outlook.

Friday, January 24, 2014

0 Comments
Posted in Arrangement, Art, Business

How to transfer your website from Plesk to cPanel

In this tutorial we will show you how to create a full back up of your hosting account on Plesk and migrate it on a cPanel hosting.
Even the Plesk control panel provides a feature for automatic backup creation, very often this option is disabled by the hosting providers and only manual back up is possible. Furthermore, it can be restored only by the Plesk back up restore tool. Happily, you should not be worried because it is quite easy to create your own back up just in a few clicks using a standard FTP client and the admin panel of your Plesk account.
Usually the website consists of files and database(s). In this tutorial we will guide you how to create a back up both of them. For files backup we will use a normal FTP client and the databases will be exported via the phpMyAdmin tool available via the Plesk control panel.
Please click on the images in order to enlarge the screen shots for more detail.
Basic steps of creating a custom backup:
  1. Copying all files of your main website accessible via http://yourdomain.com.
  2. Copying all files of your websites accessible via your subdomains.
  3. Exporting all of your databases via the PHPMyAdmin
Copying your files on your local drive:
In order to copy your files on your local computer and create a custom backup of your files open your favorite FTP client and login under your account.
1ftplogin
In the FTP host you should type your domain name or the FTP host provided by your WebHosting company. 99% of all cases your should not experience any difficulties using your domain name as FTP host.Then fill in your FTP username and password for your account.
As soon as you log in a similar content should be displayed on your scree:
httpdocs
Most probably on the left side you should see your local HDD content and on the right side your hosting account content. I will recommend you to create a local folder called backup for example, where you will download your hosting account content.
The content of your website that is directly accessible at http://yourdomain.com is located under the httpdocs directory. If you have any subdomains created (http://subdomain.yourdoman.com) you should copy the content of the subdomains folder as well.
So, first drag and drop the httpdocs folder from the right part to your back up directory on your local computer. Depending on your website size it might take some time to complete the process.
subdomains
As soon as you have your httpdocs folder copied you may copy the whole subdomains directory as well or selectively copy your subdomains content one by one.Please note that if you have uploaded any data under your account out of your httpdocs and subdomains folders it will be good idea to copy it as well on your local HDD.
Export your databases:
Exporting your MySQL databases should not be a problem by following these basic steps below:
First access your Plesk control panel and login by using your Plesk username and password.
Be advised that your main FTP account username and password might be different from your Plesk control panel login credentials.
plesklogin
Wait for a second to have your page reloaded and click on your domain name from bottom of the page.
61
From the new page click on the Databases Icon from the service section
771
From the new page select your database from the list by clicking on its name.
dbnames
This will take you to a new page from where you should click on the DB WebAdmin tool. A new window should be open for you from which you will need to click on your database name (on the top left corner).
In order to add an addon domain to your account you need an addon slot.
You will have to order as many addon slots as the number of addon domains you need to add.
You can order an addon slot from Customer’s Area -> Order Extras.
As soon as the page is reloaded and your database tables are displayed click on the Export thumb on the top. After having your page reloaded you will have several options available.
10101From this screen you should make sure that you have selected all of your database tables (see the screenshot). Additionally, it is recommended to tick the “add drop tables” option before having your database exported. If you need your database in any format different than SQL you can change it via the Export options under the tables list menu.
As soon as you have all the options applied select “Save As File” and click on the “Go” button on the bottom right corner. A question box will be displayed asking for the exact location where you would like to store your MySQL database dump. Select the appropriate location on your local HDD and click Save.
Please note that if you have more than one databases you should export all of the following the instructions above.
Restoring your website on your new cPanel hosting account:
In order to restore your website on your cPanel account you will need to upload your files and databases to your new host. You can easily upload your files by following our video tutorial at:
As soon as you have your httpdocs files and subdomains folders uploaded under your public_html directory you should import your databases. First, you will need to create a new database via your cPanel -> MySQL databases section following the instructions in our tutorial at:
When you have your databases created you should import your mysql dump which you have exported earlier via your cPanel -> phpMyAdmin. Please follow the instructions at:
When you have both your files and databases uploaded on your new host you should reconfigure your application to work with the new hosting enviropment. This can be done by editing your application configuration file. Most probably you will need to modify the mysql database name, username, password and hostname as well as the server path to your new document root for your domain name. The mysql database name, username and password are as you have set them during the creation process in your cPanel -> MySQL database. As for the database hostname — most probably it is localhost — still, you might always contact the support team of your host for the exact database hostname to which your application should connect.
The document root on cPanel hosting servers is usually: /home/your-cpanel-username/public_html/
I hope you will find this tutorial useful. If you experience any difficulties to create your back up just drop a comment and we will be glad to help you by adding further instructions in this tutorial. Be advised that TMDHosting Support team will perform the website transfer for you free of charge as a part of our hosting package. For more information you may check our hosting plan features or contact our representatives via the live chat.
0 Comments
Posted in Arrangement, Art, Business

.htaccess How to make a subfolder the main folder for your primary domain

The primary domain on the hosting account uses the public_html folder for all of its Web site files. Any addon domains use subfolders inside the public_html folder. In order to also set up your primary domain to use a subfolder on your hosting account you will need to set up a redirect in the .htaccess file in the public_html folder so that the server knows that any request for your main domain will be redirected to a subfolder on public_html.
Visitors to your Web site will not be able to tell that your primary domain is using a subfolder, they will still see the Web site address as http://www.yourdomain.com/page.html
Solution
# .htaccess primary domain to subfolder redirect
# Copy and paste the following code into the .htaccess file
# in the public_html folder of your hosting account
# make the changes to the file according to the instructions.
# Do not change this line.
RewriteEngine on
# Change yourdomain.com to be your primary domain.
RewriteCond %{HTTP_HOST} ^(www.)?yourprimarydomain.com$
# Change 'subfolder' to be the folder you will use for your primary domain.
RewriteCond %{REQUEST_URI} !^/subfolder/
# Don't change this line.
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
# Change 'subfolder' to be the folder you will use for your primary domain.
RewriteRule ^(.*)$ /subfolder/$1
# Change yourdomain.com to be your primary domain again.
# Change 'subfolder' to be the folder you will use for your primary domain
# followed by / then the main file for your site, index.php, index.html, etc.
RewriteCond %{HTTP_HOST} ^(www.)?yourmaindomain.com$
RewriteRule ^(/)?$ subfolder/index.php [L]

Saturday, January 11, 2014

0 Comments
Posted in Arrangement, Art, Business

How to disable Magic Quotes GPC module

1.      Log in to cPanel

2.      Open File Manager >> public_html folder >> find php.ini then right click on it >> Edit

Note: If you do not have php.ini generated, please go back to cPanel Home page, then simply click on Tweak php.ini >> Copy >> Modify

3.      Press Ctrl + F in the browser window and type magic_quotes_gpc into the search bar
and change the value to Off

4.      Click on Change button.

5. After this you may wish to add the following line to your htaccess file in order apply changes for all the subfolders you have:


suPHP_ConfigPath /home/cPanel_username/public_html

Wednesday, December 4, 2013

0 Comments
Posted in Arrangement, Art, Business

How To Optimize Your Site With GZIP Compression

Compression is a simple, effective way to save bandwidth and speed up your site. I hesitated when recommending gzip compression when speeding up your javascriptbecause of problems in older browsers.

But it's the 21st century. Most of my traffic comes from modern browsers, and quite frankly, most of my users are fairly tech-savvy. I don't want to slow everyone else down because somebody is chugging along on IE 4.0 on Windows 95. Google and Yahoo use gzip compression. A modern browser is needed to enjoy modern web content and modern web speed -- so gzip encoding it is. Here's how to set it up.

Wait, wait, wait: Why are we doing this?

Before we start I should explain what content encoding is. When you request a file likehttp://www.yahoo.com/index.html, your browser talks to a web server. The conversation goes a little like this:
HTTP_request.png
1. Browser: Hey, GET me /index.html
2. Server: Ok, let me see if index.html is lying around...
3. Server: Found it! Here's your response code (200 OK) and I'm sending the file.
4. Browser: 100KB? Ouch... waiting, waiting... ok, it's loaded.
Of course, the actual headers and protocols are much more formal (monitor them withLive HTTP Headers if you're so inclined).
But it worked, and you got your file.

So what's the problem?

Well, the system works, but it's not that efficient. 100KB is a lot of text, and frankly,HTML is redundant. Every <html>, <table> and <div> tag has a closing tag that's almost the same. Words are repeated throughout the document. Any way you slice it,HTML (and its beefy cousin, XML) is not lean.
And what's the plan when a file's too big? Zip it!
If we could send a .zip file to the browser (index.html.zip) instead of plain old index.html, we'd save on bandwidth and download time. The browser could download the zipped file, extract it, and then show it to user, who's in a good mood because the page loaded quickly. The browser-server conversation might look like this:
HTTP_request_compressed.png
1. Browser: Hey, can I GET index.html? I'll take a compressed version if you've got it.
2. Server: Let me find the file... yep, it's here. And you'll take a compressed version? Awesome.
3. Server: Ok, I've found index.html (200 OK), am zipping it and sending it over.
4. Browser: Great! It's only 10KB. I'll unzip it and show the user.
The formula is simple: Smaller file = faster download = happy user.
Don't believe me? The HTML portion of the yahoo home page goes from 101kb to 15kb after compression:
yahoo_compression.PNG

The (not so) hairy details

The tricky part of this exchange is the browser and server knowing it's ok to send a zipped file over. The agreement has two parts
  • The browser sends a header telling the server it accepts compressed content (gzip and deflate are two compression schemes): Accept-Encoding: gzip, deflate
  • The server sends a response if the content is actually compressed: Content-Encoding: gzip
If the server doesn't send the content-encoding response header, it means the file is not compressed (the default on many servers). The "Accept-encoding" header is just a request by the browser, not a demand. If the server doesn't want to send back compressed content, the browser has to make do with the heavy regular version.

Setting up the server

The "good news" is that we can't control the browser. It either sends the Accept-encoding: gzip, deflate header or it doesn't.
Our job is to configure the server so it returns zipped content if the browser can handle it, saving bandwidth for everyone (and giving us a happy user).
For IIS, enable compression in the settings.
In Apache, enabling output compression is fairly straightforward. Add the following to your .htaccess file:

# compress text, html, javascript, css, xml:
AddOutputFilterByType DEFLATE text/plain
AddOutputFilterByType DEFLATE text/html
AddOutputFilterByType DEFLATE text/xml
AddOutputFilterByType DEFLATE text/css
AddOutputFilterByType DEFLATE application/xml
AddOutputFilterByType DEFLATE application/xhtml+xml
AddOutputFilterByType DEFLATE application/rss+xml
AddOutputFilterByType DEFLATE application/javascript
AddOutputFilterByType DEFLATE application/x-javascript

# Or, compress certain file types by extension:
<files *.html>
SetOutputFilter DEFLATE
</files>

Apache actually has two compression options:
  • mod_deflate is easier to set up and is standard.
  • mod_gzip seems more powerful: you can pre-compress content.
Deflate is quick and works, so I use it; use mod_gzip if that floats your boat. In either case, Apache checks if the browser sent the "Accept-encoding" header and returns the compressed or regular version of the file. However, some older browsers may have trouble (more below) and there are special directives you can add to correct this.
If you can't change your .htaccess file, you can use PHP to return compressed content. Give your HTML file a .php extension and add this code to the top:
In PHP:
<?php if (substr_count($_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip')) ob_start("ob_gzhandler"); else ob_start(); ?>
We check the "Accept-encoding" header and return a gzipped version of the file (otherwise the regular version). This is almost like building your own webserver (what fun!). But really, try to use Apache to compress your output if you can help it. You don't want to monkey with your files.

Verify Your Compression

Once you've configured your server, check to make sure you're actually serving up compressed content.
  • Online: Use the online gzip test to check whether your page is compressed.
  • In your browser: Use Web Developer Toolbar > Information > View Document Size (like I did for Yahoo, above) to see whether the page is compressed.
  • View the headers: Use Live HTTP Headers to examine the response. Look for a line that says "Content-encoding: gzip".
Be prepared to marvel at the results. The instacalc homepage shrunk from 36k to 10k, a 75% reduction in size.

Try Some Examples

I've set up some pages and a downloadable example:
  • index.html - No explicit compression (on this server, I am using compression by default :) ).
  • index.htm - Explicitly compressed with Apache .htaccess using *.htm as a rule
  • index.php - Explicitly compressed using the PHP header
Feel free to download the files, put them on your server and tweak the settings.

Caveats

As exciting as it may appear, HTTP Compression isn't all fun and games. Here's what to watch out for:
  • Older browsers: Yes, some browsers still may have trouble with compressed content (they say they can accept it, but really they can't). If your site absolutely must work with Netscape 1.0 on Windows 95, you may not want to use HTTPCompression. Apache mod_deflate has some rules to avoid compression for older browsers.
  • Already-compressed content: Most images, music and videos are already compressed. Don't waste time compressing them again. In fact, you probably only need to compress the "big 3" (HTML, CSS and Javascript).
  • CPU-load: Compressing content on-the-fly uses CPU time and saves bandwidth. Usually this is a great tradeoff given the speed of compression. There are ways to pre-compress static content and send over the compressed versions. This requires more configuration; even if it's not possible, compressing output may still be a net win. Using CPU cycles for a faster user experience is well worth it, given the short attention spans on the web.
Enabling compression is one of the fastest ways to improve your site's performance. Go forth, set it up, and let your users enjoy the benefits.

    Blogger news

    Blogroll

    About