<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Shanghai Web Hosting &#187; Web Hosting Tips</title>
	<atom:link href="http://www.shanghaiwebhosting.com/category/web-hosting-tips/feed" rel="self" type="application/rss+xml" />
	<link>http://www.shanghaiwebhosting.com</link>
	<description>Web Hosting News, Deals and Reviews &#124; Web Hosting Tips &#38; Tutorials &#124; China Web Hosting Reviews of Shanghai Hosting Providers</description>
	<lastBuildDate>Sat, 14 Jan 2012 11:21:03 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Get Server CPU Usage of A Specific User</title>
		<link>http://www.shanghaiwebhosting.com/web-hosting-tips/get-server-cpu-usage-of-a-specific-user</link>
		<comments>http://www.shanghaiwebhosting.com/web-hosting-tips/get-server-cpu-usage-of-a-specific-user#comments</comments>
		<pubDate>Sun, 08 Jan 2012 07:22:35 +0000</pubDate>
		<dc:creator>China Hosting Provider</dc:creator>
				<category><![CDATA[Host Server Administration]]></category>
		<category><![CDATA[SSH Hosting]]></category>
		<category><![CDATA[VPS Hosting]]></category>
		<category><![CDATA[Web Hosting Tips]]></category>

		<guid isPermaLink="false">http://www.shanghaiwebhosting.com/?p=342</guid>
		<description><![CDATA[Suppose your user name is jimgreen and you can run the following command to get a very specific CPU usage of it in real time: top -b -n 1 -u jimgreen &#124; awk 'NR&#62;7 { sum += $9; } END { print sum; }' You can even further capture the usage metric in PHP and [...]]]></description>
			<content:encoded><![CDATA[<p>Suppose your user name is <strong>jimgreen</strong> and you can run the following command to get a very specific CPU usage of it in real time:</p>
<pre><code>top -b -n 1 -u <strong>jimgreen</strong> | awk 'NR&gt;7 { sum += $9; } END { print sum; }'</code></pre>
<p>You can even further capture the usage metric in PHP and do conditional actions:<br />
<code>$usage = shell_exec("top -b -n 1 -u <strong>jimgreen</strong> | awk 'NR&gt;7 { sum += $9; } END { print sum; }'");</code><br />
Now $usage contains the CPU usage of the user <strong>jimgreen</strong>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.shanghaiwebhosting.com/web-hosting-tips/get-server-cpu-usage-of-a-specific-user/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to count the number of files in a tar archive?</title>
		<link>http://www.shanghaiwebhosting.com/web-hosting-tips/how-to-count-the-number-of-files-in-a-tar-archive</link>
		<comments>http://www.shanghaiwebhosting.com/web-hosting-tips/how-to-count-the-number-of-files-in-a-tar-archive#comments</comments>
		<pubDate>Sat, 14 Aug 2010 13:31:41 +0000</pubDate>
		<dc:creator>China Hosting Provider</dc:creator>
				<category><![CDATA[Host Server Administration]]></category>
		<category><![CDATA[Linux Web Hosting]]></category>
		<category><![CDATA[SSH Hosting]]></category>
		<category><![CDATA[Web Hosting Tips]]></category>

		<guid isPermaLink="false">http://www.shanghaiwebhosting.com/?p=255</guid>
		<description><![CDATA[So you have a tar archive file and you want to know the number of files in it without expanding it. You know the text counter program &#8216;wc&#8217;? You can count the number of lines from the input by: wc -l file.txt You know how to list the content (files and directories) of a tar [...]]]></description>
			<content:encoded><![CDATA[<p>So you have a tar archive file and you want to know the number of files in it without expanding it. You know the text counter program &#8216;wc&#8217;? You can count the number of lines from the input by:</p>
<pre><code>wc -l file.txt</code></pre>
<p>You know how to list the content (files and directories) of a tar archive?</p>
<pre><code>tar --list example.tar</code></pre>
<p>Now you just combine these two to count the number of lines of the files list of the tar archive:</p>
<pre><code>tar --list example.tar | wc -l</code></pre>
<p>So that you have the number of files in the tar file example.tar. The pipe means relaying the output of the previous command to the next command as input.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.shanghaiwebhosting.com/web-hosting-tips/how-to-count-the-number-of-files-in-a-tar-archive/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to find out the number of users on your hosting server?</title>
		<link>http://www.shanghaiwebhosting.com/web-hosting-tips/how-to-find-out-the-number-of-users-on-your-hosting-server</link>
		<comments>http://www.shanghaiwebhosting.com/web-hosting-tips/how-to-find-out-the-number-of-users-on-your-hosting-server#comments</comments>
		<pubDate>Fri, 21 Aug 2009 15:28:26 +0000</pubDate>
		<dc:creator>China Hosting Provider</dc:creator>
				<category><![CDATA[SSH Hosting]]></category>
		<category><![CDATA[Web Hosting Tips]]></category>

		<guid isPermaLink="false">http://www.shanghaiwebhosting.com/?p=175</guid>
		<description><![CDATA[How many user accounts are there on your hosting server? You can look up the number of server user accounts by the following command via SSH: wc -l /etc/passwd And it may output something like this: 76 /etc/passwd Which means there are a total of 76 active users in the system. However, the actual number [...]]]></description>
			<content:encoded><![CDATA[<p>How many user accounts are there on your hosting server? You can look up the number of server user accounts by the following command via SSH:</p>
<p><code>wc -l /etc/passwd</code></p>
<p>And it may output something like this:</p>
<p><code>76 /etc/passwd</code></p>
<p>Which means there are a total of 76 active users in the system. However, the actual number of human users of the server should be lower than the amount because there are system users created to carry out certain tasks.</p>
<p>Multiply the amount by 5 and you may get a rough number of websites hosted on your server.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.shanghaiwebhosting.com/web-hosting-tips/how-to-find-out-the-number-of-users-on-your-hosting-server/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Create a local static mirror of your WordPress blog by SSH command wget</title>
		<link>http://www.shanghaiwebhosting.com/web-hosting-tips/create-a-local-static-mirror-of-your-wordpress-blog-by-ssh-command-wget</link>
		<comments>http://www.shanghaiwebhosting.com/web-hosting-tips/create-a-local-static-mirror-of-your-wordpress-blog-by-ssh-command-wget#comments</comments>
		<pubDate>Sun, 02 Aug 2009 09:05:55 +0000</pubDate>
		<dc:creator>China Hosting Provider</dc:creator>
				<category><![CDATA[Linux Web Hosting]]></category>
		<category><![CDATA[SSH Hosting]]></category>
		<category><![CDATA[Web Hosting Tips]]></category>

		<guid isPermaLink="false">http://www.shanghaiwebhosting.com/?p=171</guid>
		<description><![CDATA[wget command should be available in most hosting companies who offer SSH access to your hosting account. It is usually used to download stuff from the remote server, for example, to download something: wget http://www.google.com/money.zip However, there&#8217;s yet another hidden trick of wget that could enable you to make a mirror backup of any website [...]]]></description>
			<content:encoded><![CDATA[<p><strong>wget</strong> command should be available in most hosting companies who offer SSH access to your hosting account. It is usually used to download stuff from the remote server, for example, to download something:</p>
<p><code>wget http://www.google.com/money.zip</code></p>
<p>However, there&#8217;s yet another hidden trick of <strong>wget</strong> that could enable you to make a mirror backup of any website &#8211; well, not actually any website but wget feels more comfortable with certain sites. WordPress blogs are perfect candidates for wget to mirror. Mirroring a WordPress blog can be done by a very simple switch of the <a href="http://www.kavoir.com/2009/08/linux-wget-command-to-download-and-mirror-a-website-in-static-local-copy.html">wget command through SSH</a>:</p>
<p><code>wget -mk http://www.example.com</code></p>
<p>All the documents relationships and HTML links will be taken care of so that local browsing of the mirrored copy will be completely no problem.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.shanghaiwebhosting.com/web-hosting-tips/create-a-local-static-mirror-of-your-wordpress-blog-by-ssh-command-wget/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Change and Increase the Max PHP File Uploading Limit</title>
		<link>http://www.shanghaiwebhosting.com/web-hosting-tips/change-and-increase-the-max-php-file-uploading-limit</link>
		<comments>http://www.shanghaiwebhosting.com/web-hosting-tips/change-and-increase-the-max-php-file-uploading-limit#comments</comments>
		<pubDate>Sun, 21 Jun 2009 12:48:05 +0000</pubDate>
		<dc:creator>China Hosting Provider</dc:creator>
				<category><![CDATA[Host Server Administration]]></category>
		<category><![CDATA[SSH Hosting]]></category>
		<category><![CDATA[Web Hosting Tips]]></category>

		<guid isPermaLink="false">http://www.shanghaiwebhosting.com/?p=159</guid>
		<description><![CDATA[The default php configuration comes with a hard cap of 2MB on the size of uploaded file determined by the php.ini directive upload_max_filesize in conjunction with post_max_size. The maximum uploading size of a file is the lower. Therefore, to increase the uploading cap and raise uploading limit, you will need to edit those 2 directives [...]]]></description>
			<content:encoded><![CDATA[<p>The default php configuration comes with a hard cap of 2MB on the size of uploaded file determined by the php.ini directive <strong>upload_max_filesize</strong> in conjunction with <strong>post_max_size</strong>. The maximum uploading size of a file is the lower. Therefore, to increase the uploading cap and raise uploading limit, you will need to edit those 2 directives in php.ini.</p>
<p><a href="http://www.kavoir.com/2009/06/where-is-phpini-located.html">The location of php.ini</a> varies distribution by distribution, in this example, with Ubuntu 9.04 Jaunty, php.ini is located at /etc/php5/apache2/php.ini, so</p>
<p><code>sudo vi /etc/php5/apache2/php.ini</code></p>
<p>Press / to find upload_max_filesize and change it to, say 8M:</p>
<p><code>upload_max_filesize = 8M</code></p>
<p>Press ESC, :, wq and Enter. Now the php.ini is saved with the new uploading file limit. Reload apache2 to read the new configurations:</p>
<p><code>sudo /etc/init.d/apache2 reload</code></p>
<p>Now you should be able to upload any file up to 8MB in size, in case you need larger uploading limit, in addition to change <strong>upload_max_filesize</strong> to, say, 16M, you must also edit <strong>post_max_size</strong> to more than or equaling to 16M because file uploads are processed through HTTP POST method.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.shanghaiwebhosting.com/web-hosting-tips/change-and-increase-the-max-php-file-uploading-limit/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Best Books about Apache mod_rewrite Module, .htaccess Books</title>
		<link>http://www.shanghaiwebhosting.com/web-hosting-tips/best-books-about-apache-mod_rewrite-module-htaccess-books</link>
		<comments>http://www.shanghaiwebhosting.com/web-hosting-tips/best-books-about-apache-mod_rewrite-module-htaccess-books#comments</comments>
		<pubDate>Wed, 17 Jun 2009 02:26:58 +0000</pubDate>
		<dc:creator>China Hosting Provider</dc:creator>
				<category><![CDATA[Web Hosting Books]]></category>
		<category><![CDATA[Web Hosting Tips]]></category>

		<guid isPermaLink="false">http://www.shanghaiwebhosting.com/web-hosting-tips/best-books-about-apache-mod_rewrite-module-htaccess-books</guid>
		<description><![CDATA[mod_rewrite is universally acknowledged as one of the best modules of Apache, simple yet powerful. It&#8217;s one of the top reasons why Apache is the best web server. These are some books found at Amazon on Apache mod_rewrite and how to use it in .htaccess directives. Web Developers / Designers&#8217; Books: Best HTML Books Best CSS [...]]]></description>
			<content:encoded><![CDATA[<p><strong>mod_rewrite</strong> is universally acknowledged as one of the best modules of Apache, simple yet powerful. It&#8217;s one of the top reasons why Apache is the best web server. These are some books found at Amazon on Apache mod_rewrite and how to use it in .htaccess directives.</p>
<h4>Web Developers / Designers&#8217; Books:</h4>
<ol>
<li><a href="http://www.kavoir.com/2009/06/best-books-of-html-and-xhtml-to-learn-how-to-create-web-pages-sites-with-html-and-css.html">Best  HTML Books</a></li>
<li><a href="http://www.kavoir.com/2009/06/best-css-books-to-learn-css-web-design.html">Best  CSS Books</a></li>
<li><a href="http://www.kavoir.com/2009/06/best-javascript-books-for-learning-javascript-programming-and-development.html">Best  JavaScript Books</a></li>
<li><a href="http://www.kavoir.com/2009/06/best-php-books-for-learning-php-and-mysql.html">Best  PHP Books</a></li>
<li><a href="http://www.kavoir.com/2009/06/best-mysql-books-to-learn-mysql-database-php-applications.html">Best  MySQL Books</a></li>
<li><a href="../web-hosting-tutorials/best-linux-server-administration-books-for-learning-linux">Best  Linux Books</a></li>
<li><a href="http://www.kavoir.com/2009/06/best-books-of-apache-web-server-to-learn-apache-and-use-it.html">Best  Apache Books</a> (<a href="../web-hosting-tips/best-books-about-apache-mod_rewrite-module-htaccess-books">mod_rewrite  Books</a>)</li>
<li><a href="../web-hosting-tutorials/best-web-hosting-books-to-learn-about-web-hosting">Best  Web Hosting Books</a></li>
</ol>
<h4><a href="http://www.amazon.com/gp/product/1590595610?ie=UTF8&amp;tag=maawe-20&amp;linkCode=as2&amp;camp=1789&amp;creative=390957&amp;creativeASIN=1590595610">The Definitive Guide to Apache mod_rewrite</a></h4>
<p><a href="http://www.amazon.com/gp/product/1590595610?ie=UTF8&amp;tag=maawe-20&amp;linkCode=as2&amp;camp=1789&amp;creative=390957&amp;creativeASIN=1590595610"><img style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" title="The Definitive Guide to Apache mod_rewrite" src="http://www.shanghaiwebhosting.com/wp-content/uploads/2009/06/TheDefinitiveGuidetoApachemod_rewrite.jpg" border="0" alt="The Definitive Guide to Apache mod_rewrite" width="206" height="248" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.shanghaiwebhosting.com/web-hosting-tips/best-books-about-apache-mod_rewrite-module-htaccess-books/feed</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>How to know the physical location of a website domain or tell where a site is hosted?</title>
		<link>http://www.shanghaiwebhosting.com/web-hosting/how-to-know-the-physical-location-of-a-website-domain-or-tell-where-a-site-is-hosted</link>
		<comments>http://www.shanghaiwebhosting.com/web-hosting/how-to-know-the-physical-location-of-a-website-domain-or-tell-where-a-site-is-hosted#comments</comments>
		<pubDate>Sat, 06 Jun 2009 14:05:42 +0000</pubDate>
		<dc:creator>China Hosting Provider</dc:creator>
				<category><![CDATA[Hosting Tools]]></category>
		<category><![CDATA[Web Hosting]]></category>
		<category><![CDATA[Web Hosting Tips]]></category>

		<guid isPermaLink="false">http://www.shanghaiwebhosting.com/web-hosting/how-to-know-the-physical-location-of-a-website-domain-or-tell-where-a-site-is-hosted</guid>
		<description><![CDATA[To trace and know where a website is hosted physically (server location), you will first get its IP address and then query it for the geo location. Many online tools and IP databases offer such free services such as IP to Location. It not only converts the IP to a physical location but also tries [...]]]></description>
			<content:encoded><![CDATA[<p>To trace and know where a website is hosted physically (server location), you will first get its IP address and then query it for the geo location. Many online tools and IP databases offer such free services such as <a href="http://www.ip2location.com/free.asp">IP to Location</a>. It not only converts the IP to a physical location but also tries to give the institution (companies, data centers, national organizations, etc.) that&#8217;s responsible for the IP address based on IP ranges distribution table with an option to map the IP geographically.</p>
<p>Oh wait, I think I forget about how to get the IP address of a website. All after all, you can ping the domain name to get the IP address of the site from command line. Or, you can use domain IP lookup tools such as <a href="http://www.yougetsignal.com/tools/web-sites-on-web-server/">this one</a>. It not only gives you the IP address of the particular domain URL but also pokes the server around and guesses what other sites are possibly being hosted on that IP.</p>
<p>Actually, there&#8217;s a much simpler one to consult when you need to know the physical location of a site and where the website is hosted: <a href="http://whois.domaintools.com">Domain Tools</a>. By querying a domain, it gives you the IP where the domain / site is currently hosted and also the organization or data center (might be a hosting company) that&#8217;s administering the IP. Very good tool to know where a site or domain is hosted.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.shanghaiwebhosting.com/web-hosting/how-to-know-the-physical-location-of-a-website-domain-or-tell-where-a-site-is-hosted/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Backup and synchronize files between 2 or more hosting servers</title>
		<link>http://www.shanghaiwebhosting.com/web-hosting-tips/backup-and-synchronize-files-between-2-or-more-hosting-servers</link>
		<comments>http://www.shanghaiwebhosting.com/web-hosting-tips/backup-and-synchronize-files-between-2-or-more-hosting-servers#comments</comments>
		<pubDate>Sun, 31 May 2009 06:56:28 +0000</pubDate>
		<dc:creator>China Hosting Provider</dc:creator>
				<category><![CDATA[Storage & Backup Hosting]]></category>
		<category><![CDATA[Web Hosting Tips]]></category>

		<guid isPermaLink="false">http://www.shanghaiwebhosting.com/?p=99</guid>
		<description><![CDATA[This kind of redundancy is encouraged to protect potential loss of important data, such as essential website programs and databases. After installing rsync on all peer hosting servers you own, you can easily backup stuff and synchronize them among the servers for a safe data redundancy. rsync -e 'ssh -p 25000' -avl --delete --stats --progress [...]]]></description>
			<content:encoded><![CDATA[<p>This kind of redundancy is encouraged to protect potential loss of important data, such as essential website programs and databases.</p>
<p>After installing rsync on all peer hosting servers you own, you can easily backup stuff and synchronize them among the servers for a safe data redundancy.</p>
<p><code>rsync -e 'ssh -p 25000' -avl --delete --stats --progress user1@123.45.67.890:/home/user1 /backup</code></p>
<p>This simple command will take care of everything for you, the rsync command connects to the remote server 123.45.67.890 as user1 and backups or synchronizes everything in /home/user1 from the remote server to the local directory /backup. The &#8211;delete switch indicates that files that previously existed at /home/user1 on the remote server but not now will be also deleted in /backup at the local server.</p>
<p>&#8216;ssh -p 25000&#8242; prescribes rsync to connect via SSH on port 25000.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.shanghaiwebhosting.com/web-hosting-tips/backup-and-synchronize-files-between-2-or-more-hosting-servers/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>vi code highlighting: change the default comments color from dark blue to light blue</title>
		<link>http://www.shanghaiwebhosting.com/web-hosting-tips/vi-code-highlighting-change-the-default-comments-color-from-dark-blue-to-light-blue</link>
		<comments>http://www.shanghaiwebhosting.com/web-hosting-tips/vi-code-highlighting-change-the-default-comments-color-from-dark-blue-to-light-blue#comments</comments>
		<pubDate>Sun, 31 May 2009 06:00:05 +0000</pubDate>
		<dc:creator>China Hosting Provider</dc:creator>
				<category><![CDATA[Host Server Administration]]></category>
		<category><![CDATA[SSH Hosting]]></category>
		<category><![CDATA[Web Hosting Tips]]></category>

		<guid isPermaLink="false">http://www.shanghaiwebhosting.com/?p=87</guid>
		<description><![CDATA[The default colors for comments (texts in /* */ or following // or #, &#8230;) in vi code highlighting are a little too dark. Ever wanted to make it more recognizable in SSH console? Find and edit /etc/vim/vimrc with vi: vi /etc/vim/vimrc And add in this line: colorscheme desert Wherein desert is one of the [...]]]></description>
			<content:encoded><![CDATA[<p>The default colors for comments (texts in /* */ or following // or #, &#8230;) in vi code highlighting are a little too dark. Ever wanted to make it more recognizable in SSH console?</p>
<p>Find and edit /etc/vim/vimrc with vi:</p>
<p><code>vi /etc/vim/vimrc</code></p>
<p>And add in this line:</p>
<p><code>colorscheme desert</code></p>
<p>Wherein desert is one of the available color schemes vim comes with. Now we will need to edit the actual color scheme file and change the highlighting colors:</p>
<p><code>/usr/share/vim/vimcurrent/colors/desert.vim</code></p>
<p>Change:</p>
<p><code>hi Comment      ctermfg=darkcyan</code></p>
<p>To:</p>
<p><code>hi Comment      ctermfg=blue</code></p>
<p>Save the change and exit. Run:</p>
<p><code>source /etc/vim/vimrc</code></p>
<p>And the changes will now take effect.</p>
<p>The default directory color of ls &#8211;color is also too dark, you can learn how to <a href="http://www.shanghaiwebhosting.com/web-hosting-tips/use-shell-environment-variable-ls_colors-to-change-directory-listing-colors-of-ls-color">change the default directory color of ls &#8211;color</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.shanghaiwebhosting.com/web-hosting-tips/vi-code-highlighting-change-the-default-comments-color-from-dark-blue-to-light-blue/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Use Shell Environment Variable LS_COLORS to Change Directory Listing Colors of ls &#8211;color</title>
		<link>http://www.shanghaiwebhosting.com/web-hosting-tips/use-shell-environment-variable-ls_colors-to-change-directory-listing-colors-of-ls-color</link>
		<comments>http://www.shanghaiwebhosting.com/web-hosting-tips/use-shell-environment-variable-ls_colors-to-change-directory-listing-colors-of-ls-color#comments</comments>
		<pubDate>Sun, 31 May 2009 05:59:39 +0000</pubDate>
		<dc:creator>China Hosting Provider</dc:creator>
				<category><![CDATA[Host Server Administration]]></category>
		<category><![CDATA[SSH Hosting]]></category>
		<category><![CDATA[Web Hosting Tips]]></category>

		<guid isPermaLink="false">http://www.shanghaiwebhosting.com/?p=88</guid>
		<description><![CDATA[After you have enabled the color switch of ls command in shell console, it&#8217;s nice but some may complain that the deep blue color of the directories are too dark to recognize sometimes. Let&#8217;s change that. Just open up the .profile or .bash_profile file under your home directory and put this line in it: export [...]]]></description>
			<content:encoded><![CDATA[<p>After you have <a href="http://www.shanghaiwebhosting.com/web-hosting-tips/colorful-ls-ssh-console-and-command-prompt">enabled the color switch of ls command</a> in shell console, it&#8217;s nice but some may complain that the deep blue color of the directories are too dark to recognize sometimes. Let&#8217;s change that.</p>
<p>Just open up the .profile or .bash_profile file under your home directory and put this line in it:</p>
<p><code>export LS_COLORS='di=01;34'</code></p>
<p>Done! Now the color of the ls directory listings is much lighter and easier to recognize. There&#8217;s also a tip of <a href="http://www.shanghaiwebhosting.com/web-hosting-tips/vi-code-highlighting-change-the-default-comments-color-from-dark-blue-to-light-blue">how to change the default dark color for comments in vi text editor</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.shanghaiwebhosting.com/web-hosting-tips/use-shell-environment-variable-ls_colors-to-change-directory-listing-colors-of-ls-color/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Colorful ls, SSH Console and Command Prompt</title>
		<link>http://www.shanghaiwebhosting.com/web-hosting-tips/colorful-ls-ssh-console-and-command-prompt</link>
		<comments>http://www.shanghaiwebhosting.com/web-hosting-tips/colorful-ls-ssh-console-and-command-prompt#comments</comments>
		<pubDate>Sun, 31 May 2009 05:45:55 +0000</pubDate>
		<dc:creator>China Hosting Provider</dc:creator>
				<category><![CDATA[SSH Hosting]]></category>
		<category><![CDATA[Web Hosting Tips]]></category>

		<guid isPermaLink="false">http://www.shanghaiwebhosting.com/?p=84</guid>
		<description><![CDATA[Add the following snippet in the .profile or .bash_profile under your home directory: export PS1='[\[\e[1;31m\]\u\[\e[0m\] - \[\e[32m\]\w\[\e[0m\]]$ ' export LS_COLORS='di=01;34' alias ls='ls --color -l' If you are &#8216;supergirl&#8217;, your Linux home directory would be located at: /home/supergirl, and the file you should add the above lines to is: /home/supergirl/.profile or /home/supergirl/.bash_profile. What is LS_COLORS doing [...]]]></description>
			<content:encoded><![CDATA[<p>Add the following snippet in the .profile or .bash_profile under your home directory:</p>
<pre><code>export PS1='[\[\e[1;31m\]\u\[\e[0m\] - \[\e[32m\]\w\[\e[0m\]]$ '
export LS_COLORS='di=01;34'
alias ls='ls --color -l'</code></pre>
<p>If you are &#8216;supergirl&#8217;, your Linux home directory would be located at: /home/supergirl, and the file you should add the above lines to is: /home/supergirl/.profile or /home/supergirl/.bash_profile.</p>
<p>What is <a href="http://www.shanghaiwebhosting.com/web-hosting-tips/use-shell-environment-variable-ls_colors-to-change-directory-listing-colors-of-ls-color">LS_COLORS</a> doing here?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.shanghaiwebhosting.com/web-hosting-tips/colorful-ls-ssh-console-and-command-prompt/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Linux SSH commands to show and monitor server resources and real-time performance: memory, swap, disk usage, CPU usage and I/O &#8230;</title>
		<link>http://www.shanghaiwebhosting.com/web-hosting-tips/a-few-useful-linux-ssh-commands-to-show-and-monitor-server-resources-memory-disk-usage</link>
		<comments>http://www.shanghaiwebhosting.com/web-hosting-tips/a-few-useful-linux-ssh-commands-to-show-and-monitor-server-resources-memory-disk-usage#comments</comments>
		<pubDate>Sun, 31 May 2009 05:27:51 +0000</pubDate>
		<dc:creator>China Hosting Provider</dc:creator>
				<category><![CDATA[Host Server Administration]]></category>
		<category><![CDATA[SSH Hosting]]></category>
		<category><![CDATA[Web Hosting Tips]]></category>

		<guid isPermaLink="false">http://www.shanghaiwebhosting.com/?p=79</guid>
		<description><![CDATA[Below are a few general commands found in most popular Linux distros which you can use via SSH to check the status of your hosting server. To show used and available RAM memory and swap space usage: free -m To show current disk storage usage by mounted device: df To show disk usage statistics of [...]]]></description>
			<content:encoded><![CDATA[<p>Below are a few general commands found in most popular Linux distros which you can use via SSH to check the status of your hosting server.</p>
<p>To show used and available RAM memory and swap space usage:</p>
<p><code>free -m</code></p>
<p>To show current disk storage usage by mounted device:</p>
<p><code>df</code></p>
<p>To show disk usage statistics of the current directory by directories and files:</p>
<p><code>du</code></p>
<p>To show the hard disk space a directory or a file takes up:</p>
<p><code>du filename</code></p>
<p>To show the length of time this server has been up and the server loads in the past 1 minute, 5 minutes and 15 minutes:</p>
<p><code>uptime</code></p>
<p>To display a real-time updated server resource usage including: server uptime, user logged on, load average, current tasks, CPU usage, memory usage and swap usage:</p>
<p><code>top</code></p>
<p>To display a list of real-time active or sleeping processes your server is up to:</p>
<p><code>ps</code></p>
<p>To show some information about the current status of virtual memory, CPU usage, I/O usage:</p>
<p><code>vmstat</code></p>
<p>This is also a good tool to find out system performance bottlenecks.</p>
<p>To display currently logged on users on the system:</p>
<p><code>w</code></p>
<p>Or</p>
<p><code>who</code></p>
<p>To print a full screen text graph of the server load refreshed every few seconds:</p>
<p><code>tload</code></p>
<p>If you are on shared hosting, chances are your server usage has been imposed some hard limits such as the largest amount of files / directories possible and the hard storage limit. View them by:</p>
<p><code>quota</code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.shanghaiwebhosting.com/web-hosting-tips/a-few-useful-linux-ssh-commands-to-show-and-monitor-server-resources-memory-disk-usage/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Quick tip: 256 MB VPS helps you no more than shared hosting</title>
		<link>http://www.shanghaiwebhosting.com/web-hosting-tips/quick-tip-256-mb-vps-helps-you-no-more-than-shared-hosting</link>
		<comments>http://www.shanghaiwebhosting.com/web-hosting-tips/quick-tip-256-mb-vps-helps-you-no-more-than-shared-hosting#comments</comments>
		<pubDate>Tue, 26 May 2009 03:29:47 +0000</pubDate>
		<dc:creator>China Hosting Provider</dc:creator>
				<category><![CDATA[Hosting SEO]]></category>
		<category><![CDATA[VPS Hosting]]></category>
		<category><![CDATA[Web Hosting Tips]]></category>

		<guid isPermaLink="false">http://www.shanghaiwebhosting.com/?p=56</guid>
		<description><![CDATA[256MB being the startup plan from most VPS providers will be no better than a shared hosting plan from affordable hosting providers. 384MB may seem to be a 128MB extra but actually just slightly more. As a result of the nature of VPS, an entire operating system (such as Linux distributions: Ubuntu, Debian or Centos, [...]]]></description>
			<content:encoded><![CDATA[<p>256MB being the startup plan from most VPS providers will be no better than a shared hosting plan from affordable hosting providers. 384MB may seem to be a 128MB extra but actually just slightly more.</p>
<p>As a result of the nature of VPS, an entire operating system (such as Linux distributions: <a href="http://www.ubuntu.com/">Ubuntu</a>, <a href="http://www.debian.org/">Debian</a> or <a href="http://www.centos.org/">Centos</a>, and so forth) resides in it with a complete web server package: <a href="http://httpd.apache.org/">Apache</a>, <a href="http://www.php.net">PHP</a>, <a href="http://www.mysql.com/">MySQL</a> and potentially a lot of necessary modules and extensions, making the mere hosting slice of 256MB a frugal choice to cover all the overheads, much like the <a href="http://www.econguru.com/introduction_to_economics/scope-method.html#abc">sunk cost</a> in Economics. It is after the threshold of 256MB that every additional MB of RAM you purchase will be consumed by your own websites rather than by the system. Well, not precisely all of 256MB will be used for the system, but you are left with like <strong>50MB &#8211; 100MB</strong> from the whole 256MB pie after installing everything WWW and getting your slice ready for websites.</p>
<p>So if you are going to switch to a VPS, make sure you board on at least 512MB memeory for a start or it won&#8217;t be worth the while and it may just be good enough to spread your sites across various shared hosting plans (preferrably from various distant hosting comapnies) for some SEO advantage.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.shanghaiwebhosting.com/web-hosting-tips/quick-tip-256-mb-vps-helps-you-no-more-than-shared-hosting/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>How to know whether your host is overselling?</title>
		<link>http://www.shanghaiwebhosting.com/choosing-a-web-host/how-to-know-whether-your-host-is-overselling</link>
		<comments>http://www.shanghaiwebhosting.com/choosing-a-web-host/how-to-know-whether-your-host-is-overselling#comments</comments>
		<pubDate>Tue, 14 Apr 2009 05:39:49 +0000</pubDate>
		<dc:creator>China Hosting Provider</dc:creator>
				<category><![CDATA[Choosing A Web Host]]></category>
		<category><![CDATA[SSH Hosting]]></category>
		<category><![CDATA[Web Hosting Tips]]></category>

		<guid isPermaLink="false">http://www.shanghaiwebhosting.com/?p=32</guid>
		<description><![CDATA[Take on a trial which DreamHost offers or ask a friend at some hosting company to do some tests on SSH: Check for the number of server processors or CPUs Check for the average load the server is experiencing Get the 3 load average figures divided by the number of CPU they have on the [...]]]></description>
			<content:encoded><![CDATA[<p>Take on a trial which <a href="http://www.shanghaiwebhosting.com/web-hosting/web-hosting-coupons-dreamhost-promo-code">DreamHost</a> offers or ask a friend at some hosting company to do some tests on SSH:</p>
<ol>
<li>Check for <a href="http://www.shanghaiwebhosting.com/web-hosting/simple-ssh-linux-command-to-display-the-number-of-cpus-processors-of-your-hosting-server">the number of server processors or CPUs</a></li>
<li>Check for the <a href="http://www.shanghaiwebhosting.com/choosing-a-web-host/check-for-hosting-server-load-with-linux-ssh-command-uptime">average load the server is experiencing</a></li>
</ol>
<p>Get the 3 load average figures divided by the number of CPU they have on the server, add them up and further divide them by 3. With the final result:</p>
<ul>
<li>result &lt;= 1 ( definitely an honest and great host)</li>
<li>1 &lt; result &lt;= 2 (good one, but questionable)</li>
<li>2 &lt; result &lt;= 5 (overselling, overselling, overselling, &#8230;)</li>
<li>result &gt; 5 (are you crazy?!)</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.shanghaiwebhosting.com/choosing-a-web-host/how-to-know-whether-your-host-is-overselling/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Check for Hosting Server Load with Linux (SSH) Command &#8216;uptime&#8217;</title>
		<link>http://www.shanghaiwebhosting.com/choosing-a-web-host/check-for-hosting-server-load-with-linux-ssh-command-uptime</link>
		<comments>http://www.shanghaiwebhosting.com/choosing-a-web-host/check-for-hosting-server-load-with-linux-ssh-command-uptime#comments</comments>
		<pubDate>Tue, 14 Apr 2009 05:27:38 +0000</pubDate>
		<dc:creator>China Hosting Provider</dc:creator>
				<category><![CDATA[Choosing A Web Host]]></category>
		<category><![CDATA[SSH Hosting]]></category>
		<category><![CDATA[Web Hosting Tips]]></category>

		<guid isPermaLink="false">http://www.shanghaiwebhosting.com/?p=29</guid>
		<description><![CDATA[Some of the hosting providers out there are infamous for overselling who try their best to stuff in as many users (websites) as possible into a single web hosting server. High server load is an indicator of how your server is performing and whether it is laboring too much thus jeopardizing the performance of your [...]]]></description>
			<content:encoded><![CDATA[<p>Some of the hosting providers out there are infamous for overselling who try their best to stuff in as many users (websites) as possible into a single web hosting server. High server load is an indicator of how your server is performing and whether it is laboring too much thus jeopardizing the performance of your websites. You can get to know the average load in the last 15 minutes of your server by the simple Linux command below (via SSH):</p>
<p><code>uptime</code></p>
<p>Which will typically return a line of data similar to this:</p>
<p><code>21:39:33 up 10:45,  3 users,  load average: 4.46, 3.92, 3.64</code></p>
<p>That says there are currently 3 users logged on and the load average of this server in the <strong>last minute</strong>, <strong>last 5 minutes</strong> and <strong>last 15 minutes</strong> are 4.46, 3.92 and 3.64. These figures represent the number of runnable processes at the same time on average for the CPUs (processor) to process. Combined with <a href="http://www.shanghaiwebhosting.com/web-hosting/simple-ssh-linux-command-to-display-the-number-of-cpus-processors-of-your-hosting-server">number of processors of the server</a>, you may know how many processes are being processed by any single CPU.</p>
<p>Considering the fact that any CPU can only take on one process at any given time, there will possibly be processes waiting in the queue &#8211; meaning server is overloaded. Therefore, if the <a href="http://www.shanghaiwebhosting.com/web-hosting/simple-ssh-linux-command-to-display-the-number-of-cpus-processors-of-your-hosting-server">number of processors</a> of your hosting server is 4, in the last minute, it is overloaded by ( 4.46 / 4 ) &#8211; 100% = 11.5%.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.shanghaiwebhosting.com/choosing-a-web-host/check-for-hosting-server-load-with-linux-ssh-command-uptime/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>

