Week-3-4-Package-Management-Command-Line

Week 3-4 Package Management & Command line

2015/03/19 LSA 

LAMP 安裝

參考此網址 How to Install LAMP in Ubuntu Server 14.04 LTS

http://ubuntuserverguide.com/2014/06/how-t[o](http://ubuntuserverguide.com/2014/06/how-t-install-lamp-in-ubuntu-server-14-04-lts.html)-install-lamp-in-ubuntu-server-14-04-lts.html

Apache

  • 安裝:sudo apt-get install apache2
  • 修改 port:
    • sudo vi /etc/apache2/ports.conf
    • 將 listen port 端改成 8081
    • sudo vi /etc/apache2/sites-enabled/000-default.conf
  • 重新啟動 apache --> sudo service apache2 restart  or  sudo /etc/init.d/apache2 restart
  • 測試:http://127.0.0.1:8081 

info

web server:Nginx Lighttpd

3G

  • Games
  • Gambling
  • Girls

IPv4 區段

  • IPv4 區段表
  • 廣播封包位置
  • 群播封包位置
  • Private IP 區段

使用者帳號

some files

  • /etc/passwd 以往使用者帳密放置於此
  • /etc/shadow 如今存放密碼的檔案,權限others無法讀取
  • /etc/group 
  • /etc/gshadow
  • /etc/skel

一探究竟

  • 直接顯示 => sudo cat /etc/shadow

  • root : ! :... => 「!」 代表不讓 root 可登入

group

  • 群組名稱:密碼:群組 ID:群組成員
    • 例:root : x : 0 : root

apt

  • /etc/apt
    • sudo apt-get update
    • sudo apt-get install [name]
    • sudo apt search [name]
  • /etc/sources.list
    • 建議修改為 http://ftp.ubuntu-tw.net/mirror/ubuntu/
    • GUI 介面步驟:
      • 系統設定 => 軟體與更新 => 「Ubuntu 軟體」分頁
      • 將「下載自」選擇「其他」
      • 選擇 http://ftp.ubuntu-tw.net/mirror/ubuntu/
      • 點選「選擇伺服器」
      • 取消點選「源碼」
    • 使用 vim 手動修改
      • sudo vim /etc/apt/sources.list
      • :%s/tw.archive.ubuntu.com/ftp.ubuntu-tw.net\/mirror/g
  • /etc/apt/soucres.list.d/

host ssh to VM

  • VirtualBox
    • Network 依舊使用 NAT
    • 進入 Network 設定中的 Port Forwarding
    • 新增規則
      • Name: ssh
      • Protocol: TCP
      • Host Port: 3022
      • Guest Port: 22
    • 重開 VM => sudo shutdown -r now
    • 在 host 使用 ssh -p 3022 [username]@127.0.0.1 連到 VM
    • P.S. 記得 VM 要先裝 ssh
      • 安裝:sudo apt-get install openssh-server
      • 檢查是否執行:ps aux | grep ssh

use software from a PPA

note

drupal