<?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>Nazly [Web Log] &#187; Apache</title>
	<atom:link href="http://www.nazly.net/category/technology/apache/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.nazly.net</link>
	<description>Personal Weblog of Nazly Ahmed : Web Developer. PHP Addict. Wordpress Hacker. FOSS Enthusiast. (Micro)Blogger. Cricket Fanatic. Husband. Dad.</description>
	<lastBuildDate>Mon, 24 Oct 2011 08:06:38 +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>Basics of maintaing a WordPress site</title>
		<link>http://www.nazly.net/basics-of-maintaing-a-wordpress-site/</link>
		<comments>http://www.nazly.net/basics-of-maintaing-a-wordpress-site/#comments</comments>
		<pubDate>Thu, 18 Nov 2010 17:36:45 +0000</pubDate>
		<dc:creator>Nazly</dc:creator>
				<category><![CDATA[Apache]]></category>
		<category><![CDATA[LAMP]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[alert]]></category>
		<category><![CDATA[cms]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[db]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[maintenance]]></category>
		<category><![CDATA[monitor]]></category>
		<category><![CDATA[notificaion]]></category>
		<category><![CDATA[server]]></category>
		<category><![CDATA[uptime]]></category>
		<category><![CDATA[website]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://www.nazly.net/?p=903</guid>
		<description><![CDATA[WordPress is simple, yet powerful. Those are the key ingredients why it is popular among the Bloggers and Web Developers alike. WordPress will always be the first choice as a blogging platform. In the recent times it has moved far (&#8230;)<p><a href="http://www.nazly.net/basics-of-maintaing-a-wordpress-site/">Read the rest of this entry &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<p><img class="alignleft size-full wp-image-1072" title="wordpress-logo" src="http://www.nazly.net/wp-content/uploads/2011/06/wordpress-logo.png" alt="" width="250" height="155" /> <a href="http://wordpress.org">WordPress</a> is <strong>simple</strong>, yet <strong>powerful</strong>. Those are the key ingredients why it is popular among the Bloggers and Web Developers alike. WordPress will always be the first choice as a blogging platform. In the recent times it has moved far from being just a blogging engine. Most Web developers choose WordPress as their primary <a href="http://en.wikipedia.org/wiki/Content_management_system">CMS</a> of choice ahead of other popular Content Management Systems. Regardless of you being a Blogger or a Web Developer, the manner you maintain your WordPress files and database will play an important role in running a successful website.</p>
<p><span id="more-903"></span>Maintaining and monitoring your WordPress site requires performing certain tasks on a regular basis. The term regular will depend on how often your Website gets updated. Depending on the frequency you will need to plan this out. If you run a Website that gets updated daily (eg: news), then taking daily backups is a high priority. Performing these tasks manually can become a tedious process. There are plenty of tools and techniques available to automate them.</p>
<h3>Monitoring a Website</h3>
<p>You might want to use a <a href="http://www.google.lk/search?q=Website+Monitoring+Service">Website Monitoring Service</a> to check whether your website is up and running. There are plenty of services over the Internet if you Google for it. These services offer monitoring your Web Server (HTTP), FTP, Mail Server (POP &amp; SMTP), SSL, DNS and custom TCP ports on regular intervals. If any of these don&#8217;t respond, the service will alert you via Email or SMS. Most of them offer limited options for free while you need to pay based on the additional services you require. This type of monitoring is not WordPress specific and can apply to any Wesbite.</p>
<p>If you are a developer you can code your own monitoring system which will be cost efficient and can be expandable according to your monitoring requirements. Using <a href="http://php.net/manual/en/function.fsockopen.php">socket functions</a> and tools like <a href="http://www.php.net/manual/en/ref.curl.php">curl</a> can assist in doing that. </p>
<p>In any of the case above, you will need to specify the port of the service you wish to monitor. In certain cases, the port can occasionally differ from the default port that particular service would run depending on how it is configured on your Server. So you need to specify the correct one. </p>
<p>There is one instance that most of the Bloggers/Web Developers fail to address. While your Web Server/Apache might run smoothly, there is a possibility that your database might not respond. This can happen when your DB gets corrupted, privileges get messed up or your MySQL Server crashes for some reason. In this case WordPress will send you this ugly message on a plain white page. </p>
<p><img src="http://www.nazly.net/wp-content/uploads/2011/06/databaseerror.jpg" alt="" title="databaseerror" width="394" height="37" class="alignnone size-full wp-image-1097" /></p>
<p>It&#8217;s not suitable to show an error message of this nature to your visitors. Most importantly the HTTP status code for this response is 200, which means Search Engines will pick it up as your content for the site. If this message hangs on for long, you will get indexed on Google with this Error Message.</p>
<p>Here is how you can display a custom error message with your design template and get notified at the same time when your DB doesn&#8217;t respond.</p>
<p>Create a file called <strong>db-error.php</strong> and store that file under the wp-contents folder.<br />
The contents of the file should be..</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #990000;">header</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;HTTP/1.0 500 Internal Server Error&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #990000;">mail</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;webmaster@mydomain.com&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;DB fail&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;Down at : &quot;</span><span style="color: #339933;">.</span><span style="color: #990000;">date</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Y-m-d H:i:s&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;&lt;html&gt;Your customer error message with yout HTML template&lt;/html&gt;&quot;</span><span style="color: #339933;">;</span></pre></div></div>

<p>It&#8217;s that simple..!</p>
<p>WordPress will execute the above script when the DB doesn&#8217;t respond. The first line will send the HTTP response code 500 (Internal Server Error) so that Search Engines won&#8217;t index it. The next line will send an email to you, notifying the time the DB went down. Third line will output the HTML of your template where you can include a custom error message. You can extend this piece of code to fit into your needs. Instead of Email, you could use SMS/Twitter to get instantly notified. </p>
<h3>Backup</h3>
<p>Taking regular backups of your WordPress installation and most importantly the database regularly will help to restore your Website within minutes if any data loss occurs. A hard disk crash, server failure or even a hacker wiping out all your data can be some of the reasons how a data loss could occur. While your hosting provider might do the backup for you, its always good to have your own. If you take regular backups, you are never a loser.</p>
<p>One of the important folders to backup is the wp-contents folder, but I would advise you to backup the whole WordPress installation directory. You will also need to backup the MySQL database. A simple MySQL dump would do. If you are the average blogger, then there are quite a lot of <a href="http://wordpress.org/extend/plugins/search.php?q=backup">WordPress plugins for backup</a> which would do the job for you. If you have shell access, I would advice you to write a shell script that would backup the files and database. Add a cron job to execute the script based on how frequent you wish to take backups. If you don&#8217;t have shell access, you can try using the options in your Web Hosting Control Panel. </p>
<h3>Security</h3>
<p>When it comes to security, applying the correct patches and upgrading to the newest version of the core and plugins of WordPress will prevent the hackers  from trying to exploit the vulnerabilities in your Website. While this can be automated, it is advisable you do this process manually to reduce complications that may arise after an upgrade. It will depend on the plugins you use and the purpose you use it for. Golden rule before upgrade is to backup your WordPress files and DB so that you can restore it if something goes wrong.</p>
<p>Before choosing the right plugin to use, make sure to check the compatibility of the plugin with the version of WordPress you are running. Also make sure to check the ratings of the plugin. All these information is available on the plugin&#8217;s page.</p>
<p>Good luck..!!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.nazly.net/basics-of-maintaing-a-wordpress-site/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Apache port 80 conflict with Skype</title>
		<link>http://www.nazly.net/apache-port-80-conflict-with-skype/</link>
		<comments>http://www.nazly.net/apache-port-80-conflict-with-skype/#comments</comments>
		<pubDate>Tue, 04 Mar 2008 00:57:06 +0000</pubDate>
		<dc:creator>Nazly</dc:creator>
				<category><![CDATA[Apache]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[conflict]]></category>
		<category><![CDATA[port80]]></category>
		<category><![CDATA[skype]]></category>

		<guid isPermaLink="false">http://blog.nazly.net/apache-port-80-conflict-with-skype/</guid>
		<description><![CDATA[I&#8217;m not sure how many of you have come across this issue but yesterday was the first time I experienced it. I was installing Apache Web Server on a M$ windows developer machine and after completing the installation the Apache (&#8230;)<p><a href="http://www.nazly.net/apache-port-80-conflict-with-skype/">Read the rest of this entry &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m not sure how many of you have come across this issue but yesterday was the first time I experienced it. I was installing Apache Web Server on a M$ windows developer machine and after completing the installation the Apache Service didn&#8217;t start stating the following error.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">make_sock could not <span style="color: #7a0874; font-weight: bold;">bind</span> to address 0.0.0.0:<span style="color: #000000;">80</span> no listening sockets available</pre></div></div>

<p>I kept wondering for a moment what could be running on port 80 coz the machine was newly setup and it didn&#8217;t have IIS or any other web server. It quickly struck my mind that once a friend of mine told me about Skype causing a conflict when he installed Apache. On this machine Skype was running already and I was logged in on Skype as well. So first thing I did was to exit Skype and started Apache. Now the Apache service started without any issues. With a little bit of research I found out that Skype was the culprit in this case because Skype uses port 80 as an alternative port for communication. Now since Apache Web Server is running, I started Skype and logged in and it was working smoothly as well. So starting Skype after Apache is started will solve the issue in one way as Skype will use a different port. But the better solution is to disable the Skype option of using port 80 as an alternative. On Skype you can do this by</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"> - Goto Tools -<span style="color: #000000; font-weight: bold;">&amp;</span>gt; Options -<span style="color: #000000; font-weight: bold;">&amp;</span>gt; Connection
 - <span style="color: #7a0874; font-weight: bold;">&#91;</span>Untick<span style="color: #7a0874; font-weight: bold;">&#93;</span> Use port <span style="color: #000000;">80</span> and <span style="color: #000000;">443</span> <span style="color: #c20cb9; font-weight: bold;">as</span> alternatives <span style="color: #000000; font-weight: bold;">for</span> incoming connections
 - Click Save and restart Skype to apply the changes.</pre></div></div>

<p><img src="http://www.nazly.net/imgs/skype.jpg" border="0" alt="http://www.nazly.net/imgs/skype.jpg" /></p>
<p>Without changing this behavior in Skype, we can do the other way around as well. In httpd.conf file for Apache we can set the &#8220;listen&#8221; port to 8080 (as an alternative port) which will solve the issue but I preferred to use port 80 itself for Apache. But its just me. You have two solutions in hand and the choice is yours <img src="http://www.nazly.net//smiles/icon_wink.gif" alt="[Wink]" /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.nazly.net/apache-port-80-conflict-with-skype/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>

