Tag: ubuntu

Setting up virtual host with mod rewrite enabled in Ubuntu Hardy Heron

Virtual host is really what the name says, a virtual environment over the top of your current web server to simulate a separate hosting environment. Using virtual host you can enable site specific features and keep your development environment totally separate from another one. For example, if you want to experiment a simple application with both mod_rewrite enabled or disabled, you can setup two virtual host with these different settings to take place. In this blog post I will show you how to set up virtual host in ubuntu hardy heron with mod_rewrite enabled.

Step 1: setup a virtual domain

open /etc/hosts and add a virtual domain with a specific local IP. In this file it contains ip and domain name separated by a space. You can also add the port using a colon with the IP. Lets assume that our virtual domain name is “ilove.php” – and It will listen to the ip “127.0.1.2”

so we will add the following line to our /etc/hosts file
127.0.1.2:80 ilove.php

now whenever you point to http://ilove.php – your browser will actually open http://127.0.1.2:80

Step 2: configure virtual host with apache
here we will configure our newly added virtual domain against apache as a virtual host, and did I forget to say, with mod_rewrite enabled 🙂

goto /etc/apache2/sites-available and create a file named “ilove.php” – I recommend to keep it the same name as your virtual domain.
sudo nano /etc/apache2/sites-available/ilove.php

write the following contents inside. but please note to create the appropriate directory before linking your virtual host with that, for example we’ve create a folder named “/home/<user name>/www/ilovephp” and linked that directory as my document root in the following configuration file.


<VirtualHost 127.0.1.2:80>
	ServerName ilove.php
	ServerAlias www.ilove.php
	ServerAdmin [email protected]
	DocumentRoot /home/<user>/www/ilovephp
	<Directory /home/<user>/www/ilovephp>
		Options FollowSymLinks
		AllowOverride All
	</Directory>

</VirtualHost>

now create a symbolic link of this file to /etc/apache2/sites-enabled directory as “ilove.php”

sudo ln -s /etc/apache2/sites-available/ilove.php /etc/apache2/sites-enabled/ilove.php

Step 3: restart apache (or reload)
simple, either one of the followings
sudo /etc/init.d/apache2 restart

or

sudo /etc/init.d/apache2 reload

or

sudo a2ensite ilove.php

and you are done! now you can point your browser to http://ilove.php

Running on Ubuntu Hardy Heron

Last night I’d migrated from gutsy to the latest release of ubuntu series, Hardy Heron. At a glance it looks really nice to me. Here is a comprehensive list of pros and cons that I’d encountered

Pros
* Clear look with new Human theme
* More support for drivers, it has detected my dell BCM 4328 card automatically
* It has detected appropriate and maximum screen resolution for my laptop automatically which I had to do in gutsy by installing proprietary xorg fglrx driver. But I installed fglrx driver to use the maximum 3D output from my ATI Radeon 1400. I can also use compiz fusion now.
* Blazing fast, really!
* Integration of Wubi (Well, ubuntu is my primary OS and I have only one OS in my machine, but it is very good for those who want to give it a try from windows)

Cons
* so far there is only one con and that is it comes with Firefox 3 beta 5. I really dont like this version of firefox caus all my favorite extensions breaks in it.

So in overall I am very happy to using the new ubuntu Hardy Heron. Give it a try.

No more windows for me, seriously!

Thats it, I closed my windows, heh heh. Last night after an accidental formatting of a system partition messed everything up and I decided duh, no more windows. So I gave gutsy gibon a go and I must say that it’s simply awesome. Previously I was using Mandriva 2007 (Based on Mandrake) spring edition for last one year, and I was happy. But I wanted to try ubuntu a bit and I am happy, seriously.

But I have to download the latest ATI driver and install it to make my ATI Radeon X1400 card to work properly. Sound card didn’t create any problem.

I am running completely on Ubuntu now. I started my installation on 31st Dec 2007 at 11 PM and Finished configuring everything in today afternoon.

Bye Bye Windows.