Riding The Breeze

Jump to content

Additional information

Categories


Posts filed in ‘Ubuntu’


Automatic vHost with Apache

May 2008
19

In my development machine i wanted to have a specific vHost for each project. Something that would allow me to type URL like:

I started to set for each one a vHost in Apache but after a while I’ve found myself with too many vHost files.

So I started to search for a more easy and fast way, and here it is:

Note: you need to install Apache mod_rewrite to make things work.

Preamble:

  1. You have Apache installed, and your DocumentRoot is /var/www/
  2. You have mod_rewrite installed and enabled
  3. You can modify the /etc/hosts file

Let’s say we want to install a test/demo version of Wordpress and access it from the URL http://wp-test.lan/

  1. We download and untar Wordpress in /var/www/wp-test/
  2. We tell our machine to resolve the domain wp-test.lan with the IP 127.0.0.1. To make this we add a line to our hosts file.hpatoio@namazu:~$ sudo su -
    [sudo] password for hpatoio:
    root@namazu:~#echo “127.0.0.1 wp-test.lan” >> /etc/hosts
    root@namazu:~#exit
    hpatoio@namazu:~$
  3. Now we have to change Apache config. Open /etc/apache2/sites-anabled/000-default with your favorite editor and add these lines inside the <VirtualHost *> directive:RewriteEngine on
    RewriteCond %{HTTP_HOST} ^([^.]+)\.lan$
    RewriteRule ^(.+)$ /%1$1
    Basically :

    • The first line turns the mod_rewrite on
    • The second one tells Apache to keep in the host part of the URL (HTTP_HOST) everything that stands before “.lan”
    • Finally the third line insert the string matched before (%1) between the host and the resource part (directory + file + query string) of the requested URL
  4. Restart Apache
  5. hpatoio@namazu:~$sudo /etc/init.d/apache2 restart
    Now if open your browser and you point it to the URL http://wp-test.lan/ you should see the WP installation page. Right ?


Ubuntu Dual Monitor Setup

Sep 2006
26

Hello, I’m finally on Ubuntu, Dapper drake :)
The setup was really easy. I don’t have any strange device connected to the PC.

The only thing that didn’t work immediately was the dual monitor; I have a Nvidia 7600GS with dual DVI output with 2 BenQ FP93G.

Thanks to this great tutorial Dual Monitors TwinView HowTo By Steve Fink the setup was fast and easy.

Just 2 advices:

1) Be sure that in your xorg.conf under Section Device you have

Driver “nvidia”

and not

Driver “nv”

dunno why but this was my default value.

2) If the second monitor do not works set the horizontal resolution to twice the monitor resolution.
For example, my monitor has 1280×1024 and I had to set the resolution to 2560×1024.


Paging

Credits

Template designed by praegnanz.de.