755, 644

November 4, 2011

find . -type d -exec chmod 755 {} \;

find . -type f -exec chmod 644 {} \;


change Apache 2 default port

May 11, 2011

Question: How do I change Apache 2 default port under Debian / Ubuntu Linux? I’ve couple of public IPv4 address assigned by my ISP, how do I force Apache2 to listen to a specific IP address? How do I change Apache2 IP address binding?

Answer: You can easily change the port and other settings using following directives:

Apache Listen Directive

The Listen directive instructs Apache to listen to more than one IP address or port; by default it responds to requests on all IP interfaces, but only on the port given by the Port directive. You can use this directive multiple times.

Task: Change Apache port

Open /etc/apache2/ports.conf file, enter:
# vi /etc/apache2/ports.conf
OR
$ sudo vi /etc/apache2/ports.conf
To make the server accept connections on both port 8010, enter:
Listen 8010
To make the server accept connections on both port 80 and port 8010, use:
Listen 80
Listen 8010

Task: Accept connections on specific IP / interface port

You need to use network interfaces IP address. For example, to make the server accept connections on IP 202.54.1.2 and port 80, enter:
Listen 202.54.1.2:80
To make the server accept connections on two specified interfaces and port numbers, enter:
Listen 202.54.2.1:80
Listen 202.54.2.5:8010

Save and close the file. Restart Apache 2 webserver:
# /etc/init.d/apache2 restart
OR
$ sudo /etc/init.d/apache2 restart

How do I verify port and IP binding working ?

Use netstat command to find out if Apache is listening on a specific port or not, use:
# netstat -tulpn
# netstat -tulpn | grep :80
# netstat -tulpn | grep :8010
# netstat -tulpn| grep 202.54.1.2:80

Sample output:

tcp        0      0 202.54.1.2:80            0.0.0.0:*               LISTEN     19306/apache2


Gmail/Facebook Style jQuery Chat

May 6, 2011

Gmail/Facebook Style jQuery Chat.


របៀប​ប្ដូរ​ button layouts ពីឆ្វេង​ទៅ​ស្ដាំ ក្នុង Ubuntu

March 13, 2011
  1. ចុច alt+F2
  2. វាយ​ពាក្យថា gconf-editor
  3. ចូល​ទៅ app > metacity > general
  4. ស្វែង​រក​ពាក្យ button_layout (/apps/metacity/general/button_layout)
  5. ហើយ​ប្ដូរ​តំលៃវាទៅជា :minimize,maximize,close

- Sample :-)

This slideshow requires JavaScript.


How to Reset Password for root in MySQL

February 28, 2011

How to Reset Password for root in MySQL

- Go to mysql command prompt (or run in command prompt and go to mysql/bin)
- Type SET PASSWORD FOR root@localhost=PASSWORD(”);
- Type Flush Previleg;
- Done!


TiddlyWiki

February 24, 2011

a reusable non-linear personal web notebook

TiddlyWiki is a single html file which has all the characteristics of a wiki – including all of the content, the functionality (including editing, saving, tagging and searching) and the style sheet. Because it’s a single file, it’s very portable – you can email it, put it on a web server or share it via a USB stick.

Readmore


របៀប​ដំ​ឡើង​ Lighttpd – webserver លើ​ Ubuntu (10.10)

February 2, 2011

មិន​មែន​ជា​រឿង​អ្វី​ថ្មី ហើយ​លំបាក​ពេកទេ Lighttpd or Lighty ជា​ Web Server ដែល​ប្រើ​ Resource តិច​ហើយ​ស្រាល។
ដើម្បី​ដំ​ឡើង​សូម​ធ្វើ​ដូច​ខាង​ក្រោម:

ដំឡើង​ Package ដែល​យើ​ង​ត្រូវ​ការ

sudo apt-get install lighttpd php5-cgi

ដំណើរការ fastcgi module និងphp configuration ជាមួយ

sudo lighty-enable-mod fastcgi
sudo lighty-enable-mod fastcgi-php

ដំនើរ​ការ​ឡើង​វិញ lighttpd daemon

sudo service lighttpd force-reload

បង្កើត​ឯកសារ​ /var/www/index.php ដែលមាន​ឃ្លា​ដូច​ខាង​ក្រោម:​ (ដើម្បី​ពិនិត្យ​ថា​ web server ដំនើរ​ការ​រឺ​ទេ)

<?php phpinfo(); ?>

ចូល​ទៅ broswer ហើយ​បញ្ចូល​អាស័យ​ដ្ឋាន http://localhost/index.php


January 30, 2011


Topic: Dual boot grub2 Ubuntu 10.10 and Window 7

January 15, 2011

I had a working dual boot Ubuntu 10.10 and Window 7. After installing, Window 7 will create bootloader file which disable Ubuntu from loading.In order to be able to use Window and Ubuntu peacefully at the same time, where you can have menu to select which OS you want to load, the following step might be handful to you. There are the steps I did and It works fine with my case.
The thing that I did are:

- used the supergrub to detect and boot to Ubuntu 10.10

- Reinstall grub2 using command
sudo apt-get install grub-pc

- Remove the configuration of grub legacy
sudo  rm -f /boot/grub/menu.lst*

- Upgrade to grub2
sudo upgrade-from-grub-legacy
Remember to choose the right harddisk and partition you have installed Ubuntu.

- Update the grub2 (this will generate grub.cfg file)
sudo update-grub

By updating it detect the configuration and stored it to grub.cfg, it also detect the window partition.
Now I have grub which show both working ubuntu and window to choose from.

Reference:
Grub2 Ubuntu Wiki
SuperGrub


Topic: apt-get update fails

December 27, 2010
  • Open /etc/apt/sources.list.d/medibuntu.list file and delete all of its contents:
  • sudo cp /etc/apt/sources.list.d/medibuntu.list /etc/apt/sources.list.d/medibuntu.list.bak
  • gksudo gedit /etc/apt/sources.list.d/medibuntu.list

Select all texts inside the file and delete it, Save.

And, on the terminal:

  • echo “deb http://packages.medibuntu.org/ hardy free non-free” | sudo tee -a /etc/apt/sources.list
  • wget -q http://packages.medibuntu.org/medibuntu-key.gpg -O- | sudo apt-key add – && sudo apt-get update

Follow

Get every new post delivered to your Inbox.