virtual hosts for your new project.

Posted: 03/02/2011 in Uncategorized

Open the configuration  file with the following command and add the following configuration at the end:

sudo vim /etc/apache2/sites-enabled/000-default

<VirtualHost 127.0.1.1:80>
DocumentRoot “project_root_directory_path
DirectoryIndex index.php
<Directory “project_root_directory_path“>
AllowOverride All
Allow from All
</Directory>
</VirtualHost>

The domain name www.yourprojectname.com.localhost used in the Apache configuration has to be declared locally. Open the configuration file with the following command and add the following configuration at the end:

sudo vim /etc/hosts

127.0.1.1   www.yourprojectname.com

Now enjoy the configured a dedicated domain name instead of tying a new url each time you start a new project.
(Above configurations are tested in Ubuntu 10.10)

:)

In terminal run following commands.
sudo apt-get update

sudo apt-get install wvdial

Edit wvdial.conf configuration file in /etc/wvdial.conf. Before continue to edit the file do backup wvdial.conf file.

sudo gedit /etc/wvdial.conf

Replace existing existing lines with following lines

[Dialer Defaults]
Modem = /dev/ttyUSB0
Baud = 1843200
Modem Type = Analog Modem
Init2 = ATZ
Init3 = ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
Init4 = AT+CGDCONT=1,”IP”,”dialogbb
Dial Command = ATDT
Phone = *99***1#
Username = foo
Password = bar
Stupid Mode = yes

Replace dialogbb with your Access Point Name(APN) and save the wvdial.conf file.

Each time connect the Huawei E220 HSDPA Modem run following command.

sudo wvdial

In Ubuntu 9.10 right click over the network icon in the system tray and uncheck the Enable Networking to use Empathy and Evolution mail.

Enjoy the rest using Huawei E220 HSDPA Modem with Ubuntu.

:D

Enabling mod_rewrite for Apache

Posted: 01/11/2009 in 1

Enabling mod_rewrite for Apache, mod_rewrite is compiled in by default and stoted in the /etc/apache2/mods_available directory as rewrite.load. Following line is added in rewrite.load to enabling the module for Apache.

LoadModule rewrite_module /usr/lib/apache2/modules/mod_rewrite.so

To enable mod_rewrite follow the commands below.

cd /etc/apache2
sudo cp mods-available/rewrite.load mods-enabled/

sudo gedit sites-enabled/000-default

Find the following line of code snippets

<VirtualHost *:80>
ServerAdmin webmaster@localhost
…..
<Directory /var/www/>
Options Indexes FollowSymLinks MultiViews
AllowOverride none
Order allow,deny
allow from all
</Directory>
….

</VirtualHost>

Change above code snippets as below

<VirtualHost *:80>
ServerAdmin webmaster@localhost
…..
<Directory /var/www/>
Options Indexes FollowSymLinks MultiViews
AllowOverride all
Order allow,deny
allow from all
</Directory>
….

</VirtualHost>

Now restart apache server using below commands
sudo /etc/init.d/apache2 restart

Now mod_rewrite is enabled in ur Apache server which allows you to rewrite and manipulate URLs which are sent to your webserver.

Renaming Apache User Directories

Posted: 31/05/2009 in Uncategorized

Enabling Apache User Directories and Renaming user user directories as follows.
Create a folder in your directory and name it whatever you like to name it. For example lets say folder name is web.

Edit the userdir.conf file:
sudo gedit /etc/apache2/mods-enabled/userdir.conf
rename the public_html as web

Modified userdir.conf file content would be as below:

<IfModule mod_userdir.c>
UserDir web
UserDir disabled root

<Directory /home/*/web>
AllowOverride FileInfo AuthConfig Limit Indexes
Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec
<Limit GET POST OPTIONS>
Order allow,deny
Allow from all
</Limit>
<LimitExcept GET POST OPTIONS>
Order deny,allow
Deny from all
</LimitExcept>
</Directory>
</IfModule>

Restart Apache2
sudo /etc/init.d/apache2 restart

Have fun with your own folder name instead of public_html.
:-)