Configure your network settings to use the IP addresses
8.8.8.8
and 8.8.4.4
as your primary and secondary DNS servers respectively.Open Source is a great idea and it has changed the world!
Open Source forever ....
While you do not know attack, how can you know about defense? (未知攻,焉知防?)
Do BAD things .... for the RIGHT reasons -- OWASP ZAP
It is easier to port a shell than a shell script. -- Larry Wall
Most of you are familiar with the virtues of a programmer. There are three, of course: laziness, impatience, and hubris. -- Larry Wall
为天地立心, 为生民立命, 为往圣继绝学, 为万世开太平。 -- 王炜
8.8.8.8
and 8.8.4.4
as your primary and secondary DNS servers respectively.sudo service gdm stop
sudo Xorg -configure
sudo service gdm start
Modeline "1024x768" 65 1024 1048 1184 1344 768 771 777 806 -hsync -vsync
Monitor Section
" of ~/xorg.conf.new
.sudo cp xorg.conf.new /etc/X11/xorg.conf
System
" - "preference
" - "Display
"Yes
" and select the desired resolution then save.System
" - "Administration
" - "Hardware driver
".sudo nvidia-xconfig
gksudo nvidia-settings
System
" - "preference
" - "Display
"No
" and select the desired resolution then save.sudo apt-get remove b43xx-fwcutter
sudo apt-get install bcmwl-kernel-source
wl
" to the following file.sudo nano /etc/modules
wl
sudo nano /etc/modprobe.d/wl
install wl modprobe -r b43 b44 b43legacy ssb; modprobe --ignore-install wl $CMDLINE_OPTS; modprobe ssb; modprobe b44;
sudo apt-get install scim scim-modules-table scim-chewing scim-pinyin scim-chinese
cd ~
wget http://www.tegaki.org/releases/0.3/tegaki-python-0.3.tar.gz
tar -xzvf tegaki-python-0.3.tar.gz
cd tegaki-python-0.3
sudo python setup.py install
cd ~
wget http://www.tegaki.org/releases/0.3/tegaki-pygtk-0.3.tar.gz
tar -xzvf tegaki-pygtk-0.3.tar.gz
cd tegaki-pygtk-0.3
sudo python setup.py install
cd ~
wget http://www.tegaki.org/releases/0.3/tegaki-recognize-0.3.tar.gz
tar -xzvf tegaki-recognize-0.3.tar.gz
cd tegaki-recognize-0.3
sudo python setup.py install
cd ~
wget http://www.tegaki.org/releases/0.1/scim-tegaki-0.1.tar.gz
tar -xzvf scim-tegaki-0.1.tar.gz
cd scim-tegaki-0.1
sudo python setup.py install
cd ~
wget http://www.tegaki.org/releases/0.3/tegaki-train-0.3.tar.gz
tar -xzvf tegaki-train-0.3.tar.gz
cd tegaki-train-0.3
sudo python setup.py install
cd ~
wget http://www.tegaki.org/releases/0.3/tegaki-tools-0.3.tar.gz
tar -xzvf tegaki-tools-0.3.tar.gz
cd tegaki-tools-0.3
sudo python setup.py install
cd ~
wget http://www.tegaki.org/releases/0.3/models/tegaki-zinnia-traditional-chinese-0.3.zip
unzip tegaki-zinnia-traditional-chinese-0.3
cd tegaki-zinnia-traditional-chinese-0.3
make
sudo make install
cd ~
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install python-zinnia zinnia-utils libzinnia0
sudo nano /usr/share/applications/tegaki.desktop
[Desktop Entry]
Version=1.0
Encoding=UTF-8
Name=Tegaki Handwriting
Exec=tegaki-recognize
Icon=/usr/local/share/tegaki/icons/handwriting.png
Terminal=false
Type=Application
Categories=Application;System;
Comment=Tegaki Handwriting
elevator=noop i8042.noloop=1
sudo nano /boot/grub/grub.cfg
linux
" tag and append the following at the end of the line.elevator=noop i8042.noloop=1
sudo apt-get update
sudo apt-get upgrade
sudo apt-get dist-upgrade
sudo apt-get install xserver-xorg-input-evtouch gnome-randr-applet
sudo nano /etc/hal/fdi/policy/evtouch.fdi
<?xml version="1.0" encoding="UTF-8" ?>
<deviceinfo version="0.2">
<device>
<match key="info.product" contains="eGalax Inc. USB TouchController">
<merge key="input.x11_driver" type="string">evtouch</merge>
<merge key="input.x11_options.ReportingMode" type="string">Raw</merge>
<merge key="input.x11_options.Emulate3Buttons" type="string">false</merge>
<merge key="input.x11_options.Emulate3Timeout" type="string">1</merge>
<merge key="input.x11_options.SendCoreEvents" type="string">On</merge>
<merge key="input.x11_options.MinX" type="string">0</merge>
<merge key="input.x11_options.MinY" type="string">2</merge>
<merge key="input.x11_options.MaxX" type="string">4096</merge>
<merge key="input.x11_options.MaxY" type="string">4096</merge>
</match>
</device>
</deviceinfo>
System
" - "Administration
" - "Calibrate Screen
" and follow the instruction on screen to calibrate the screen.sudo wget http://www.medibuntu.org/sources.list.d/karmic.list --output-document=/etc/apt/sources.list.d/medibuntu.list &&
sudo apt-get -q update &&
sudo apt-get --yes -q --allow-unauthenticated install medibuntu-keyring &&
sudo apt-get -q update
echo "deb http://ppa.launchpad.net/nvidia-vdpau/ppa/ubuntu karmic main" | sudo tee -a /etc/apt/sources.list.d/nvidia-vdpau.list
echo "deb-src http://ppa.launchpad.net/nvidia-vdpau/ppa/ubuntu karmic main" | sudo tee -a /etc/apt/sources.list.d/nvidia-vdpau.list
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys CEC06767
sudo apt-get update
sudo apt-get upgrade
sudo sh -c 'echo "Test I want to write" > /path/to/file'
sudo apt-get install x264 gxine gxineplugin mencoder mplayer-nogui
sudo apt-get install ubuntu-restricted-extras quicktime-utils quicktime-x11utils libdvdnav4 libdvdread4 libdvdcss2 non-free-codecs faad
System
" - "Administration
" - "Hardware driver
" from the menu on the desktop.190
version as prompted. After the install, you are required to reboot your system.sudo apt-get remove nvidia-settings
sudo apt-get install nvidia-settings-190
sudo apt-get remove nvidia-settings-190
wget ftp://download.nvidia.com/XFree86/Linux-x86/195.22/NVIDIA-Linux-x86-195.22-pkg1.run
wget ftp://download.nvidia.com/XFree86/Linux-x86_64/195.22/NVIDIA-Linux-x86_64-195.22-pkg2.run
sudo apt-get remove nvidia-settings-190
sudo service gdm stop
sudo sh NVIDIA-Linux-x86-195.22-pkg1.run
sudo sh NVIDIA-Linux-x86_64-195.22-pkg2.run
sudo service gdm start
sudo sh NVIDIA-Linux-x86_64-195.22-pkg2.run --uninstall
sudo sh NVIDIA-Linux-x86-195.22-pkg1.run --uninstall
sudo service gdm stop
sudo apt-get --reinstall install nvidia-settings-190 nvidia-190-libvdpau nvidia-glx-190 nvidia-common nvidia-190-kernel-source xserver-xorg-video-nv nvidia-190-modaliases
sudo reboot
vdpau
" is installed and activated.ffmpeg -formats | grep vdpau
sudo apt-get install mercurial
mkdir mygica
cd mygica
hg clone http://bitbucket.org/davidtlwong/mygica_x8558pro
cd mygica_x8558pro
make
sudo make install
FireDTV
, you should do the following.nano v4l/.config
CONFIG_DVB_FIREDTV=m
" and change to "CONFIG_DVB_FIREDTV=n
" make
" again.make
sudo make install
wget http://bitbucket.org/davidtlwong/mygica_x8558pro/get/tip.tar.gz
tar -xvzf tip.tar.gz
cd mygica_x8558pro
make
sudo make install
FireDTV
, you should do the following.nano v4l/.config
CONFIG_DVB_FIREDTV=m
" and change to "CONFIG_DVB_FIREDTV=n
" make
" again.make
sudo make install
gxine
once and quit.cd ~
nano .config/gxine/config
nano .config/gxine/channels.conf
inews:586000000:INVERSION_AUTO:BANDWIDTH_8_MHZ:FEC_2_3:FEC_2_3:QAM_16:TRANSMISSION_MODE_8K:GUARD_INTERVAL_1_32:HIERARCHY_NONE:0:0:83
j2:586000000:INVERSION_AUTO:BANDWIDTH_8_MHZ:FEC_2_3:FEC_2_3:QAM_16:TRANSMISSION_MODE_8K:GUARD_INTERVAL_1_32:HIERARCHY_NONE:0:0:82
jadehd:586000000:INVERSION_AUTO:BANDWIDTH_8_MHZ:FEC_2_3:FEC_2_3:QAM_16:TRANSMISSION_MODE_8K:GUARD_INTERVAL_1_32:HIERARCHY_NONE:0:0:85
hdtv:602000000:INVERSION_AUTO:BANDWIDTH_8_MHZ:FEC_1_2:FEC_1_2:QAM_64:TRANSMISSION_MODE_8K:GUARD_INTERVAL_1_8:HIERARCHY_NONE:0:0:12
atv13:602000000:INVERSION_AUTO:BANDWIDTH_8_MHZ:FEC_1_2:FEC_1_2:QAM_64:TRANSMISSION_MODE_8K:GUARD_INTERVAL_1_8:HIERARCHY_NONE:0:0:13
ctiatv:602000000:INVERSION_AUTO:BANDWIDTH_8_MHZ:FEC_1_2:FEC_1_2:QAM_64:TRANSMISSION_MODE_8K:GUARD_INTERVAL_1_8:HIERARCHY_NONE:0:0:14
cctv:602000000:INVERSION_AUTO:BANDWIDTH_8_MHZ:FEC_1_2:FEC_1_2:QAM_64:TRANSMISSION_MODE_8K:GUARD_INTERVAL_1_8:HIERARCHY_NONE:0:0:15
jade:482000000:INVERSION_AUTO:BANDWIDTH_8_MHZ:FEC_AUTO:FEC_AUTO:QAM_64:TRANSMISSION_MODE_8K:GUARD_INTERVAL_1_32:HIERARCHY_NONE:811:0:1
pearl:482000000:INVERSION_AUTO:BANDWIDTH_8_MHZ:FEC_AUTO:FEC_AUTO:QAM_64:TRANSMISSION_MODE_8K:GUARD_INTERVAL_1_32:HIERARCHY_NONE:841:0:2
home:482000000:INVERSION_AUTO:BANDWIDTH_8_MHZ:FEC_AUTO:FEC_AUTO:QAM_64:TRANSMISSION_MODE_8K:GUARD_INTERVAL_1_32:HIERARCHY_NONE:111:0:11
world:482000000:INVERSION_AUTO:BANDWIDTH_8_MHZ:FEC_AUTO:FEC_AUTO:QAM_64:TRANSMISSION_MODE_8K:GUARD_INTERVAL_1_32:HIERARCHY_NONE:161:0:16
channels.conf
" is for HONG KONG
only.channels.conf
" will be played once it is activated..xine
" directory.cp .config/gxine/channels.conf .xine/channels.conf
sudo apt-get install dvb-apps
scan /usr/share/dvb/dvb-t/hk-HongKong > channels.conf
File
" - "Configure
" - "Perference
" on the gXine control panel. Make changes as is.
gui : experience_level (Expert)
audio : a52 : dynamic_range (enabled)
audio : a52 : surround_downmix (enabled)
audio : a52 : level (200)
audio : volume : mixer_volume (100)
audio : volume : remember_volume (enabled)
media : dvb : tuning_timeout (3500)
media : dvb : remember_channel (disabled) *Enabled if you want
media : dvb : channels_conf (select .config/gxine/channels.conf)
engine : performance : memcpy_method (libc)
engine : buffers : video_num_buffers (519999)
engine : buffers : video_num_frames (50)
Audio
" - "Configure Plugins
" - "Audio Post-processing
" on gXine control panel.volnorm
" - "properties
" - "method
" (1
) and apply the change.Video
" - "Configure Plugins
" - "Deinterlace
" on gXine control panel.tvtime
" - "properties
" - "method
" (use_vo_driver
) and apply the change.Video
" - "Configure Plugins
" - "Deinterlace
" on gXine control panel.pp
" - "properties
" - "quality
" (39
) - "mode
" (vb
) and apply the change.Video
" - "Configure Plugins
" - "Deinterlace
" on gXine control panel.pp
" - "properties
" - "quality
" (39
) - "mode
" (ha
) and apply the change.Video
" - "Configure Plugins
" - "Deinterlace
" on gXine control panel.pp
" - "properties
" - "quality
" (39
) - "mode
" (va
) and apply the change.Video
" - "Configure Plugins
" - "Video Post-processing
" on gXine control panel.tvtime
" - "properties
" - "method
" (LinearBlend
) and apply the change.Application
" - "Mutimedia
" - "gXine
".File
" - "DVB
" or "Playlist
" to watch TV on gxine. If you just start the gXine, you should click "DVB
".Video
" and uncheck "Post-processing
" and check "DeInterlace
". Otherwise, the video and sound cannot be synchronized.Video
" and check "DeInterlace
" and "Post-processing
". Otherwise, the playback will be chopping.lsusb
Bus 001 Device 002: ID 0572:d811 Conexant Systems (Rockwell), Inc.
sudo apt-get install dvbsnoop dvbtune
dvbsnoop -s signal
ksng
".David T.L. WONG
for the MyGica driver while "ksng
" for the streaming scripts. They are active members of HKEPC Linux forum.sudo apt-get update
sudo apt-get upgrade
sudo apt-get install linux-generic-pae
sudo apt-get install linux-image-generic-pae linux-headers-generic-pae
uname -r
2.6.31-14-generic-pae
sudo apt-get remove linux-generic
sudo apt-get remove linux-image-generic linux-headers-generic
sudo apt-get remove linux-image-`uname -r | grep "pae" | cut -d- -f1,2,3 | cut -c 1-`
sudo apt-get remove linux-headers-`uname -r | grep "pae" | cut -d- -f1,2,3 | cut -c 1-`
sudo update-initramfs -u
sudo update-grub2
Traditional Chinese
from the menu when you install and follows the instruction on screen. Choose Taiwan
as time zone no matter you are living in Hong Kong or not. You may change to the correct time zone after the installation.sudo apt-get update
sudo apt-get upgrade
System
>> Administration
and select Language Support
. Install the missing language pack. Make sure the panel displays "Chinese (Taiwan)
" after the installation.sudo apt-get install scim scim-modules-table scim-chewing scim-pinyin scim-chinese
System
> Administration
and select Language Support
. Changes "iBus
" to "SCIM
" on the panel.sudo nano /etc/fonts/conf.d/49-sansserif.conf
sans-serif
" to "sans
".Ubuntu 9.04 Server
and OpenSSH
. If your web application requires email function, you should also install Mail Server
also.sudo apt-get update
sudo apt-get upgrade
sudo apt-get dist-upgrade
sudo apt-get install mysql-server mysql-client php5-cgi php5 php5-cli php5-mysql php5-curl php5-gd php5-idn php-pear php5-imagick php5-imap php5-mcrypt php5-memcache php5-mhash php5-ming php5-ps php5-pspell php5-recode php5-snmp php5-sqlite php5-tidy php5-xmlrpc php5-xsl
sudo wget http://www.hiawatha-webserver.org/files/hiawatha-6.17.1.tar.gz
tar -xzvf hiawatha-6.17.1.tar.gz
cd hiawatha-6.17.1
sudo apt-get install libc6-dev libssl-dev dpkg-dev debhelper fakeroot libxml2-dev libxslt1-dev
sudo nano cgi-wrapper.c
rest = uncomment(line);
add the following lines :if (*rest == '\0') {
continue;
}
hiawatha-6.17.1
directory, build the Hiawatha deb package../configure
make deb
/home/samiux
. You can install it now.cd ..
sudo dpkg -i hiawatha_6.17.1_amd64.deb
sudo dpkg -i hiawatha_6.17.1_i386.deb
php.ini
.sudo nano /etc/php5/cgi/php.ini
display_errors = Off
log_errors = On
allow_url_fopen = Off
safe_mode = On
expose_php = Off
enable_dl = Off
disable_functions = system, show_source, symlink, exec, dl, shell_exec, passthru, phpinfo, escapeshellarg, escapeshellcmd
safe_mode = Off
.php-fcgi.conf
.sudo nano /etc/hiawatha/php-fcgi.conf
Server = /usr/bin/php5-cgi ; 127.0.0.1:2005 ; www-data
php-fcgi
.sudo php-fcgi -c /etc/hiawatha/php-fcgi.conf
php-fcgi.conf
, make sure to restart it by following commands.sudo php-fcgi -k -c /etc/hiawatha/php-fcgi.conf
sudo php-fcgi -c /etc/hiawatha/php-fcgi.conf
hiawatha.conf
.sudo nano /etc/hiawatha/hiawatha.conf
ServerId
at GENERAL SETTINGS
.ServerId = www-data
GENERAL SETTINGS
. Apache compatible log file format.LogFormat = extended
CGIwrapper = /usr/sbin/cgi-wrapper
BINDING SETTINGS
.Binding {
Port = 80
MaxKeepAlive = 30
TimeForRequest = 3,20
}
BANNING SETTINGS
.BanOnGarbage = 300
BanOnMaxPerIP = 60
BanOnMaxReqSize = 300
KickOnBan = yes
RebanDuringBan = yes
BanOnSQLi = 60
BanOnFlooding = 10/1:15
BanlistMask = allow 192.168.0.0/24
Banlistmask
in order to meet your network requirement.php5-cgi
and CGIextension
lines.CGIhandler = /usr/bin/perl:pl
CGIhandler = /usr/bin/php5-cgi:php
#CGIhandler = /usr/bin/python:py
#CGIhandler = /usr/bin/ruby:rb
#CGIhandler = /usr/bin/ssi-cgi:shtml
CGIextension = cgi
FastCGIserver
and rename ConnectTo
to 127.0.0.1:2005
.FastCGIserver {
FastCGIid = PHP5
ConnectTo = 127.0.0.1:2005
Extension = php, php5
SessionTimeout = 30
}
URL TOOLKIT
.UrlToolkit {
ToolkitID = CMS_common
RequestURI isfile Return
RequestURI exists Return
Match ^/(favicon.ico|robots.txt|sitemap.xml)$ Return
Match .*\?(.*) Rewrite /index.php?$1
Match .* Rewrite /index.php
}
UrlToolkit
is similar to Apache's mod_rewrite.VirtualHost
for your site.VirtualHost {
Hostname = samiux.blogspot.com
#Alias = /php_my_admin:/usr/share/phpmyadmin
WebsiteRoot = /var/www/blog
StartFile = index.php
AccessLogfile = /var/log/hiawatha/blog/access.log
ErrorLogfile = /var/log/hiawatha/blog/error.log
TimeForCGI = 5
#UseFastCGI = PHP5
UseToolkit = CMS_common
ExecuteCGI = yes
PreventCMDi = yes
PreventCSRF = yes
PreventSQLi = yes
PreventXSS = yes
DenyBot = Googlebot:/
DenyBot = twiceler:/
DenyBot = MSNBot:/
DenyBot = yahoo:/
DenyBot = BaiDuSpider:/
DenyBot = Ask:/
DenyBot = Yahoo! Slurp:/
DenyBot = Sogou web spider:/
DenyBot = Sogou-Test-Spider:/
DenyBot = Baiduspider+:/
DenyBot = Yandex:/
DenyBot = UniversalFeedParser:/
DenyBot = Mediapartners-Google:/
DenyBot = Sosospider+:/
DenyBot = YoudaoBot:/
DenyBot = ParchBot:/
DenyBot = Curl:/
DenyBot = msnbot:/
DenyBot = NaverBot:/
WrapCGI = jail
}
cgi-wrapper.conf
.sudo nano /etc/hiawatha/cgi-wrapper.conf
CGIhandler = /usr/bin/perl
CGIhandler = /usr/bin/php5-cgi
#CGIhandler = /usr/bin/python
#CGIhandler = /usr/bin/ruby
#CGIhandler = /usr/bin/ssi-cgi
Wrap = jail ; /var/www ; www-data:www-data
PreventCMDi = yes
. DenyBot
entries are optional. If you do not want spiders and bots to crawl your site, you should enable it. Those entries are examples only. UseToolKit
is also optional./var/log/hiawatha/blog
exists (example) and its ownership is www-data
.sudo chown -R www-data:www-data /var/log/hiawatha/blog
sudo /etc/init.d/hiawatha restart
access.log
and error.log
are www-data
. If not, make them as is.sudo chown www-data:www-data /var/log/hiawatha/blog/*
sudo aa-genprof hiawatha
usr.sbin.hiawatha
.sudo nano /etc/apparmor.d/usr.sbin.hiawatha
# Last Modified: Thu Oct 1 10:00:57 2009
#include <tunables/global>
/usr/sbin/hiawatha {
#include <abstractions/base>
capability chown,
capability dac_override,
capability net_bind_service,
capability setgid,
capability setuid,
capability sys_chroot,
network inet tcp,
/bin/dash rix,
/etc/group r,
/etc/hiawatha/** r,
/etc/host.conf r,
/etc/hosts r,
/etc/mailname r,
/etc/nsswitch.conf r,
/etc/passwd r,
/etc/php5/cgi/php.ini r,
/etc/php5/conf.d/ r,
/etc/php5/conf.d/**.ini r,
/etc/phpmyadmin/** r,
/etc/postfix/**.cf r,
/etc/protocols r,
/etc/resolv.conf r,
/etc/services r,
/usr/bin/php5-cgi rix,
/usr/lib{,32,64}/** mr,
/usr/sbin/cgi-wrapper rix,
/usr/sbin/hiawatha mr,
/usr/sbin/postdrop rix,
/usr/sbin/sendmail rix,
/usr/share/dbconfig-common/** r,
/usr/share/file/magic.mime r,
/usr/share/mysql/charsets/Index.xml r,
/usr/share/phpmyadmin/ r,
/usr/share/phpmyadmin/** r,
/usr/share/zoneinfo/ r,
owner /var/lib/** rwk,
/var/lib/hiawatha/* rw,
/var/log/hiawatha/* r,
/var/log/hiawatha/** rw,
/var/run/hiawatha.pid rw,
owner /var/spool/postfix/maildrop/** rw,
/var/spool/postfix/public/pickup w,
/var/www/ r,
/var/www/** rw,
}
sudo aa-enforce hiawatha
sudo apparmor_parser -r < /etc/apparmor.d/usr.sbin.hiawatha
sudo ln -s /etc/apparmor.d/usr.sbin.hiawatha /etc/apparmor.d/disable/
sudo apparmor_parser -R < /etc/apparmor.d/usr.sbin.hiawatha
sudo rm /etc/apparmor.d/disable/usr.sbin.hiawatha
sudo apparmor_parser -r < /etc/apparmor.d/usr.sbin.hiawatha
sudo apt-get install libcap2-bin
cgi-wrapper
.sudo chmod u-s /usr/sbin/cgi-wrapper
sudo setcap cap_setgid,cap_setuid+ep /usr/sbin/cgi-wrapper
getcap
:sudo getcap /usr/sbin/cgi-wrapper
/usr/sbin/cgi-wrapper = cap_setgid,cap_setuid+ep
Alias
cannot be functioned with this configuration so far.logwatch
.sudo apt-get update
sudo apt-get upgrade
sudo apt-get install logwatch
logwatch
configure file in order to tell her to send you a email report.sudo nano /usr/share/logwatch/default.conf/logwatch.conf
Output = mail
Format = html
MailTo = samiux@gmail.com
sudo nano /etc/cron.daily/00logwatch
/usr/sbin/logwatch --mailto samiux@gmail.com
logwatch
to read Hiawatha
log files.sudo nano /usr/share/logwatch/default.conf/logfiles/http.conf
LogFile = hiawatha/*access.log
LogFile = hiawatha/*access.log.1
LogFile = hiawatha/*error.log
LogFile = hiawatha/*error.log.1
LogFile = hiawatha/*system.log
LogFile = hiawatha/*system.log.1
LogFile = hiawatha/*garbage.log
LogFile = hiawatha/*garbage.log.1
LogFile = hiawatha/*php-fcgi.log
LogFile = hiawatha/*php-fcgi.log.1
Archive = hiawatha/*access.log.*.gz
Archive = hiawatha/*error.log.*.gz
Archive = hiawatha/*system.log.*.gz
Archive = hiawatha/*garbage.log.*.gz
Archive = hiawatha/*php-fcgi.log.*.gz
Tor
repositories.sudo nano /etc/apt/sources.list.d/tor.list
deb http://mirror.noreply.org/pub/tor jaunty main
deb-src http://mirror.noreply.org/pub/tor jaunty main
Tor
GPG key.gpg --keyserver subkeys.pgp.net --recv 94C09C7F
gpg --fingerprint 94C09C7F
gpg --export 94C09C7F | sudo apt-key add -
sudo apt-get update
sudo apt-get upgrade
tor
.sudo apt-get install tor
Privoxy
.sudo apt-get install privoxy
privoxy
.sudo nano /etc/privoxy/config
forward-socks4a / localhost:9050 .
forward 192.168.*.*/ .
Tor
is working.sudo /etc/init.d/privoxy start
sudo /etc/init.d/tor start
netstat -a | grep 9050
Tor
is working.tcp 0 0 localhost:9050 *:* LISTEN
Tor
is working on the remote side by visiting the following site.Vidalia
which is a Graphical User Interface for Tor.sudo apt-get install vidalia
TorButton
for Firefox.SQL Injection Me
and XSS Me
as well as Access Me
.Ubuntu 9.04 Server
and OpenSSH
. If your web application requires email function, you should also install Mail Server
also.sudo apt-get update
sudo apt-get upgrade
sudo apt-get dist-upgrade
sudo apt-get install mysql-server mysql-client php5-cgi php5 php5-cli php5-mysql php5-curl php5-gd php5-idn php-pear php5-imagick php5-imap php5-mcrypt php5-memcache php5-mhash php5-ming php5-ps php5-pspell php5-recode php5-snmp php5-sqlite php5-tidy php5-xmlrpc php5-xsl
sudo wget http://www.hiawatha-webserver.org/files/hiawatha-6.17.1.tar.gz
tar -xzvf hiawatha-6.17.1.tar.gz
cd hiawatha-6.17.1
sudo apt-get install libc6-dev libssl-dev dpkg-dev debhelper fakeroot libxml2-dev libxslt1-dev
hiawatha-6.17.1
directory, build the Hiawatha deb package../configure
make deb
/home/samiux
. You can install it now.cd ..
sudo dpkg -i hiawatha_6.17.1_amd64.deb
sudo dpkg -i hiawatha_6.17.1_i386.deb
php.ini
.sudo nano /etc/php5/cgi/php.ini
display_errors = Off
log_errors = On
allow_url_fopen = Off
safe_mode = On
expose_php = Off
enable_dl = Off
disable_functions = system, show_source, symlink, exec, dl, shell_exec, passthru, phpinfo, escapeshellarg, escapeshellcmd
safe_mode = Off
.php-fcgi.conf
.sudo nano /etc/hiawatha/php-fcgi.conf
Server = /usr/bin/php5-cgi ; 127.0.0.1:2005 ; www-data
php-fcgi
.sudo php-fcgi -c /etc/hiawatha/php-fcgi.conf
php-fcgi.conf
, make sure to restart it by following commands.sudo php-fcgi -k -c /etc/hiawatha/php-fcgi.conf
sudo php-fcgi -c /etc/hiawatha/php-fcgi.conf
hiawatha.conf
.sudo nano /etc/hiawatha/hiawatha.conf
ServerId
at GENERAL SETTINGS
.ServerId = www-data
GENERAL SETTINGS
. Apache compatible log file format.LogFormat = extended
BINDING SETTINGS
.Binding {
Port = 80
MaxKeepAlive = 30
TimeForRequest = 3,20
}
BANNING SETTINGS
.BanOnGarbage = 300
BanOnMaxPerIP = 60
BanOnMaxReqSize = 300
KickOnBan = yes
RebanDuringBan = yes
BanOnSQLi = 0
BanOnFlooding = 10/1:15
BanlistMask = allow 192.168.0.0/24
Banlistmask
in order to meet your network requirement.php5-cgi
and CGIextension
lines.#CGIhandler = /usr/bin/perl:pl
CGIhandler = /usr/bin/php5-cgi:php
#CGIhandler = /usr/bin/python:py
#CGIhandler = /usr/bin/ruby:rb
#CGIhandler = /usr/bin/ssi-cgi:shtml
CGIextension = cgi
FastCGIserver
and rename ConnectTo
to 127.0.0.1:2005
.FastCGIserver {
FastCGIid = PHP5
ConnectTo = 127.0.0.1:2005
Extension = php, php5
SessionTimeout = 30
}
URL TOOLKIT
.UrlToolkit {
ToolkitID = CMS_common
RequestURI isfile Return
RequestURI exists Return
Match ^/(favicon.ico|robots.txt|sitemap.xml)$ Return
Match .*\?(.*) Rewrite /index.php?$1
Match .* Rewrite /index.php
}
UrlToolkit
is similar to Apache's mod_rewrite.VirtualHost
for your site.VirtualHost {
Hostname = samiux.blogspot.com
Alias = /php_my_admin:/usr/share/phpmyadmin
WebsiteRoot = /var/www/blog
StartFile = index.php
AccessLogfile = /var/log/hiawatha/blog/access.log
ErrorLogfile = /var/log/hiawatha/blog/error.log
TimeForCGI = 5
UseFastCGI = PHP5
UseToolkit = CMS_common
ExecuteCGI = yes
PreventCMDi = yes
PreventCSRF = yes
PreventSQLi = yes
PreventXSS = yes
DenyBot = Googlebot:/
DenyBot = twiceler:/
DenyBot = MSNBot:/
DenyBot = yahoo:/
DenyBot = BaiDuSpider:/
DenyBot = Ask:/
DenyBot = Yahoo! Slurp:/
DenyBot = Sogou web spider:/
DenyBot = Sogou-Test-Spider:/
DenyBot = Baiduspider+:/
DenyBot = Yandex:/
DenyBot = UniversalFeedParser:/
DenyBot = Mediapartners-Google:/
DenyBot = Sosospider+:/
}
PreventCMDi = yes
. DenyBot
entries are optional. If you do not want spiders and bots to crawl your site, you should enable it. Those entries are examples only. UseToolKit
is also optional./var/log/hiawatha/blog
exists (example) and its ownership is www-data
.sudo chown -R www-data:www-data /var/log/hiawatha/blog
sudo /etc/init.d/hiawatha restart
access.log
and error.log
are www-data
. If not, make them as is.sudo chown www-data:www-data /var/log/hiawatha/blog/*
sudo aa-genprof hiawatha
usr.sbin.hiawatha
.sudo nano /etc/apparmor.d/usr.sbin.hiawatha
# Last Modified: Tue Sep 1 10:28:15 2009
#include <tunables/global>
/usr/sbin/hiawatha {
#include <abstractions/base>
capability chown,
capability dac_override,
capability net_bind_service,
capability setgid,
capability setuid,
capability sys_chroot,
network inet tcp,
/etc/group r,
/etc/hiawatha/** r,
/etc/nsswitch.conf r,
/etc/passwd r,
/usr/bin/php5-cgi rix,
/usr/sbin/cgi-wrapper mr,
/usr/sbin/hiawatha mr,
/usr/share/dbconfig-common/** r,
/usr/share/phpmyadmin/ r,
/usr/share/phpmyadmin/** r,
/var/lib/** r,
/var/lib/hiawatha/* rw,
/var/log/hiawatha/* r,
/var/log/hiawatha/** rw,
/var/log/hiawatha/blog/* r,
/var/log/hiawatha/blog/** a,
/var/run/hiawatha.pid w,
/var/www/ r,
/var/www/** rw,
}
sudo aa-enforce hiawatha
sudo apparmor_parser -r < /etc/apparmor.d/usr.sbin.hiawatha
sudo ln -s /etc/apparmor.d/usr.sbin.hiawatha /etc/apparmor.d/disable/
sudo apparmor_parser -R < /etc/apparmor.d/usr.sbin.hiawatha
sudo rm /etc/apparmor.d/disable/usr.sbin.hiawatha
sudo apparmor_parser -r < /etc/apparmor.d/usr.sbin.hiawatha