update blog
[blog.git] / posts / linux-note.org
index 3f9ef8f..f50aee3 100644 (file)
@@ -1,7 +1,7 @@
 #+TITLE: Note of Linux (Debian)
 #+AUTHOR: Peng Li
 #+EMAIL: seudut@gmail.com
-#+DATE: 2016-12-23
+#+DATE: <2016-12-23>
 
 * Install and Environment
 ** Install ios in virtual box
 
 *** Build Emacs from source
 1. gnutls error, to fix, install =gnutls-dev= and =pkg-config=
+
+configure emacs =-without-x=
+
+#+BEGIN_EXAMPLE
+
+Does Emacs use -lgnutls?                                no
+#+END_EXAMPLE
+
 ** others package
 htop, lftp, apache2, vsftpd, silversearcher-ag,
 * Issue
@@ -39,12 +47,80 @@ wget --no-check-certificate https://cyberciti.biz/foo/bar.tar.gz
 
 3. =ls= in =zsh= has no color
 
+4.  issue 
+-bash: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8)
+
+#+BEGIN_SRC sh
+  dpkg-reconfigure locales
+#+END_SRC
+
 * VirtualBox
 Install virtualbox guest addition
 https://blog.paranoidpenguin.net/2016/12/installing-the-virtualbox-guest-additions-on-debian-8-jessie/
 ** HostOnly and NAT
+- Need install extensions, add a hostonly network, address start as 192.168.56.1, then You host (mac) will be added one more interface, named
+  vboxnet0, 192.168.56.1
+- ADd both hostonly and nat interface in the network setting
+- start linux, and modify =/etc/network/interfaces/=
+   add configure for eth1 (hostonly ) interface, such as 
+#+BEGIN_SRC sh :results output replace
+  allow-hotplug eth1
+  iface eth1 inet static
+  address 192.168.56.2
+  netmask 255.255.255.0
+#+END_SRC
 ** Port forward, web server
 
+
+** Shared folder
+- Install Guest Addition,
+https://forums.virtualbox.org/viewtopic.php?t=15679
+
+Insert  GuestAddition.ios, 
+#+BEGIN_SRC sh
+  mount /dev/sr0 /media/cdrom
+#+END_SRC
+
+- install build-essentials, linux-headers-amd64
+
+
+- Create folder to share in host machine
+- add user to virtualbox group
+#+BEGIN_SRC sh :results output replace
+  adduser debian vboxsf
+#+END_SRC
+
+
+
+
+* Apache config
+** Enabled Cgi mode
+To enable cgi mdoule, create symbolic link to mods-available/cgid.conf /etc/apache2/mods-enabled/
+https://perlmaven.com/perl-cgi-script-with-apache2
+
+Add sample perl script to test, put under =/usr/lib/cgi-bin/= and chmod a+x, troubleshooting see the log =/var/log/apache2/error.log=
+#+BEGIN_SRC perl 
+  #!/usr/bin/perl -w
+
+  use strict;
+
+  use CGI qw/:standard/;
+
+  print header,
+      start_html ("hello world"),
+      h1 ("hello"),
+      end_html;
+
+#+END_SRC
+** cgi directory config
+#+BEGIN_SRC sh
+           ScriptAlias /cgi-bin/ /var/cgi-bin/
+           <Directory "/var/cgi-bin">
+                   AllowOverride None
+                   Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
+                   Require all granted
+           </Directory>
+#+END_SRC
 * Raspberry raspbian
 ** start sshd on boot and vnc server
 http://www.raspberrypi-spy.co.uk/2012/05/enable-secure-shell-ssh-on-your-raspberry-pi/