<?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; SSH Hosting</title>
	<atom:link href="http://www.shanghaiwebhosting.com/category/ssh-hosting/feed" rel="self" type="application/rss+xml" />
	<link>http://www.shanghaiwebhosting.com</link>
	<description>China Web Hosting Reviews of Shanghai Hosting Providers &#124; Web Hosting Tutorials &#124; Web Hosting Tips &#124; Web Hosting Class</description>
	<lastBuildDate>Tue, 13 Jul 2010 08:28:20 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>How to find out the Linux distro release and the version number of your server?</title>
		<link>http://www.shanghaiwebhosting.com/ssh-hosting/how-to-find-out-the-linux-distro-release-and-the-version-number-of-your-server</link>
		<comments>http://www.shanghaiwebhosting.com/ssh-hosting/how-to-find-out-the-linux-distro-release-and-the-version-number-of-your-server#comments</comments>
		<pubDate>Sat, 05 Sep 2009 07:05:26 +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>

		<guid isPermaLink="false">http://www.shanghaiwebhosting.com/?p=178</guid>
		<description><![CDATA[To check the version date of your OS (Linux distros): uname -v To find out the release: uname -r To display and show the complete kernel signature of your hosting server: uname -a Something like this will output similar information concerning your Linux kernel: cat /proc/version If you haven&#8217;t had the uname utility installed, you [...]]]></description>
			<content:encoded><![CDATA[<p>To check the version date of your OS (Linux distros):</p>
<p><code>uname -v</code></p>
<p>To find out the release:</p>
<p><code>uname -r</code></p>
<p>To display and show the complete kernel signature of your hosting server:</p>
<p><code>uname -a</code></p>
<p>Something like this will output similar information concerning your Linux kernel:</p>
<p><code>cat /proc/version</code></p>
<p>If you haven&#8217;t had the uname utility installed, you can get the kernel release version by:</p>
<p><code>cat /proc/sys/kernel/osrelease</code></p>
<p>You may also be interested in <a href="http://www.shanghaiwebhosting.com/web-hosting/simple-ssh-linux-command-to-display-the-number-of-cpus-processors-of-your-hosting-server">some other useful things to see within /proc</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.shanghaiwebhosting.com/ssh-hosting/how-to-find-out-the-linux-distro-release-and-the-version-number-of-your-server/feed</wfw:commentRss>
		<slash:comments>1</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>0</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>Installing FTP (vsFTPd) Service on Ubuntu Server</title>
		<link>http://www.shanghaiwebhosting.com/ssh-hosting/installing-ftp-vsftpd-service-on-ubuntu-server</link>
		<comments>http://www.shanghaiwebhosting.com/ssh-hosting/installing-ftp-vsftpd-service-on-ubuntu-server#comments</comments>
		<pubDate>Sun, 31 May 2009 06:45:27 +0000</pubDate>
		<dc:creator>China Hosting Provider</dc:creator>
				<category><![CDATA[Host Server Administration]]></category>
		<category><![CDATA[SSH Hosting]]></category>
		<category><![CDATA[Unmanaged Hosting]]></category>

		<guid isPermaLink="false">http://www.shanghaiwebhosting.com/?p=97</guid>
		<description><![CDATA[FTP is an indispensable feature of servers that host and serve websites as it enables us to easily upload stuff to the remote server. On a Ubuntu server, with a little help of aptitude command (the package management program descended from Debian), you can install the most simple yet most common FTP daemon program for [...]]]></description>
			<content:encoded><![CDATA[<p>FTP is an indispensable feature of servers that host and serve websites as it enables us to easily upload stuff to the remote server. On a Ubuntu server, with a little help of aptitude command (the package management program descended from Debian), you can install the most simple yet most common FTP daemon program for your server: vsFTPd.</p>
<p><code>apt-get install vsftpd</code></p>
<p>It is started automatically after successful installation. Stop it:</p>
<p><code>/etc/init.d/vsftpd stop</code></p>
<p>So that you can customize the configuration file:</p>
<p><code>vi /etc/vsftpd.conf</code></p>
<p>And make it look like:</p>
<pre><code>pasv_enable=YES
pasv_max_port=8010
pasv_min_port=8001

anonymous_enable=NO
local_enable=YES
write_enable=YES
local_umask=022

idle_session_timeout=3600

chroot_local_user=YES

pam_service_name=ftp</code></pre>
<p>Restart the FTP service:</p>
<p><code>/etc/init.d/vsftpd start</code></p>
<p>Now you can try connecting to the FTP and transferring some stuff.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.shanghaiwebhosting.com/ssh-hosting/installing-ftp-vsftpd-service-on-ubuntu-server/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>1</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>Typical iptables Firewall Rules for a Server that Hosts Websites</title>
		<link>http://www.shanghaiwebhosting.com/ssh-hosting/typical-iptables-firewall-rules-for-a-server-that-hosts-websites</link>
		<comments>http://www.shanghaiwebhosting.com/ssh-hosting/typical-iptables-firewall-rules-for-a-server-that-hosts-websites#comments</comments>
		<pubDate>Sun, 31 May 2009 05:01:22 +0000</pubDate>
		<dc:creator>China Hosting Provider</dc:creator>
				<category><![CDATA[Host Server Administration]]></category>
		<category><![CDATA[Hosting Security]]></category>
		<category><![CDATA[SSH Hosting]]></category>

		<guid isPermaLink="false">http://www.shanghaiwebhosting.com/?p=66</guid>
		<description><![CDATA[iptables is a rather handy tool to protect your server from unwanted and potentially malicious connection attempts. To list the current rules, run in SSH: iptables -L A typical set of firewall rules set by iptables on a simple server, be it VPS or dedicated, for hosting and serving websites should be like this: iptables [...]]]></description>
			<content:encoded><![CDATA[<p>iptables is a rather handy tool to protect your server from unwanted and potentially malicious connection attempts. To list the current rules, run in SSH:</p>
<p><code>iptables -L</code></p>
<p>A typical set of firewall rules set by iptables on a simple server, be it VPS or dedicated, for hosting and serving websites should be like this:</p>
<pre><code>iptables -A INPUT -i lo -j ACCEPT
iptables -A INPUT -i ! lo -d 127.0.0.0/8 -j REJECT
iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
iptables -A OUTPUT -j ACCEPT
iptables -A INPUT -p tcp --dport 80 -j ACCEPT
iptables -A INPUT -p tcp --dport 443 -j ACCEPT
# iptables -A INPUT -p tcp --dport 3306 -j ACCEPT
iptables -A INPUT -p tcp --dport 21 -j ACCEPT
iptables -A INPUT -p tcp -m multiport --dports 8001,8002,8003,8004,8005,8006,8007,8008,8009,8010 -j ACCEPT
iptables -A INPUT -p tcp -m state --state NEW --dport 22 -j ACCEPT
iptables -A INPUT -p icmp -m icmp --icmp-type 8 -j ACCEPT
iptables -A INPUT -j REJECT
iptables -A FORWARD -j REJECT</code></pre>
<p>Which enables</p>
<ol>
<li>ports 80 and 443 for web pages serving via HTTP and HTTPS</li>
<li>port 21 and a series of tcp ports for FTP (passive mode) so that you can upload stuff to the server with your favorite FTP client</li>
<li>port 22 for SSH access which can be modified for more security. If you have <a href="http://www.shanghaiwebhosting.com/ssh-hosting/change-the-default-ssh-port-22-to-a-random-one-of-your-choice">altered the default SSH connection port 22</a> to a random one, make sure you also change the port in the iptables rules set accordingly or the server will reject you.</li>
<li>port 3306 for MySQL database server. Note that you may or may not need to open port 3306 for MySQL. For example, if you use &#8216;localhost&#8217; as database server, there&#8217;d be no need most of the time.</li>
</ol>
<p>And disables everything else.</p>
<p>These commands will only be in effect for the current session, once the server is restarted, all rules will be lost. In order to save these rules and make the server automatically load and apply them every time you reboot, write them into a file to be loaded upon every system start. Run:</p>
<p><code>iptables-save > /etc/iptables.up.rules</code></p>
<p>Command iptables-save saves the rule set to the file /etc/iptables.up.rules from the memory. Now configure the server to read and apply the rule set file /etc/iptables.up.rules every time it starts:</p>
<p><code>nano /etc/network/interfaces</code></p>
<p>And add a line immediately below &#8216;iface lo inet loopback&#8217;:</p>
<p><code>pre-up iptables-restore < /etc/iptables.up.rules</code></p>
<p>Now you are set. Reboot the server and see if all takes effect.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.shanghaiwebhosting.com/ssh-hosting/typical-iptables-firewall-rules-for-a-server-that-hosts-websites/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Customize or change the default SSH port 22 to a random custom one of your choice</title>
		<link>http://www.shanghaiwebhosting.com/ssh-hosting/change-the-default-ssh-port-22-to-a-random-one-of-your-choice</link>
		<comments>http://www.shanghaiwebhosting.com/ssh-hosting/change-the-default-ssh-port-22-to-a-random-one-of-your-choice#comments</comments>
		<pubDate>Sun, 31 May 2009 04:55:59 +0000</pubDate>
		<dc:creator>China Hosting Provider</dc:creator>
				<category><![CDATA[Host Server Administration]]></category>
		<category><![CDATA[Hosting Security]]></category>
		<category><![CDATA[SSH Hosting]]></category>

		<guid isPermaLink="false">http://www.shanghaiwebhosting.com/?p=67</guid>
		<description><![CDATA[By default, all newly set up servers listen and accept SSH login on port 22 which is known universally. To make it a little harder for hackers to break into your user account, one of the first steps you want to take is to change the default SSH port to a different on that&#8217;s randomly [...]]]></description>
			<content:encoded><![CDATA[<p>By default, all newly set up servers listen and accept SSH login on port 22 which is known universally. To make it a little harder for hackers to break into your user account, one of the first steps you want to take is to change the default SSH port to a different on that&#8217;s randomly chosen by you.</p>
<p>To do this, simply modify the sshd configuration file by:</p>
<p><code>nano /etc/sshd/sshd_config</code></p>
<p>For novice SSH users, nano is more intuitive than vi. After loading the file in the editor, find and change this line:</p>
<p><code>Port 22</code></p>
<p>To</p>
<p><code>Port 8433</code></p>
<p>Ctrl + o and ctrl + x should save the change and get you out of the editor.</p>
<p>The port number can be anything between 1024 and 65535, inclusive. You can make it instantly in effect by reloading the new configurations:</p>
<p><code>/etc/init.d/ssh reload</code></p>
<p>Now the server will only accept SSH accesses on the port 8433. After modifying this, make sure you also change the remote port setting in your local SSH client or it will be rejected by the hosting server.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.shanghaiwebhosting.com/ssh-hosting/change-the-default-ssh-port-22-to-a-random-one-of-your-choice/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>How to Change Login Password of Linux SSH User Account?</title>
		<link>http://www.shanghaiwebhosting.com/ssh-hosting/how-to-change-login-password-of-linux-ssh-user-account</link>
		<comments>http://www.shanghaiwebhosting.com/ssh-hosting/how-to-change-login-password-of-linux-ssh-user-account#comments</comments>
		<pubDate>Sun, 31 May 2009 04:18:30 +0000</pubDate>
		<dc:creator>China Hosting Provider</dc:creator>
				<category><![CDATA[Host Server Administration]]></category>
		<category><![CDATA[SSH Hosting]]></category>

		<guid isPermaLink="false">http://www.shanghaiwebhosting.com/?p=63</guid>
		<description><![CDATA[If you are root, you can change anyone&#8217;s password by: passwd someuser Wherein someuser is the user name of the account. It will prompt you to enter the new password twice. If you are yourself and logged in with your own SSH account, you can also change your own password by simply: passwd It will [...]]]></description>
			<content:encoded><![CDATA[<p>If you are root, you can change anyone&#8217;s password by:</p>
<p><code>passwd someuser</code></p>
<p>Wherein someuser is the user name of the account. It will prompt you to enter the new password twice.</p>
<p>If you are yourself and logged in with your own SSH account, you can also change your own password by simply:</p>
<p><code>passwd</code></p>
<p>It will also ask you to type your new password twice. Now you can log into your SSH with the new password.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.shanghaiwebhosting.com/ssh-hosting/how-to-change-login-password-of-linux-ssh-user-account/feed</wfw:commentRss>
		<slash:comments>1</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>2</slash:comments>
		</item>
		<item>
		<title>Simple SSH (Linux) Command to Display the Number of CPUs (Processors) of Your Hosting Server</title>
		<link>http://www.shanghaiwebhosting.com/web-hosting/simple-ssh-linux-command-to-display-the-number-of-cpus-processors-of-your-hosting-server</link>
		<comments>http://www.shanghaiwebhosting.com/web-hosting/simple-ssh-linux-command-to-display-the-number-of-cpus-processors-of-your-hosting-server#comments</comments>
		<pubDate>Tue, 14 Apr 2009 05:04:47 +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]]></category>
		<category><![CDATA[Web Hosting Tips]]></category>

		<guid isPermaLink="false">http://www.shanghaiwebhosting.com/?p=25</guid>
		<description><![CDATA[One of the first things that may concern you is that whether your web hosting company has equipped enough CPUs or Processors on your server as they have allegedly done. Or you are on shared plans and are simply curious whether your web hosting provider is overselling by overloading your server a lot. First make [...]]]></description>
			<content:encoded><![CDATA[<p>One of the first things that may concern you is that whether your web hosting company has equipped enough CPUs or Processors on your server as they have allegedly done. Or you are on shared plans and are simply curious whether your web hosting provider is overselling by overloading your server a lot.</p>
<p>First make sure you have <strong>SSH access</strong> to your hosting server which majority of hosting businesses are now providing. Then create an SSH account and log it in to the server.</p>
<p>A rather simple linux bash command will help you determine how many CPUs your host has on your server:</p>
<p><code>cat /proc/cpuinfo | grep processor | wc -l</code></p>
<p>This combination of pipeline command extracts server processors information from /proc/cpuinfo that contains CPU details each per line, returning a plain number which will usually be 1, 2, 4 or even more.</p>
<p>There you go. Now find out whether your host is cheating on you with this tip in addition to <a href="http://www.shanghaiwebhosting.com/choosing-a-web-host/check-for-hosting-server-load-with-linux-ssh-command-uptime">checking your server load</a>! <img src='http://www.shanghaiwebhosting.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<h2>Extra Tips</h2>
<p>You can find plenty of other useful and interesting information about your hosting server and OS release at <strong>/proc</strong>. For example, for some RAM stats:</p>
<p><code>cat /proc/meminfo</code></p>
<p>For total seconds since the last reboot:</p>
<p><code>cat /proc/uptime</code></p>
<p>For <a href="http://www.shanghaiwebhosting.com/ssh-hosting/how-to-find-out-the-linux-distro-release-and-the-version-number-of-your-server">Linux release and versions</a>:</p>
<p><code>cat /proc/version</code></p>
<p>And much more. Just &#8216;ls /proc&#8217; and try for yourself.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.shanghaiwebhosting.com/web-hosting/simple-ssh-linux-command-to-display-the-number-of-cpus-processors-of-your-hosting-server/feed</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
	</channel>
</rss>
