Wednesday, September 9, 2009

Install AWstats in DirectAdmin

cd /usr/local/directadmin/custombuild

vi options.conf

change "awstats=no" to "awstats=yes"

./build update

./build awstats





vi /usr/local/directadmin/conf/directadmin.conf
change ""awstats=0" "awstats=1"

cd /usr/local/directadmin/scripts ./awstats.sh

echo 'action=tally&value=all' >> /usr/local/directadmin/data/task.queue


/usr/local/directadmin/dataskq d


/etc/init.d/directadmin restart

Monday, March 30, 2009

How to share internet connection between your Linux Virtual Machine and Windows

I am using the VMWare server 1.0.8 with Windows XP as host and Ubuntu 8.1 as guest

Select your Network interface for type for the Guest OS

Configure the selected card in VMWare setting

Choose the Network IP 192.168.0.0 and click ok

Configure DHCP server for NAT I've set IP range 192.168.1.124 - 192.168.1.254

Open up a terminal ...

..and type 

sudo gedit /etc/network/interfaces

This wil give you a window like the one below.

add the following lines 

auto lo

iface lo inet loopback

auto eth0

iface eth0 inet dhcp

Now we need to setup inetrnet connection sharing in windows

Select the Local Area Connection properties >> Advanced tab >> Check internet connection sharing and select the Vmnet8


Now return t your Ubuntu and run

sudo /etc/init.d/networking restart

Congrats!! Your're done. Now you can browse the web from your guest Virtual Machine

Friday, November 7, 2008

Firefox does not open

When u see "Another copy of firefox is still running" error,
open a console window and type

find ~ -iname .parentlock | grep mozilla

this will give you a file like this
/home/goutham/.mozilla/firefox/7h0madvl.default/.parentlock

now remove the file using
rm /home/goutham/.mozilla/firefox/7h0madvl.default/.parentlock

That's it!! U're done!!

Thursday, November 6, 2008

Run php as cgi in Apache

Download and intstall apache and php, I recommend using the tarball.
I installed apache in /usr/local/apache
./configure --prefix=/usr/local/apache;make;make install
and php reside in /usr/local/php
./configure --prefix=/usr/local/php/

Now you may edit the config file for apache
vim /usr/local/apache/conf/httpd.conf

you may place your .php file inside the document root directory
for me it is index.php
DocumentRoot "/usr/local/apache/htdocs/"
Inside the Directory section of "/usr/local/apache/htdocs/"
Options ExecCGI
AddType php-script .php #make sure there's no other type defined for .php
#Instead of AddType you may use AddHandler or SetHandler whichever is appropriate. See what is the differece, here.
Action php-script "/myphp-cgi/php-cgi"
Order allow,deny
Allow from all

ScriptAlias /myphp-cgi/ "/usr/local/php/bin/" #Map your php-binary location using ScriptAlias

You have to access the file appending /index.php unless you specify it with DirectoryIndex