2014/12/21

07.Install ssl over apache2 in Kali Linux

1.Produce the key
openssl req -new -x509 -days 365 -nodes -out /etc/apache2/ssl/apache.pem -keyout /etc/apache2/ssl/apache.key

2.Replace the setting in /etc/apache2/sites-available/default-ssl
SSLCertificateFile /etc/apache2/ssl/apache.pem
SSLCertificateKeyFile /etc/apache2/ssl/apache.key

3.Enable ssl module
a2enmod ssl

4.Enable the site
a2ensite default-ssl

5.Restart apache2
service apache2 restart

6.Virtual Host over ssl, edit /etc/apache2/ports.conf
NameVirtualHost *:80
Listen 80
<IfModule mod_ssl.c>
# If you add NameVirtualHost *:443 here, you will also have to change
# the VirtualHost statement in /etc/apache2/sites-available/default-ssl
# to <VirtualHost *:443>
# Server Name Indication for SSL named virtual hosts is currently not
# supported by MSIE on Windows XP.
NameVirtualHost *:443
Listen 443
</IfModule>
<IfModule mod_gnutls.c>
NameVirtualHost *:443
Listen 443
</IfModule>




7.Create your ror-ssl-site in /etc/apache2/sites-available/yourdomain.com
<IfModule mod_ssl.c>
<VirtualHost _default_:443>
ServerName yourdomain.com
# !!! Be sure to point DocumentRoot to 'public'!
DocumentRoot /home/yourname/my_project/public
RailsEnv development
<Directory /home/yourname/my_project/public >
# This relaxes Apache security settings.
AllowOverride all
# MultiViews must be turned off.
Options -MultiViews
# Uncomment this if you're on Apache >= 2.4:
# Require all granted
</Directory>
SSLEngine on
SSLCertificateFile /etc/apache2/ssl/apache.pem
SSLCertificateKeyFile /etc/apache2/ssl/apache.key
</VirtualHost>
</IfModule>


8.Enable the site
a2ensite yourdomain.com

2014/12/19

06.Install Virtual Box in Kali Linux


1.Add this line to /etc/apt/sources.list
echo "deb http://download.virtualbox.org/virtualbox/debian wheezy contrib" >> /etc/apt/sources.list

2.Install the Virtual Box
sudo apt-get update sudo apt-get install virtualbox-4.3

05.Build Ruby on Rails Development Environment with Apache2 module passenger

1.Install ruby, rubygems, basic build-essential

sudo apt-get install ruby-full rubygems build-essential


2.Install apache2
sudo apt-get install apache2 apache2-mpm-prefork apache2-prefork-dev libcurl4-openssl-dev

3.Install mysql
sudo apt-get install mysql-server mysql-client 
sudo apt-get install libmysql-ruby libmysqlclient15-dev 
sudo gem install mysql
sudo apt-get install rubygems

4.Install rails use gem
sudo gem install rails

5.Install passenger use gem
sudo gem install passenger

6.build passenger module with apache2
sudo passenger-install-apache2-module
7.add following lines into /etc/apache2/apache2.conf file
LoadModule passenger_module /var/lib/gems/1.9.1/gems/passenger-4.0.56/buildout/apache2/mod_passenger.so
   <IfModule mod_passenger.c>
     PassengerRoot /var/lib/gems/1.9.1/gems/passenger-4.0.56
     PassengerRuby /usr/bin/ruby1.9.1
   </IfModule>




8.Enable the mod_rewrite
sudo a2enmod rewrite

9.start new rails project called my_project in /var/www/my_project
cd /home/your-username/
rails new my_project -d mysql


10.Create the file in /etc/apache2/sites-available/your.domain.name.com
<VirtualHost *:80>
      ServerName your.domain.name.com
      # !!! Be sure to point DocumentRoot to 'public'!
      DocumentRoot /home/your-username/my_project/public
      RailsEnv development
      <Directory /home/your-username/my_project/public >
         Allow from all
         Satisfy Any
         # This relaxes Apache security settings.
         AllowOverride all
         # MultiViews must be turned off.
         Options -MultiViews
         # Uncomment this if you're on Apache >= 2.4:
         # Require all granted
      </Directory>
</VirtualHost>

11.Enable your site, and disable the default website
sudo a2ensite your.domain.name.com
sudo service apache2 restart


12.Edit /etc/hosts
127.0.0.1 your.domain.name.com


13.Set default mysql password
service mysql stop 
mysqld_safe --skip-grant-tables 
mysql -u root 
use mysql 
update user set password=PASSWORD("NEW_ROOT_PASSWORD") where User='root';
flush privileges;
quit
service mysql restart      
14.Edit database config file in /var/www/my_project

cd /var/www/my_project/config/
vim database.yml
edit the default empty password to your new password
15.Install gemfile and database

cd /var/www/my_project/

bundle install

rake db:create db:migrate


16.Start apache2 and mysql at boot time
update-rc.d apache2 enable
update-rc.d mysql enable 

04.Install chinese typing

1.Install ibus
sudo apt-get install ibus
2.Install chinese typing
sudo apt-get install ibus-chewing
3.Install pinyin and chinese font
sudo apt-get install ibus-pinyin
sudo apt-get install fcitx-table-wbpy ttf-wqy-microhei ttf-wqy-zenhei

4.Start ibus daemon
sudo ibus-daemon -d

5.Configure the ibus
sudo ibus-setup

03.How to install browsers in Kali

1.Remove current IceWeasel Browser
apt-get remove iceweasel
 
2.Search for the browser you want
Search for package_name of browser
apt-cache search [browser_name]
And then
apt-get install [packege_name] 

3.Install Firefox
echo -e "\ndeb http://downloads.sourceforge.net/project/ubuntuzilla/mozilla/apt all main" | tee -a /etc/apt/sources.list > /dev/null
apt-key adv --recv-keys --keyserver keyserver.ubuntu.com C1289A29
apt-get update
apt-get install firefox-mozilla-build

Install flashplayer
apt-get install flashplugin-nonfree 

4.Install Google Chromium
apt-get install chromium
 
5.Trouble Shooting with Google Chromium encode error
To slove the encoding error, you have to install fonts 
apt-get install fcitx-table-wbpy ttf-wqy-microhei ttf-wqy-zenhei

6.Install Chromium flash-player
Add following two lines into /etc/apt/sources.list

deb http://http.debian.net/debian wheezy-backports main contrib non-free

Update
sudo apt-get update

Install pepperflashplugin
aptitude -t wheezy-backports install pepperflashplugin-nonfree

Update pepperflashplayer
update-pepperflashplugin-nonfree --install

Restart your chromium browser, and you could use flash now!!


2014/12/18

02.Install Openssh-Server and Configure the sudoers on Kali Linux

1.Following the guide from the website
http://www.blackmoreops.com/2014/06/19/kali-linux-remote-ssh/

2.Install the openssh-server on Kali, and configure it for security concern(change the default ssh-key, login port)


3.Disable root remote login
http://www.tecmint.com/disable-or-enable-ssh-root-login-and-limit-ssh-access-in-linux/

01.Install Kali Linux From USB

1.Following the installing guide from following website
http://docs.kali.org/installation/kali-linux-hard-disk-install

2.You can download iso image from here
http://www.kali.org/downloads/


3.Run Win32 Disk Imager to burn iso file into USB, you can download program from the following link
http://sourceforge.net/projects/win32diskimager/

4.Reboot, and set BIOS setting boot from USB

5.Choose Graphical install, and use the default settings

6.After installation of system, remove your USB, then you can boot into your Kali, enjoy it!!!!

7.20 things to do after installing Kali Linux
http://www.blackmoreops.com/2014/03/03/20-things-installing-kali-linux/

2014/11/30

寫網誌的目的

自從上大學以來,開始探索資工這塊領域
接觸了很多也學了很多
一部分是自己記性不太好記不住這麼多東西
希望能夠開一本網誌來記錄
主要會是一些有關於技術的文章
一方面是希望可以和大家一起交流
也能註記一下自己學過些什麼