Sunday, March 30, 2008

not start x server

/etc/inittab :


ref: DIYism

The smallest web server (lamp) in the world: damn small linux (DSL or DamnSmall), dsl-3.3.iso is only 50M.
While,it is also the smallest desktop linux.
============Installing to the Hard Disk==================
1)Boot up the DSL livecd.
2)Open up an xterminal window (click on the A:Terminal icon
or right-click on the desktop and choose a terminal) and type:
sudo -s
cfdisk /dev/sda #or cfdisk /dev/hda(in VMWare, to use IDE, not recommended SCSI)
create 2 new partitions:
hda1 Linux Swap Type 82, Size:at least 128mb
hda2 Linux Type 83, Size:the rest of the disk space, Flag this partition as bootable
In xterminal window, type:
sudo -s
mkswap /dev/sda1 #or mkswap /dev/hda1
swapon /dev/sda1 #or swapon /dev/hda1
3)In xterminal window, type:
dsl-hdinstall #in VMWare, to select grub, not lilo
4)Eject the livecd, reboot without livecd(bios setup)
===================Setup DamnSmall==================
5)Logon with user DSL
6)In xterminal window:
vi /etc/network/interfaces
auto eth0
iface eth0 inet static
# dns-* options are implemented by the resolvconf package, if installed
/etc/init.d/networking start #add it into "/opt/" to start it while boot
7)StartMenu/System/Control Panel/Select Mirror/Select
or Start Menu/Apps/Tools/Mirror Selector,
choose an available address
8)Start ssh in xterminal window:
sudo /etc/init.d/ssh start #add it into "/opt/"
===================Installing myDSL Softwares==================
9)Install mydsl apache(include php4.4):
StartMenu/Apps/Tools/myDSL Extension Browser/Net/apache-2.0.54/download
start apache:
or in xterminal window:
/opt/wwwroot/bin/apachectl -k start #add it into "/opt/"
10)Uninstall mydsl apache:
rm -R /opt/wwwroot
rm /home/dsl/.fluxbox/
vi /home/dsl/.fluxbox/menu
to delete "[include](.fluxbox/"
11)Install mydsl gcc:
StartMenu/Apps/Tools/myDSL Extension Browser/System/gcc1.dsl/download
StartMenu/Apps/Tools/myDSL Extension Browser/System/libc6-dev.dsl/download
===================Installing Source Softwares==================
12)Enable apt-get to install deb packages(some may break, for instance, the X servers):
In xterminal window:
sudo dpkg-restore
or StartMenu/Apps/Tools/Enable Apt
13)Install gcc(prepare for install source software):
StartMenu/Apps/Tools/myDSL Extension Browser/System/synaptic.dsl/download
#maybe need use mydsl-load and delete /tmp/noload
In xterminal window:
In Synatpic:
install gcc
14)Install apache:
cd /usr/local/apache
wget #don't use httpd-2.0, will fail
tar zxvf httpd-2.2.4.tar.gz
cd httpd-2.2.4
./configure --prefix=/usr/local/apache
make install
cd ..
rm httpd-2.2.4.tar.gz
cp bin/httpd /etc/init.d/httpd
/etc/init.d/httpd -k start #add it into "/opt/"
15)Setup apache:
vi /usr/local/apache/conf/httpd.conf
DirectoryIndex index.php index.htm
DocumentRoot "/var/www"
Options -Indexes
ServerLimit 1500 #from MaxClients 150
LoadModule php5_module modules/
AddType application/x-httpd-php .php
NameVirtualHost *:80

DocumentRoot /var/www/labs
Alias /search /var/www/search/
#Sometimes you need "path alias"(similar to "virtual directory" in IIS), notice:alias without end "/" but realname with end "/", thus to make both "file alias" and "path alias" pointed to "path realname"
php_admin_value open_basedir /var/www/labs:/tmp

DocumentRoot /var/www/myliba
php_admin_value open_basedir /var/www/myliba:/tmp

16)Install mydsl gnu-utils(prepare for mysql, need ps command):
StartMenu/Apps/Tools/myDSL Extension Browser/System/gnu-utils.dsl/download
In xterminal window(prepare for mysql):
apt-get install libz-dev
apt-get install libxml2-dev
17)Install mysql:
cd /usr/local/mysql
wget #not use official, because of unstable version
tar zxvf mysql-5.0.27.tar.gz
cd mysql-5.0.27
./configure -prefix=/usr/local/mysql -with-charset=utf8 -with-extra-charsets=all #make character_set_database as utf8
make #wait for long time
make install
cp support-files/my-medium.cnf /etc/my.cnf
cp support-files/mysql.server /etc/init.d/mysql.server
cd ..
rm mysql-5.0.27.tar.gz
groupadd mysql
useradd -g mysql mysql
chown -R root /usr/local/mysql
chgrp -R mysql /usr/local/mysql
chown -R mysql /usr/local/mysql/var
/usr/local/mysql/bin/mysql_install_db --user=mysql &
/usr/local/mysql/bin/mysqld_safe --user=mysql #start mysql
/usr/local/mysql/bin/mysqladmin -uroot password xxxxx //set root password
vi /opt/
add: /usr/local/mysql/bin/safe_mysqld --user=mysql & #let mysql start with os
/usr/local/mysql/bin/mysql -u root -pxxxxx
create database db_app; #not lost ";"
grant all on db_app1.*,db_app2.* to db_user@localhost identified by 'xxxxx'; #to create or modify one user
18)Install flex and bison(prepare for php):
StartMenu/Apps/Tools/myDSL Extension Browser/System/flex-bison-libtool.dsl/download
In xterminal window:
apt-get install zlib1g
19)Install libxml2-(>=2.6.11):
cd /usr/local/libxml2
tar zxvf libxml2-2.6.27.tar.gz
cd libxml2-2.6.27
./configure --prefix=/usr/local/libxml2
make install
cd ..
rm libxml2-2.6.27.tar.gz
20)Install php:
cd /usr/local/php
tar zxvf php-5.1.6.tar.gz
cd php-5.1.6
./configure --prefix=/usr/local/php \
--with-apxs2=/usr/local/apache/bin/apxs \ #create /usr/local/apache/modules/
--enable-sockets \
--with-config-file-path=/usr/local/php \ #set path to find php.ini
--with-mysql=/usr/local/mysql \ #add mysql client extension
--enable-so #must exist, else apache will report undefined symbol: php_escape_html_entities
make #wait for while
make install
cp php.ini-dist /usr/local/php/php.ini
cd ..
rm php-5.1.6.tar.gz
21)Setup php:
vi /usr/local/php/php.ini
open_basedir = /var/www/html #restrict php activity area
error_reporting = 0 #avoid expose php code while errors
register_globals = Off #avoid post/get/cookie global variabal covering

Setup SSH

sudo /etc/init.d/ssh start #add it into "/opt/"

Thursday, January 3, 2008

decrease grub wait time

edit /boot/grub/menu.lst, modify
timeout 15 --> timeout 1

Install Level-One WNC-0301USB into DSL linux by ndiswrapper, iwconfig

All done with root privilage:
sudo -s

Download Driver from web with zd1211u.inf

Install Driver
ndiswrapper -i zd1211u.inf

Check Installation with
ndiswrapper -l

It will show installed drivers:
zd1211u driver installed, hardware present

Load Module into Kernel
modprobe ndiswrapper

The usb flash light once.

show the network status with ID wlan0

set wlan options, and bring dhcp up
iwconfig wlan0 key abcdef1234
iwconfig wlan0 key open
iwconfig wlan0 key on
iwconfig essid my_network
ifconfig wlan0 up
pump -i wlan0

check status by

To make wireless network auto load everytime dsl start:

Add Line to /etc/modules:

Add Line to /opt/
iwconfig wlan0 key abcdef1234
iwconfig wlan0 key open
iwconfig wlan0 key on
iwconfig essid my_network
ifconfig wlan0 up
pump -i wlan0

Actually, I perform the same procedual by DSL (Not DSL-N) but ehe keyboard lock-up after bring up network card by ifconfig wlan0 up, it may cause by the 4K stack problem (i don't know how to solve by Damn Small Linux), so I give up trying DSL (Althought I thought it is better) and use DSL-N instead.

Install Firefox into DSL

Because DSL does not load MyDSL extension automatically after reboot.

Download firefox- by MyDSL into /tmp, and move the file into /usr/local/lib
cp /tmp/firefox- /usr/local/lib

At the end of /opt/, add line to load firefox each time windows start:
mydsl-load /usr/local/lib/firefox-

To make my DSL-N display chinese (both TC & SC)

Pre-Installed: firefox-

sudo -s
cd /home/dsl
mkdir .fonts
cd .fonts
tar -zxvf ~/fireflysung-1.3.0.tar.gz

After successful unpack the fonts, the firefox can display chinese properly, to check the existence of Chinese fonts, type the following command.
fc-listgrep Sung