panelarrow

For Myself.

2015年10月25日 星期日

Debian 架設 VPN Server (VirtualBox)

0.平台
 - VirtualBox 5.0
 - Debian 8.2 Jessie

1.VirtualBox 要開 Bridge
  -> 設定值
  -> 網路
  -> 選擇"橋接介面卡"
  -> 選擇"實體網卡"


2. 啟動系統


3.更新 update/ upgrade
#apt-get update
#apt-get -y upgrade

4.安裝 pptpd
安裝套件:
#apt-get install -y pptpd
#update-rc.d pptpd defaults
編輯 /etc/pptpd.conf
這裡是設定連到VPN Server所派發的IP
#vim /etc/pptpd.conf

更改下列部分:
localip 10.10.0.1     
remoteip 10.10.0.2-20 # 可登入的範圍
編輯 /etc/ppp/pptpd-options
這裡是設定VPN Server的DNS
#vim /etc/ppp/pptpd-options

更改下列部分:
ms-dns 8.8.8.8  # ms-dns 可以自己設定所需的 DNS Server
ms-dns 8.8.4.4
編輯 /etc/ppp/chap-secrets
這裡是設定VPN Server登入的帳號密碼
vim /etc/ppp/chap-secrets

範例:
登入帳號  server 登入密碼  登入派發的IP 
Username   *    Password      *          # * 為全部

EX:
abc123  pptpd  abc123  10.10.0.2
abc456    *    abc123      *
pptpd 服務啟動
/etc/init.d/pptpd stop
/etc/init.d/pptpd start
編輯 /etc/sysctl.conf
#vim /etc/sysctl.conf

更改下列部分:
net.ipv4.ip_forward=1

檢查:
#sysctl -p
設定 iptables:
iptables -I INPUT -p tcp --dport 1723 -m state --state NEW -j ACCEPT
iptables -I INPUT -p gre -j ACCEPT
iptables -t nat -I POSTROUTING -o eth0 -j MASQUERADE

注意前面所設定VPN Server派發的IP網段
iptables -I FORWARD -p tcp --tcp-flags SYN,RST SYN -s 10.10.0.0/24 -j TCPMSS  --clamp-mss-to-pmtu
5.VPN 連線:
Windwos 7 or Laster:
  -> 到網路公用中心
  -> 設定新的連線或網路

 -> 連線到工作地點

  -> 使用我的網際網路連線(VPN)

   -> 網際網路位址(外部實體IP,Server端,查詢: http://www.rus.net.tw/myip.php)
   -> V 不要立即

   -> 填入所設定的"使用者名稱/密碼"
   -> V 記住這個密碼
   -> 建立

   -> 網路和共用中心
   -> 變更介面卡設定

   -> VPN連線(右鍵,內容)


   -> 安全性
   -> 選擇"PPTP"
   -> 確定

   -> 連線
6.參考網址:
http://websistent.com/setup-pptp-vpn-server-debian-ubuntu/

查詢外部實體IP:
http://www.rus.net.tw/myip.php

2015年9月13日 星期日

2015年8月21日 星期五

Raspberry Pi 安裝

學習樹莓派--Raspberry Pi

https://sites.google.com/site/raspberypishare0918/home/di-yi-ci-qi-dong/noobs-an-zhuang

安裝Linux系統

https://sites.google.com/site/raspberrypidiy/raspberry-pi/os/cht

Raspberry Pi2 與 Raspbian
http://yehnan.blogspot.tw/2015/02/raspberry-pi-2raspbian.html


2015年8月13日 星期四

2015年8月12日 星期三

20150811_Linux_RedHat_L5

磁碟分割












將USB掛進來虛擬機,使用 Terminal 進行分割動作

#fdisk -l (檢視系統所掛載的磁區)

將USB分割磁區
#fdisk /dev/sdb (USB掛載的地方)

fdisk 分割相關指令如下:
m: 顯示說明
p: 顯示分割區狀態
a: 指定啟動分割區
n: 建立分割區
-> P : Primary 主要分割區
-> E : Extended 延伸分割區

d: 刪除分割區
w: 儲存並寫入分割區配置 (在未執行此指令前,所有修改的分割區配置都還不會生效)



2015年8月11日 星期二

2015年8月6日 星期四

20150806_Linux_RedHat_L4

安裝資料庫 MariaDB
圖形化:軟體
搜尋 "MariaDB"並安裝下列軟體:
-> The MariaDB server and related files
-> The test suite distrbuted with MariaD
-> A commity developed branch of MySQL
-> MariaDB benchmark scripts and data
-> Files for development of MariaDB/MySQL applications

-----------------------------
開啟 Terminal
# systemctl enable mariadb.service
# systemctl start maiadb.service
# mysql -u root -p
-> 沒有密碼直接按Enter
-----------------------------
到網路上下載 "phpMyAdmin",下載 tar.gz 檔
-----------------------------
php
可參考這個網址:
http://www.phpini.com/linux/redhat-centos-7-setup-apache-mariadb-php
圖形化:軟體
搜尋 "php"
-> php scripting
-> command-line
-> A module for PHP
->  Standard PHP module
-> A module for PHP
-> A database ...

-----------------------------
httpd
# systemctl restart httpd.service
# cd /var/www/html
-> 把 phpAdmin.....tar.gz 放到 /var/www/html
     資料夾名稱改為 phpAdmin
-> 開啟瀏覽器搜尋“localhost/phpAdmin”
-----------------------------
php-mbstring
瀏覽器搜尋
php mbstring centos 7 rpm
網址:
http://rpm.pbone.net/index.php3/stat/4/idpl/26646085/dir/centos_7/com/php-mbstring-5.4.16-21.el7.x86_64.rpm.html
軟體下載網址:
ftp://bo.mirror.garr.it/pub/1/slc/centos/7.0.1406/os/x86_64/Packages/php-mbstring-5.4.16-21.el7.x86_64.rpm
安裝完畢重啟服務
# systemctl restart httpd.service
-----------------------------
接下來
# cd /var/www/html/phpAdmin
-> # mv config.sample.inc.php config.inc.php
-> # vim config.inc.php
    ->搜尋“blowfish-secret" -> 'blowfish-secret' = 'abcde'
    ->搜尋“AllowNoPassword" -> 'AllowPassword' = 'true'
-----------------------------
改完後到 phpAdmin網頁,並登入
ID :  root
PW:空白

登入後

修改密碼 -> 改自己的密碼 -> 執行
使用者 -> 打勾“任意”X3 -> 刪除 -> 執行
密碼為"否" -> 編輯 -> 修改密碼 (會有三個)

-----------------------------
瀏覽器搜尋"drupal"
下載 "Drupal 7.3.6" & "中文化 7.3.6" (兩個版本要一樣,皆下載7.3.6)
網址:
Drupal 7.3.6 :
  http://ftp.drupal.org/files/projects/drupal-7.38.tar.gz

中文化 7.3.6 :
  http://ftp.drupal.org/files/translations/7.x/drupal/drupal-7.38.zh-hant.po
下載完後
# cp drupal-7.38.tar.gz drupal-7.38.zh-hant.po /var/www/html
# tar avxf drupal-7.38.tar.gz
# cd drupal-7.38
# cp -r * ../
# cp ../drupal-7.38.zh-hant.po ../profiles/standard/translations/

# restorecon -R /var/www/html
-----------------------------
瀏覽器搜尋"localhost"
-> 重新整理
-> Save and Continue
-> 選擇“中文”-> Save and Continue

安裝缺乏的檔案
# yum search dom
# yum install php-theseer-fDOMDocument.noarch -y
# mkdir /var/www/html/sites/default/files
# chown apache.apache /var/www/html/sites/default/files
# cd /var/www/html/sites/default/
# cp default.settings.php settings.php
# chown apache.apache settings.php

# restorecon -R /var/www/html
# systemctl restart httpd
瀏覽器重新整理,到 phpAdmin 網頁
-> 資料庫 -> 新增 -> drupal, utf-8 -> 建立
-> 使用者 -> 新增使用者 -> drupal -> 本機, localhost -> passwd -> 執行 -> 使用者 -> drupal 編輯權限 -> 全選 -> 執行

回到 drupal 網頁
-> 名稱:drupla -> 資料庫:drupal -> passwd -> 網站名稱(自行)-> e-mail(亂取: test@gmail.com)-> 使用者:admin -> 國家:Taiwan -> Save and Continue







2015年8月5日 星期三

DB

Oracle資料庫
https://zh.wikipedia.org/wiki/Oracle%E6%95%B0%E6%8D%AE%E5%BA%93

Oracle Database 12c 特色
http://www.codedata.com.tw/database/oracle-database-12c-new-features-1/

CentOS and RHEL7 : install Linux, Apache, MariaDB, PHP(LAMP) Stack
http://www.cyberciti.biz/faq/howto-install-linux-apache-mariadb-php-lamp-stack-on-centos7-rhel7/

資料庫管理
https://zh.wikipedia.org/zh-tw/%E6%95%B0%E6%8D%AE%E5%BA%93%E7%AE%A1%E7%90%86%E7%B3%BB%E7%BB%9F

轉貼:為什麼好的Oracle DBA 那麼難找?
https://seanhhlee.wordpress.com/2008/11/12/%E8%BD%89%E8%B2%BC%EF%BC%9A%E7%82%BA%E4%BB%80%E9%BA%BC%E5%A5%BD%E7%9A%84oracle-dba%E9%82%A3%E9%BA%BC%E9%9B%A3%E6%89%BE%EF%BC%9F/

[研究] 甲骨文 Oracle Database 11g Release 2 (11.2.0.1.0) for Windows (x64) 與 SQL Developer 安裝研究

http://shaurong.blogspot.tw/2013/11/oracle-database-11gr2-for-windows-x64.html


RedHat Openshift

Openshift 教學
網址: https://sofree.cc/openshift-teach-1/

http://www.minwt.com/free/11085.html

GHOST WITH OPENSHIFT + NODE.JS + SQLITE

網址: http://zengpx.noicehalfsugar.tw/2013/12/26/ghost-with-openshift-node-js-sqlite/

  • 轉貼:SQLite使用教學

網址:http://gisanfu.pixnet.net/blog/post/7941810-%E8%BD%89%E8%B2%BC%EF%BC%9Asqlite%E4%BD%BF%E7%94%A8%E6%95%99%E5%AD%B8

2015年8月4日 星期二

20150804_Linux_RedHat_L3

1.架設ftp server
# cd /etc/yum.repos.d/
#vi RHEL7.repo
  [RHEL70]
  name=RHEL7
  baseurl=ftp://localhost/pub
  enable=1
  gpgcheck=0

#systemctl enable vsftpd.service
#restorecon -R /var/ftp/pub
#firewall -cmd --permanent --add-service=ftp
#systemctl restart vsftpd.service <- 重新啟動服務
#systemctl status vsftpd.service  <- 檢查服務是否有啟動

另外用圖形化軟體安裝界面安裝下列檔案:
i.  system-config-firewall base components and command line tool
ii. A graphical interface for modifying the system language
iii. A graphical interface for administering users and groups


2.安裝EPEL(免費套件)
網址: https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
下載完並安裝
#yum install -y epel-release-latest-7.noarch.rpm
安裝完可到下列資料夾檢查
#cd /etc/yum.repos.d/

會多出此檔案
epel.repo

檢查
#yum search xfreerdp -> 搜尋有沒有 xfreerdp (遠端登入)
#yum install xfreerdp -y

執行遠端登入:
xfreerdp -g 800X600 IP位址 <- for linux
xfreerdp -g 800X600 -u 帳號 IP位址 <- for windows


3.手動設定網路(半圖形介面)
#nmtui-edit

4.設定 rdp server
網址:http://www.itzgeek.com/how-tos/linux/centos-how-tos/install-xrdp-on-centos-7-rhel-7.html#axzz3hqxIgxc3

# rpm -Uvh http://li.nux.ro/download/nux/dextop/el7/x86_64/nux-dextop-release-0-1.el7.nux.noarch.rpm
(以下未完成)
# yum -y install xrdp tigervnc-server
# systemctl enable xrdp.service
# systemctl start xrdp.service

圖形化設定防火牆
防火牆 -> 永久 -> Public -> 連接土阜 -> 加入 3389 tcp

5. 格式化格式
Windows
FAT -> 2G
FAT32 -> 4g
NTFS -> 16T
Linux
ext4 -> 16T
xfs

2015年7月30日 星期四

20150730_Linux_RedHat_L2

零、上課部落格
http://linux.onlinedoc.tw

一、更改密碼
當登入的密碼忘記時,可以有下列方法可以更改:
1. BIOS密碼 -> 拔掉電池,還原設定
2. 開機選單鎖住時 -> 可用 DVD/USB 開機,將 grub.conf 修改
3. 改 root 密碼(開機選單解)
   |
   |-> 按 "e"
   |-> 找到 "linux16" 關鍵字 (原本 kernel)
   |   在最後增加下列其一指令皆可
   |   1. rd.break
   |   2. init=/bin/bash
   |-> mount -o remount,rw /sysroot (開機根目錄改到 sysroot)
   |-> chroot /sysroot
   |-> passwd root
   |-> touch /.autorelabel <- 讓 .autorelabel 的時間改變(會牽扯到selinux)
   |-> exit
   |-> exit (reboot)
   |-> 用 root 登入系統

參考網站: http://technote.aven-network.com/854/rhel7-centos7-reset-root-password
 
二、增加擴充功能
1. 關機
2. 下載 VirtualBox 功能 Extension Pack (網址:)
3. 載入 Extension Pack
   檔案 -> 喜好設定 -> 擴充功能 -> 加入 Extension Pack
4. 設定網路及USB
   |
   |-> 設定值
   |-> 網路
   |---> 介面卡1 改成 "橋接"
   |---> 選擇實體網路卡(依自己的電腦配置為主)
   |
   |-> USB
   |---> 啟用打勾
   |---> USB 3.0
   |---> 增加要掛載的隨身碟/隨身硬碟
 
三、
1. 開機
2. 加入光碟機,並掛載 iso檔
   裝置 -> 光碟機 -> 選擇"rhel-server-7.0-x86_64-dvd.iso"
3. 用檔案管理員開啟 iso檔,並安裝vsftp
   # cd /run/media/root/RHEL-7.0\ Server.x86_64/
   # cd Packages
   # yum install vsftpd-3.0.2-9.el7.x86_64.rpm -y
4. # cp * /var/ftp/pub
5. # createrepo -g /var/ftp/pub/repodate/76*-comps-Server.x86_64.xml /var/ftp/pub/ <-建立軟體倉儲
6. 將網路開啟 -> 手動設定 IP

2015年7月28日 星期二

20150728_Linux_RedHat_L1

零、事前預備
1.建立Google Blogger
2.將筆記寫在 Blogger上

 一、使用軟體
1. VirtualBox
2. Putty
3.NotPad++
4.rhel-server-7.0-x86_64-dvd.iso

二、操作過程
1.安裝VirtualBox

2.建立一個虛擬Linux系統

2.1 建立一個虛擬系統
|
|-> 2.1.1建立
|-> 2.1.2 RHEL 7
|-> 2.1.3 RAM:1500MB(依自己的電腦配置為主)
|-> 2.1.4 建立一個新磁區
|->  2.1.5 選擇VDI
|-> 2.1.6 選擇"動態配置"(此為會慢慢增加磁區);另外還有"固定大小"
|-> 2.1.7 建立30G,主要是要把RedHat光碟放進去(依自己的電腦配置為主),並記得要選擇存放的位置

2.2設定值
|
|-> 2.2.1系統
|-->  2.2.1.1主機板
|      將磁碟機取消,把光碟機和硬碟往上移
|--> 2.2.1.2處理器
|     設定為2顆(依自己的電腦配置為主)
|--> 2.2.1.3加速
|     硬體虛擬化全開
|     啟用VT-x/AMD-V
| 啟用Nested Paging
|-> 2.2.2顯示
|--> 2.2.2.1 Screen
|     可以的話將視訊記憶體設定為32MB
|--> 2.2.2.2遠端顯示
|      None
|--> 2.2.2.3視訊擷取
|      None
|-> 2.2.3存放裝置
|     控制器IDE -> 選擇"空" -> 點選右側光碟圖樣 -> Choose Virtual Optical Disk File ->  選擇"rhel-server-7.0-x86_64-dvd.iso"
|-> 2.2.4網路
|--> 2.2.4.1介面卡1
|  預設NAT

3.啟動
|-> 3.1 選擇"Install...."
|-> 3.2 選擇"含有GUI的伺服器"
|          ->虛擬化客戶端
|         -> 虛擬化Hypervisor
|         -> 虛擬化工具
|-> 3.3 安裝
|--> 3.3.1 安裝目的
|        -> 選擇將配置分頁(分割區);完成
|        -> 預設"LVM" 改為 "標準分割"
| -> 案左下角"+" 設定分割區 (依自己的電腦配置為主)
|           ---> "/boot",1024MB
|           ---> 標籤 boot
|           ---> 更新設定
|
| ---> "swap",4096MB
| --->標籤 swap
| --->更新設定
|
| ---> "/",全部容量
| --->標籤 root
| --->更新設定
|--> 3.3.2 安裝系統ing
|         ->設定
|         -> Root Password
|          -> 新增帳戶(先不用)
|--> 3.3.3 安裝結束後重新開機

Pages

技術提供:Blogger.

Copyright © Joshua's Linux | Powered by Blogger
Design by AnarielDesign | Blogger Theme by NewBloggerThemes.com