<?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>Web Server Hacks Blog - Hacks for Dedicated/VPS Servers, SSH, and Plesk &#187; admin</title>
	<atom:link href="http://webserverhacks.com/author/admin/feed/" rel="self" type="application/rss+xml" />
	<link>http://webserverhacks.com</link>
	<description>Hacks for Dedicated/VPS Servers, SSH, and Plesk</description>
	<lastBuildDate>Wed, 14 Mar 2012 22:35:30 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>How to Backup Multiple MySQL Databases Automatically! [SCRIPT]</title>
		<link>http://webserverhacks.com/mysql/how-to-backup-multiple-mysql-databases-automatically-script/</link>
		<comments>http://webserverhacks.com/mysql/how-to-backup-multiple-mysql-databases-automatically-script/#comments</comments>
		<pubDate>Tue, 01 Nov 2011 23:56:23 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[MySQL]]></category>
		<category><![CDATA[backup multiple mysql database]]></category>
		<category><![CDATA[how to]]></category>
		<category><![CDATA[script]]></category>

		<guid isPermaLink="false">http://webserverhacks.com/?p=153</guid>
		<description><![CDATA[Tired of making MYSQL database backups one by one? If you are migrating to another server or want to do a monthly MYSQL database backup of all databases in your server, you can do so by using a script that will backup all of your databases at once. Of course, you will want to save each database separately in case you just want to restore one at a time plus it will be easier when restoring. Here&#8217;s a script you can use, replace password with your root password. #!/bin/bash # webserverhacks.com USER="root" PASSWORD="password" OUTPUTDIR="." MYSQLDUMP="/usr/bin/mysqldump" MYSQL="/usr/bin/mysql" # clean up any old backups - save space rm "$OUTPUTDIR/*sql" > /dev/null 2>&#038;1 # get a list of databases databases=`$MYSQL -u$USER -p$PASSWORD -e "SHOW DATABASES;" &#124; tr -d "&#124; " &#124; grep -v Database` # dump each database in turn for db in $databases; do echo $db $MYSQLDUMP --force --opt -u$USER -p$PASSWORD $db > "$OUTPUTDIR/$db.sql" done]]></description>
			<content:encoded><![CDATA[<p>Tired of making MYSQL database backups one by one?  If you are migrating to another server or want to do a monthly MYSQL database backup of all databases in your server, you can do so by using a script that will backup all of your databases at once.</p>
<p>Of course, you will want to save each database separately in case you just want to restore one at a time plus it will be easier when restoring.</p>
<p>Here&#8217;s a script you can use, replace password with your root password.</p>
<pre class="php">
#!/bin/bash
# webserverhacks.com

USER="root"
PASSWORD="password"
OUTPUTDIR="."
MYSQLDUMP="/usr/bin/mysqldump"
MYSQL="/usr/bin/mysql"

# clean up any old backups - save space
rm "$OUTPUTDIR/*sql" > /dev/null 2>&#038;1

# get a list of databases
databases=`$MYSQL -u$USER -p$PASSWORD -e "SHOW DATABASES;" | tr -d "|
" | grep -v Database`

# dump each database in turn
for db in $databases; do
   echo $db
   $MYSQLDUMP --force --opt -u$USER -p$PASSWORD $db > "$OUTPUTDIR/$db.sql"
done
</pre>
]]></content:encoded>
			<wfw:commentRss>http://webserverhacks.com/mysql/how-to-backup-multiple-mysql-databases-automatically-script/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to Change Time Zone for System Date on CentOS!</title>
		<link>http://webserverhacks.com/centos/how-to-change-time-zone-for-system-date-on-centos/</link>
		<comments>http://webserverhacks.com/centos/how-to-change-time-zone-for-system-date-on-centos/#comments</comments>
		<pubDate>Thu, 07 Jul 2011 00:01:24 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[CentOS]]></category>
		<category><![CDATA[change time zone]]></category>
		<category><![CDATA[how to]]></category>
		<category><![CDATA[system date]]></category>

		<guid isPermaLink="false">http://webserverhacks.com/?p=150</guid>
		<description><![CDATA[Here&#8217;s how to change time zone for system date on your CentOS web server: Go into the directory zoneinfo: cd /usr/share/zoneinfo Then find the right zone file for you such as for me Los Angeles is for PST (Pacific Standard Time), which is here: /usr/share/zoneinfo/America/Los_Angeles Then simply copy over that file to /etc/localtime like this: cp /usr/share/zoneinfo/America/Los_Angeles /etc/localtime Run the date command: date and you should get something like: Wed Jul 6 16:56:47 PDT 2011 Instead of the other time zone you were getting.]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s how to change time zone for system date on your CentOS web server:</p>
<p>Go into the directory zoneinfo:</p>
<p><strong>cd /usr/share/zoneinfo</strong></p>
<p>Then find the right zone file for you such as for me Los Angeles is for PST (Pacific Standard Time), which is here:</p>
<p><strong>/usr/share/zoneinfo/America/Los_Angeles</strong></p>
<p>Then simply copy over that file to /etc/localtime like this:</p>
<p><strong>cp /usr/share/zoneinfo/America/Los_Angeles /etc/localtime</strong></p>
<p>Run the date command:</p>
<p><strong>date</strong></p>
<p>and you should get something like:</p>
<p><strong>Wed Jul  6 16:56:47 PDT 2011</strong></p>
<p>Instead of the other time zone you were getting.</p>
]]></content:encoded>
			<wfw:commentRss>http://webserverhacks.com/centos/how-to-change-time-zone-for-system-date-on-centos/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to Allow MySQL Access to Certain IP/Servers!</title>
		<link>http://webserverhacks.com/web-server-hacks/how-to-allow-mysql-access-to-certain-ipservers/</link>
		<comments>http://webserverhacks.com/web-server-hacks/how-to-allow-mysql-access-to-certain-ipservers/#comments</comments>
		<pubDate>Sat, 02 Jul 2011 15:49:46 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[MySQL]]></category>
		<category><![CDATA[Web Server Hacks]]></category>
		<category><![CDATA[access]]></category>
		<category><![CDATA[allow mysql]]></category>
		<category><![CDATA[how to]]></category>
		<category><![CDATA[servers]]></category>

		<guid isPermaLink="false">http://webserverhacks.com/?p=148</guid>
		<description><![CDATA[For those of you who run separate MySQL servers, you can easily block unwanted visitors and give access to your other web servers simply replacing &#8220;localhost&#8221; with your subnet such as &#8220;192.168.1.%&#8221;, where the % will be a wild card to allow any servers in the 192.168.1.xxx to connect. This can easily be changed via phpMyAdmin.]]></description>
			<content:encoded><![CDATA[<p>For those of you who run separate MySQL servers, you can easily block unwanted visitors and give access to your other web servers simply replacing &#8220;localhost&#8221; with your subnet such as &#8220;192.168.1.%&#8221;, where the % will be a wild card to allow any servers in the 192.168.1.xxx to connect.</p>
<p>This can easily be changed via phpMyAdmin.</p>
]]></content:encoded>
			<wfw:commentRss>http://webserverhacks.com/web-server-hacks/how-to-allow-mysql-access-to-certain-ipservers/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to Generate SSH Keys!</title>
		<link>http://webserverhacks.com/web-server-hacks/how-to-generate-ssh-keys/</link>
		<comments>http://webserverhacks.com/web-server-hacks/how-to-generate-ssh-keys/#comments</comments>
		<pubDate>Sat, 02 Jul 2011 14:56:14 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Linux Commands]]></category>
		<category><![CDATA[Web Server Hacks]]></category>
		<category><![CDATA[generate ssh keys]]></category>
		<category><![CDATA[how to]]></category>

		<guid isPermaLink="false">http://webserverhacks.com/?p=143</guid>
		<description><![CDATA[To generate SSH keys, just do: ssh-keygen -t dsa Then do: cat /root/.ssh/id_dsa.pub Then copy over the whole thing into /root/.ssh/authorized_keys on the server you are trying to get connection. &#160; This can be useful for setting up RSync between two servers.]]></description>
			<content:encoded><![CDATA[<p>To generate SSH keys, just do:</p>
<p><strong>ssh-keygen -t dsa</strong></p>
<p>Then do:</p>
<p><strong>cat /root/.ssh/id_dsa.pub</strong></p>
<p>Then copy over the whole thing into <strong>/root/.ssh/<strong><kbd>authorized_keys</kbd></strong></strong> on the server you are trying to get connection.</p>
<p>&nbsp;</p>
<p>This can be useful for setting up RSync between two servers.</p>
]]></content:encoded>
			<wfw:commentRss>http://webserverhacks.com/web-server-hacks/how-to-generate-ssh-keys/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to Restart Networking on Linux!</title>
		<link>http://webserverhacks.com/web-server-hacks/how-to-restart-networking-on-linux/</link>
		<comments>http://webserverhacks.com/web-server-hacks/how-to-restart-networking-on-linux/#comments</comments>
		<pubDate>Sat, 02 Jul 2011 14:48:32 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Linux Commands]]></category>
		<category><![CDATA[Web Server Hacks]]></category>
		<category><![CDATA[how to]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[restart networking]]></category>

		<guid isPermaLink="false">http://webserverhacks.com/?p=141</guid>
		<description><![CDATA[Here&#8217;s how to restart networking services on your linux webserver.  I find that especially with VPS web servers, there are times where your network gets blocked completely. To reset, get into SSH via console on your VPS web server company&#8217;s control panel. Type: service network stop then service network start For some web servers, you might have to use: /sbin/service network stop and /sbin/service network start Wait like 5 seconds and see if you can ping the outside world: ping google.com If you get connected, you should be good to go. This can save lots of time restarting a faulty network yourself instead of opening a support ticket and waiting forever.]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s how to restart networking services on your linux webserver.  I find that especially with VPS web servers, there are times where your network gets blocked completely.</p>
<p>To reset, get into SSH via console on your VPS web server company&#8217;s control panel.</p>
<p>Type:</p>
<p><strong>service network stop</strong></p>
<p>then</p>
<p><strong>service network start</strong></p>
<p>For some web servers, you might have to use:</p>
<p><strong>/sbin/service network stop</strong></p>
<p>and</p>
<p><strong>/sbin/service network start</strong></p>
<p>Wait like 5 seconds and see if you can ping the outside world:</p>
<p><strong>ping google.com</strong></p>
<p>If you get connected, you should be good to go.</p>
<p>This can save lots of time restarting a faulty network yourself instead of opening a support ticket and waiting forever.</p>
]]></content:encoded>
			<wfw:commentRss>http://webserverhacks.com/web-server-hacks/how-to-restart-networking-on-linux/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to Install PHP-FPM for Nginx!</title>
		<link>http://webserverhacks.com/web-server-hacks/how-to-install-php-fpm-for-nginx/</link>
		<comments>http://webserverhacks.com/web-server-hacks/how-to-install-php-fpm-for-nginx/#comments</comments>
		<pubDate>Fri, 01 Jul 2011 18:28:17 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Nginx Hacks]]></category>
		<category><![CDATA[Web Server Hacks]]></category>
		<category><![CDATA[how to]]></category>
		<category><![CDATA[install php-fpm]]></category>
		<category><![CDATA[nginx]]></category>

		<guid isPermaLink="false">http://webserverhacks.com/?p=138</guid>
		<description><![CDATA[Recently, I&#8217;ve switched some of my web servers that handle large file downloads from spawn-cgi to PHP-FPM.  The result is that I can handle more large files with more PHP-CGI processes while my site still loads well even if there&#8217;s many concurrent downloads going on. I am still experimenting with PHP-FPM but it seems like a pretty good way to go as far as handling the PHP-CGI processes. To do this, you will need to install EPEL &#38; CentALT repositories: rpm -Uvh http://download.fedora.redhat.com/pub/epel/5/x86_64/epel-release-5-3.noarch.rpm rpm -Uvh http://centos.alt.ru/repository/centos/5/x86_64/centalt-release-5-3.noarch.rpm Then do: yum install php-fpm to install php-fpm. Edit the file /etc/php-fpm.conf and my suggested setting changes: &#60;value name=&#8221;user&#8221;&#62;apache&#60;/value&#62; &#60;value name=&#8221;group&#8221;&#62;apache&#60;/value&#62; The max_children is set to 1 as default, set it to something like 50, this really is the cool part about php-fpm. &#60;value name=&#8221;max_children&#8221;&#62;50&#60;/value&#62; &#160; PHP-FPM doesn&#8217;t allow for root user and group so I set it to apache.  You will also need to set your web directories to apache user and group by doing: chown apache:apache /mywebdirectory Start the PHP-FPM by doing: /sbin/service php-fpm start If you get some kind of session errors, simply erase all the session files where the error shows. For CentOS, you can do: chkconfig php-fpm on so it &#8230; <a href="http://webserverhacks.com/web-server-hacks/how-to-install-php-fpm-for-nginx/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Recently, I&#8217;ve switched some of my web servers that handle large file downloads from spawn-cgi to PHP-FPM.  The result is that I can handle more large files with more PHP-CGI processes while my site still loads well even if there&#8217;s many concurrent downloads going on.</p>
<p>I am still experimenting with PHP-FPM but it seems like a pretty good way to go as far as handling the PHP-CGI processes.</p>
<p>To do this, you will need to install EPEL &amp; CentALT repositories:</p>
<p><strong>rpm -Uvh http://download.fedora.redhat.com/pub/epel/5/x86_64/epel-release-5-3.noarch.rpm</strong></p>
<p><strong>rpm -Uvh http://centos.alt.ru/repository/centos/5/x86_64/centalt-release-5-3.noarch.rpm</strong></p>
<p>Then do:</p>
<p><strong>yum install php-fpm </strong></p>
<p>to install php-fpm.</p>
<p>Edit the file <strong>/etc/php-fpm.conf</strong></p>
<p>and my suggested setting changes:</p>
<p><strong>&lt;value name=&#8221;user&#8221;&gt;apache&lt;/value&gt;</strong><br />
<strong>&lt;value name=&#8221;group&#8221;&gt;apache&lt;/value&gt;</strong></p>
<p>The max_children is set to 1 as default, set it to something like 50, this really is the cool part about php-fpm.</p>
<p><strong>&lt;value name=&#8221;max_children&#8221;&gt;50&lt;/value&gt;</strong></p>
<p>&nbsp;</p>
<p>PHP-FPM doesn&#8217;t allow for root user and group so I set it to apache.  You will also need to set your web directories to apache user and group by doing:</p>
<p><strong>chown apache:apache /mywebdirectory</strong></p>
<p>Start the PHP-FPM by doing:</p>
<p><strong>/sbin/service php-fpm start</strong></p>
<p>If you get some kind of session errors, simply erase all the session files where the error shows.</p>
<p>For CentOS, you can do:</p>
<p><strong>chkconfig php-fpm on</strong></p>
<p>so it will start whenever your webserver is rebooted.</p>
<p>If you have been using fastcgi, make sure to do:</p>
<p><strong>chkconfig fastcgi off </strong></p>
<p>so it doesn&#8217;t interfere.</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://webserverhacks.com/web-server-hacks/how-to-install-php-fpm-for-nginx/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to Optimize Large File Downloads on Nginx!</title>
		<link>http://webserverhacks.com/web-server-hacks/how-to-optimize-large-file-downloads-on-nginx/</link>
		<comments>http://webserverhacks.com/web-server-hacks/how-to-optimize-large-file-downloads-on-nginx/#comments</comments>
		<pubDate>Thu, 30 Jun 2011 19:32:46 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Nginx Hacks]]></category>
		<category><![CDATA[Web Server Hacks]]></category>
		<category><![CDATA[how to]]></category>
		<category><![CDATA[large file downloads]]></category>
		<category><![CDATA[nginx]]></category>
		<category><![CDATA[optimize]]></category>

		<guid isPermaLink="false">http://webserverhacks.com/?p=134</guid>
		<description><![CDATA[For those of you who have large file downloads on your web server, your web server might have trouble loading the faster parts of your website while users hog your bandwidth. I&#8217;ve been researching many ways to optimize large file downloads but probably the best way is to simply rate limit the bandwidth on how fast each user can download. You can add the following line to your HTTP directive in /etc/nginx/nginx.conf: limit_rate 100k This will limit each user to download at maximum of 100kb/second. You can change this number to see which one fits best for your server. You can also add limit_rate_after clause to only limit after a portion of the file has been downloaded: limit_rate_after 1m; limit_rate 100k This will limit downloads only after the first megabyte, potentially not slowing down smaller file downloads and your website.]]></description>
			<content:encoded><![CDATA[<p>For those of you who have large file downloads on your web server, your web server might have trouble loading the faster parts of your website while users hog your bandwidth.</p>
<p>I&#8217;ve been researching many ways to optimize large file downloads but probably the best way is to simply rate limit the bandwidth on how fast each user can download.</p>
<p>You can add the following line to your HTTP directive in /etc/nginx/nginx.conf:</p>
<p><strong>limit_rate 100k</strong></p>
<p>This will limit each user to download at maximum of 100kb/second.</p>
<p>You can change this number to see which one fits best for your server.</p>
<p>You can also add limit_rate_after clause to only limit after a portion of the file has been downloaded:</p>
<p><strong>limit_rate_after 1m;</strong><br />
<strong> limit_rate 100k</strong></p>
<p>This will limit downloads only after the first megabyte, potentially not slowing down smaller file downloads and your website.</p>
]]></content:encoded>
			<wfw:commentRss>http://webserverhacks.com/web-server-hacks/how-to-optimize-large-file-downloads-on-nginx/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Really Great Article on MySQL and Web Server!</title>
		<link>http://webserverhacks.com/performance-tests/really-great-article-on-mysql-and-web-server/</link>
		<comments>http://webserverhacks.com/performance-tests/really-great-article-on-mysql-and-web-server/#comments</comments>
		<pubDate>Tue, 05 Apr 2011 06:35:25 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[MySQL]]></category>
		<category><![CDATA[Performance Tests]]></category>
		<category><![CDATA[Web Server Hacks]]></category>
		<category><![CDATA[MySql]]></category>
		<category><![CDATA[web server]]></category>

		<guid isPermaLink="false">http://webserverhacks.com/?p=111</guid>
		<description><![CDATA[Check out this great article by a MySQL expert who goes into detail how MySQL and web servers work and take on the load on servers. &#8211; link]]></description>
			<content:encoded><![CDATA[<p>Check out this great article by a MySQL expert who goes into detail how MySQL and web servers work and take on the load on servers. &#8211; <a href="http://www.mysqlperformanceblog.com/2006/10/16/should-mysql-and-web-server-share-the-same-box/">link</a></p>
]]></content:encoded>
			<wfw:commentRss>http://webserverhacks.com/performance-tests/really-great-article-on-mysql-and-web-server/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to Check MySQL/PHP Version via Command Line!</title>
		<link>http://webserverhacks.com/linux-commands/how-to-check-mysqlphp-version-via-command-line/</link>
		<comments>http://webserverhacks.com/linux-commands/how-to-check-mysqlphp-version-via-command-line/#comments</comments>
		<pubDate>Mon, 04 Apr 2011 01:04:00 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Linux Commands]]></category>
		<category><![CDATA[check]]></category>
		<category><![CDATA[command line]]></category>
		<category><![CDATA[how to]]></category>
		<category><![CDATA[MySql]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[version]]></category>

		<guid isPermaLink="false">http://webserverhacks.com/?p=107</guid>
		<description><![CDATA[To check your MySQL version via linux command line, type: # mysql -version mysql Ver 14.12 Distrib 5.0.45, for redhat-linux-gnu (i386) using readline 5.0 and for PHP version: # php -version PHP 5.2.6 (cli) (built: May 8 2008 08:53:44) Most linux commands allow you to check the version simply by adding -version after the command.]]></description>
			<content:encoded><![CDATA[<p>To check your MySQL version via linux command line, type:</p>
<p># mysql -version<br />
mysql Ver 14.12 Distrib 5.0.45, for redhat-linux-gnu (i386) using readline 5.0</p>
<p>and for PHP version:</p>
<p># php -version<br />
PHP 5.2.6 (cli) (built: May 8 2008 08:53:44)</p>
<p>Most linux commands allow you to check the version simply by adding -version after the command.</p>
]]></content:encoded>
			<wfw:commentRss>http://webserverhacks.com/linux-commands/how-to-check-mysqlphp-version-via-command-line/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to Display WordPress Error Messages!</title>
		<link>http://webserverhacks.com/wordpress-hacks/how-to-display-wordpress-error-messages/</link>
		<comments>http://webserverhacks.com/wordpress-hacks/how-to-display-wordpress-error-messages/#comments</comments>
		<pubDate>Mon, 04 Apr 2011 01:03:00 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Wordpress Hacks]]></category>
		<category><![CDATA[display]]></category>
		<category><![CDATA[error messages]]></category>
		<category><![CDATA[how to]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://webserverhacks.com/?p=105</guid>
		<description><![CDATA[If for some reason you need to debug your WordPress theme, plugin, or just need to see all the error messages, you can add the following line in your wp-config.php file: define(‘WP_DEBUG’, true); WordPress by default hides error messages so this will reveal them.]]></description>
			<content:encoded><![CDATA[<p>If for some reason you need to debug your WordPress theme, plugin, or just need to see all the error messages, you can add the following line in your wp-config.php file:<br /> <br />
define(‘WP_DEBUG’, true);</p>
<p>WordPress by default hides error messages so this will reveal them.</p>
]]></content:encoded>
			<wfw:commentRss>http://webserverhacks.com/wordpress-hacks/how-to-display-wordpress-error-messages/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

