<?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's BLOG &#187; LAMP</title>
	<atom:link href="http://www.nazly.net/category/technology/lamp/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>Sat, 19 Jun 2010 07:26:55 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Getting LAMP to work in Ubuntu Hardy</title>
		<link>http://www.nazly.net/getting-lamp-to-work-in-ubuntu-hardy/</link>
		<comments>http://www.nazly.net/getting-lamp-to-work-in-ubuntu-hardy/#comments</comments>
		<pubDate>Mon, 21 Jul 2008 05:44:05 +0000</pubDate>
		<dc:creator>Nazly</dc:creator>
				<category><![CDATA[LAMP]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[Apache]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://blog.nazly.net/getting-lamp-to-work-in-ubuntu-hardy/</guid>
		<description><![CDATA[
Few of my friends who switched to Ubuntu lately, asked me how to get LAMP (Linux, Apache, MySQL, PHP) working in their desktops. Most of them have installed Ubuntu 8.04 (Hardy Heron) so I planned to write a small guide on how to setup a LAMP development environment. This will require to have an Internet [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.nazly.net/imgs/ulamp.jpg" alt="http://www.nazly.net/imgs/ulamp.jpg" border="0" /></p>
<p>Few of my friends who switched to <a href="http://www.ubuntu.com" target="_blank">Ubuntu</a> lately, asked me how to get LAMP (<a href="http://www.kernel.org" target="_blank">Linux</a>, <a href="http://www.apache.org" target="_blank">Apache</a>, <a href="http://www.mysql.com" target="_blank">MySQL</a>, <a href="http://www.php.net" target="_blank">PHP</a>) working in their desktops. Most of them have installed Ubuntu 8.04 (Hardy Heron) so I planned to write a small guide on how to setup a LAMP development environment. This will require to have an Internet Connection since the installation will download the necessary packages from the repositories. I will also explain how to add Virtual Hosts so that we can setup different environments to each website we create. I will also explain on how to enable Apache modules such as Userdir and Rewrite. I would normally enable Userdir module on development environments because it allows me to quickly test my code in my home directory. Rewrite module will enable features like having Search Engine Friendly URLs if we can write few Rewrite rules in the .htacess file.</p>
<p>Getting LAMP installed is quite easy in Ubuntu 8.04. I will be using the command-line in this small guide.<br />
<br />Open command-line terminal by going to Applications -&gt; Accessories -&gt; Terminal</p>
<p>First Update the repositories<br />
</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">apt-get</span> update</pre></div></div>

<p><b>Install Apache2 &#8211; PHP5 &#8211; MySQL5 in one go</b><br />
</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">apt-get</span> <span style="color: #c20cb9; font-weight: bold;">install</span> apache2 php5 mysql-server-<span style="color: #000000;">5.0</span></pre></div></div>

<p>Installation will take a while depending on your Internet Connection speed to download the necessary packages. You will be prompted to enter the MySQL Server root password. Enter the password and that&#039;s it. Apache2, PHP5 and MySQL5 will now be installed in your computer.</p>
<p>Now open a Browser Window, most probably <a href="http://www.getfirefox.com" target="_blank">Firefox</a> and in the address bar type <b>http://localhost</b>. You will get a message like <b><i>It Works!</i></b> in the browser which means Apache is successfully installed. The default webroot directory will be /var/www/ where you can place a phpinfo page to check whether PHP is installed successfully as well. But this directory is not writable by the user. So we might need to sudo and write to this directory. Later in this guide I will explain how to test files that resides in my home directory.</p>
<p>Create PHP info page to check whether the PHP installation was successful<br />
</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> gedit <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>www<span style="color: #000000; font-weight: bold;">/</span>info.php</pre></div></div>

<p>Copy the blow code in the editor.<br />
</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #990000;">phpinfo</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

<p>Save the file and close the editor.<br />
<br />Now goto <b>http://localhost/info.php</b>. If you see the PHP Info page then PHP is also successfully installed.</p>
<p>Now we need to check whether MySQL is installed successfully as well. In the terminal type<br />
</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">mysql <span style="color: #660033;">-h</span> localhost <span style="color: #660033;">-u</span> root <span style="color: #660033;">-p</span></pre></div></div>

<p>Enter the root password you entered during the installation process. If you are able to successfully login and see the welcome massage and the MySQL command prompt, MySQL is also installed successfully.</p>
<p>I would then install <a href="http://www.phpmyadmin.net" target="_blank">PHPMyAdmin</a>, a web based GUI to handle MySQL Databases.<br />
<br /><b>Install PHPMyAdmin</b><br />
</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">apt-get</span> <span style="color: #c20cb9; font-weight: bold;">install</span> phpmyadmin</pre></div></div>

<p>You will be prompted to select the server type, select apache2.</p>
<p>We will then restart Apache to make the changes in effect<br />
</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>init.d<span style="color: #000000; font-weight: bold;">/</span>apache2 restart</pre></div></div>

<p>Now goto <b>http://localhost/phpmyadmin/</b>. If you see the PHPMyAdmin login page then it is also installed successfully. </p>
<p>Though we now have everything in place, saving files into /var/www/ can be an issue during the development coz the user doesn&#039;t have permissions to write to this directory. We can overcome this by setting permissions to the user to write to this directory. But I always prefer having Userdir module enabled. If I assume my username is <b>spider</b>, I can save my files in a folder called &#039;public_html&#039; under my home directory (/home/spider/public_html) and call it from the browser using the following address in my browser <b>http://localhost/~spider/</b>. But for this to work UserDir module should be enabled in Apache. </p>
<p><b>Enable UserDir module in Apache</b><br />
</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> a2enmod userdir</pre></div></div>

<p>Restart Apache to make the changes in effect<br />
</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>init.d<span style="color: #000000; font-weight: bold;">/</span>apache2 restart</pre></div></div>

<p>Userdir module is now installed and working, so now we can save files in the public_html folder which you need to create in your home directory. But this method is good for testing small scripts. Its always advisable to create a Virtual Host for each project so that we can use a hostname for a website and have a directory apart from the default webroot associated with it. We can change certain behaviours while setting up a Virtual Host which allows us a better testing environment.</p>
<p><b>Setting up a Virtual Host</b><br />
<br />First we need to create a hostname associated with our local IP address. To do that we need to edit the hosts file<br />
</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> gedit <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>hosts</pre></div></div>

<p>Add the following in a new line after the entry for localhost<br />
</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">127.0.0.1 myweb.local</pre></div></div>

<p>Save the file and close the editor window.</p>
<p>myweb.local is our hostname where it can be any name except localhost</p>
<p>Now we need to setup a Virtual Host in Apache for myweb.local<br />
<br />We need to add a new file for the sites available for Apache<br />
</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>apache2<span style="color: #000000; font-weight: bold;">/</span>sites-available
<span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">touch</span> myweb
<span style="color: #c20cb9; font-weight: bold;">sudo</span> gedit myweb</pre></div></div>

<p>In the editor add the following lines.<br />
</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;</span>virtualHost <span style="color: #000000; font-weight: bold;">*&gt;</span>
    ServerName myweb.local
    ServerAdmin webmaster<span style="color: #000000; font-weight: bold;">@</span>localhost
    DocumentRoot <span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>spider<span style="color: #000000; font-weight: bold;">/</span>public_html<span style="color: #000000; font-weight: bold;">/</span>myweb<span style="color: #000000; font-weight: bold;">/</span>
&nbsp;
    <span style="color: #000000; font-weight: bold;">&lt;</span>directory <span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>spider<span style="color: #000000; font-weight: bold;">/</span>public_html<span style="color: #000000; font-weight: bold;">/</span>myweb<span style="color: #000000; font-weight: bold;">/&gt;</span>
        Options Indexes FollowSymLinks MultiViews
        AllowOverride All
        Order allow,deny
        allow from all
    <span style="color: #000000; font-weight: bold;">&lt;/</span>directory<span style="color: #000000; font-weight: bold;">&gt;</span>
<span style="color: #000000; font-weight: bold;">&lt;/</span>virtualHost<span style="color: #000000; font-weight: bold;">&gt;</span></pre></div></div>

<p>Save the file and close the editor window.</p>
<p>Make sure you have created this directory /home/spider/public_html/myweb/</p>
<p>Now we need to enable this site which is available in Apache. To enable the site simply run this command<br />
</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> a2ensite myweb</pre></div></div>

<p>Restart Apache to make the changes in effect<br />
</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>init.d<span style="color: #000000; font-weight: bold;">/</span>apache2 restart</pre></div></div>

<p>Thats it. We have our new website running. In your browser goto <b>http://myweb.local</b>. You will see the new website which is located in the directory we assigned to this Virtual Host.<br />
<br />If you need more websites such as this, you can repeat this process.</p>
<p>If you didn&#039;t notice, in the Directory settings I set &#039;AllowOverride All&#039; because I need mod_rewrite to work in this site. But we need to enable Rewrite module for this to work. If you don&#039;t need to override these settings set it to &#039;AllowOverride None&#039;</p>
<p><b>Enable Rewrite module in Apache</b><br />
</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> a2enmod rewrite</pre></div></div>

<p>Restart Apache to make the changes in effect<br />
</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>init.d<span style="color: #000000; font-weight: bold;">/</span>apache2 restart</pre></div></div>

<p>We now have mod_rewrite working as well. A .htaccess file with rewrite rules has to be placed in the root directory of this site to have Search Engine Friendly URLs working.</p>
<p>I hope this guide will help you to setup a LAMP development environment in Ubuntu 8.04. If you come across any issues please feel free to write to me using the comment box. </p>
<p>Happy Coding&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.nazly.net/getting-lamp-to-work-in-ubuntu-hardy/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>100+ Resources for Web Developers</title>
		<link>http://www.nazly.net/100-resources-for-web-developers/</link>
		<comments>http://www.nazly.net/100-resources-for-web-developers/#comments</comments>
		<pubDate>Mon, 10 Mar 2008 01:31:17 +0000</pubDate>
		<dc:creator>Nazly</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[HTML/XHTML]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[LAMP]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[developer]]></category>
		<category><![CDATA[FOSS]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[resources]]></category>
		<category><![CDATA[tools]]></category>
		<category><![CDATA[web]]></category>
		<category><![CDATA[xhtml]]></category>

		<guid isPermaLink="false">http://blog.nazly.net/100-resources-for-web-developers/</guid>
		<description><![CDATA[This is a fantastic list for Web Developers.
100+ Resources for Web Developers
From the Blogpost :
There is some amazing stuff out there on the Web-resources, tools, tricks, and tips. Problem is, as a Web developer, you spend so much of your time just keeping up with new technologies &#8211; learning, playing &#8211; and this doesn&#039;t leave [...]]]></description>
			<content:encoded><![CDATA[<p>This is a fantastic list for Web Developers.<br />
<br /><a href="http://blog-well.com/2008/03/04/100-resources-for-web-developers/" target="_blank">100+ Resources for Web Developers</a></p>
<p>From the Blogpost :<br />
<br /><i>There is some amazing stuff out there on the Web-resources, tools, tricks, and tips. Problem is, as a Web developer, you spend so much of your time just keeping up with new technologies &#8211; learning, playing &#8211; and this doesn&#039;t leave much time to go hunting for the latest and greatest tool, or for a better way of doing things.</p>
<p>So we&#039;ve put together a list of over 100 resources to help make your life as a developer easier; where to find snippets of code, sites that automate processes, cheat sheets, lessons, useful tools and a couple of silly videos to give your brain a break if you make it through to the end. Please enjoy!</i></p>
]]></content:encoded>
			<wfw:commentRss>http://www.nazly.net/100-resources-for-web-developers/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
