CENTOS 7.X 安裝PPTP VPN

首先安裝yum第三方EPEL套件庫

yum install epel-release -y

更新套件

yum update -y

安裝pptpd

yum install ppp pptpd -y

備份設定檔

cp /etc/pptpd.conf /etc/pptpd.conf.bak

將pptpd連接的網址寫上設定檔(放在最下面即可)

localip 192.168.10.1
remoteip 192.168.10.2-254

備份option設定檔

cp /etc/ppp/options.pptpd /etc/ppp/options.pptpd.bak

搜尋ms-dns,將前面#去掉如下,設定dns

ms-dns 8.8.8.8
ms-dns 8.8.4.4

備份系統設定

cp /etc/sysctl.conf /etc/sysctl.conf.bak

將下面的資料填入該系統設定檔sysctl.conf

3
net.core.wmem_max = 12582912
net.core.rmem_max = 12582912
net.ipv4.tcp_rmem = 10240 87380 12582912
net.ipv4.tcp_wmem = 10240 87380 12582912
net.core.wmem_max = 12582912
net.core.rmem_max = 12582912
net.ipv4.tcp_rmem = 10240 87380 12582912
net.ipv4.tcp_wmem = 10240 87380 12582912
net.core.wmem_max = 12582912
net.core.rmem_max = 12582912
net.ipv4.tcp_rmem = 10240 87380 12582912
net.ipv4.tcp_wmem = 10240 87380 12582912
net.ipv4.ip_forward = 1

設定防火牆

firewall-cmd --permanent --direct --add-rule ipv4 filter INPUT 0 -i eth0 -p tcp --dport 1723 -j ACCEPT
firewall-cmd --permanent --direct --add-rule ipv4 filter INPUT 0 -p gre -j ACCEPT
firewall-cmd --permanent --direct --add-rule ipv4 nat POSTROUTING 0 -s 192.168.10.0/24 -o eth0 -j MASQUERADE
firewall-cmd --permanent --direct --add-rule ipv4 filter FORWARD 0 -i ppp+ -o eth0 -j ACCEPT
firewall-cmd --permanent --direct --add-rule ipv4 filter FORWARD 0 -i eth0 -o ppp+ -j ACCEPT
firewall-cmd --reload

注意,eth0是公網的乙太網路,如果有不一樣需要修改。

設定登入帳號密碼,/etc/ppp/chap-secrets

#帐号    服务器    密码    IP地址
"user1"    pptpd    "123456"  *

注意:帳號密碼必須要加上雙引號。

啟動pptp

systemct restart pptpd

如果有任何問題,要查看日誌則去看/var/log/messages

在Ubuntu 16.04上安裝Postfix+Dovecot+SquirrelMail以及相關設置

Postfix:Postfix是一個免費的開源軟件應用程序,可用作郵件傳輸代理(MTA),用於路由和傳遞電子郵件。提供SMTP服務接收與傳送郵件。

DoveCot: 主要提供POP3與IMAP服務,可提供遠端client連線到郵件伺服器。Dovecot是一個開源MDA(郵件傳遞代理),負責向服務器上的本地收件人郵箱發送電子郵件。Dovecot實現了IMAP(Internet消息訪問協議)和POP3(郵局協議),因此仍然是通過(郵件用戶代理)MUA(如Squirrelmail,Ms Outlook,Thunderbird或Roundcube)訪問電子郵件的不錯選擇。

SquirrelMail:是一套提供網頁電子郵件(WebMail)服務。

1. 安裝網頁伺服器(Apache2 + php + letsEncrypt SSL)

$ sudo apt-get update
$ sudo apt-get install apache2
$ sudo apt-get install php libapache2-mod-php
$ sudo apt-get install software-properties-common python-software-properties
$ sudo add-apt-repository ppa:certbot/certbot
$ sudo apt-get update
$ sudo apt-get install python-certbot-apache
$ sudo certbot --apache -d example.com 

安裝letsencrypt SSL 系統將提示您輸入電子郵件地址以進行緊急SSL續訂和緊急通知。 輸入地址,然後按Enter鍵。
接下來,按A並按Enter鍵以同意條款和條件。
如果您想與Electronic Frontier分享您的電子郵件,請按Y並按Enter鍵,否則按N並按Enter鍵。
在SSL安裝結束時,系統會詢問您是否要重定向流量,只需為沒有重定向選擇1並按Enter鍵

你最後應該得到一個祝賀信息:

IMPORTANT NOTES:
 - Congratulations! Your certificate and chain have been saved at:
   /etc/letsencrypt/live/example.com/fullchain.pem
   Your key file has been saved at:
   /etc/letsencrypt/live/example.com/privkey.pem
   Your cert will expire on 2018-11-04. To obtain a new or tweaked
   version of this certificate in the future, simply run certbot again
   with the "certonly" option. To non-interactively renew *all* of
   your certificates, run "certbot renew"
 - If you like Certbot, please consider supporting our work by:

   Donating to ISRG / Let's Encrypt:   https://letsencrypt.org/donate
   Donating to EFF:                    https://eff.org/donate-le

2. 安裝Postfix

$ sudo apt-get install postfix

執行此安裝指令後,會出現下面畫面,按下TAB到OK,然後按下enter繼續:

下面畫面選擇Internet Site:

下面畫面輸入電子郵件所在的網域:

3. 設定Postfix:

我們將對postfix配置文件進行一些更改。 我們將備份原始文件並創建一個新的配置文件,而不是編輯文件/etc/postfix/main.cf:

$ sudo mv /etc/postfix/main.cf /etc/postfix/main.cf.bk
$ sudo nano /etc/postfix/main.cf

下面是設定的範例:

smtpd_banner = $myhostname ESMTP $mail_name
biff = no

# appending .domain is the MUA's job.
append_dot_mydomain = no
readme_directory = no

#SMTP CONFIGURATION
smtp_use_tls=yes
smtp_tls_security_level = may
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache

# SMTPD CONFIGURATIONS
# SMTPD AUTHENTICATION

smtpd_sasl_auth_enable = yes
smtpd_sasl_type = dovecot
smtpd_sasl_path = private/auth


# SMPTD TLS

smtpd_use_tls=yes
smtpd_tls_security_level = may
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache

smtpd_tls_cert_file=/etc/letsencrypt/live/example.com/fullchain.pem
smtpd_tls_key_file=/etc/letsencrypt/live/example.com/privkey.pem

myhostname = mail.example.com
myorigin = /etc/mailname
mydestination =  localhost.$mydomain, localhost
relayhost = 
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = all
inet_protocols = all
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases

此設定並未採用virtual mailbox,若此伺服器提供多個mail server服務,則需採用virtual mailbox。

4. 安裝與設定Dovebot:

接下來,我們將安裝Dovecot以及IMAP,POP和LTMPD所需的所有軟件包。 後者使用本地郵件傳輸協議(LMTP)將電子郵件傳遞到本地收件箱。

當電子郵件發送到我們的服務器時,Postfix會將其傳遞給Dovecot以進行本地傳遞。 此外,我們的電子郵件客戶端SquirrelMail將通過Dovecot通過IMAP協議從本地存儲中檢索電子郵件。

$ sudo apt-get install dovecot-core dovecot-imapd dovecot-pop3d

啟用 IMAP / POP3 登入
修改 /etc/dovecot/conf.d/10-auth.conf,我們的SSL將採用letsencrypt的SSL證書,他是免費又好用的SSL。

一般使用者的發送 Email 的流程,不是 Webmail 就是用 SMTP。這裡 SMTP 清晰一點是 SMTP Submission,即是 MUA 透過 MSA 委托 MTA 代為傳送郵件 (Relay)。而 SMTP Submission 當然需要有登入設定,不然肯定會成為 Spam Mail 的 Open Relay了。現在的 Postfix 預設設定已經不允許 Open Relay,所以必需先設定登入機制才能外部使用。

Postfix 使用模組化的設計,各部分都是分開的。換句話說您可以使用很多不同的登入插件,SASL (Simple Authentication and Security Layer) 就提供 Postfix 和 登入插件間的溝通。

Postfix 目前支援 Cyrus 和 Dovecot 的 SASL 實作。本部分是為了將 SMTP 的 MSA 登入驗證整合到 Dovecot。
啟用 SMTP Submission Port 587
目前很多 ISP 封鎖了 Port 25 的連線,所以要改用協議中定義的 Port 587 來收件。修改 /etc/postfix/master.cf,把這一行 Uncomment 就好了。

submission inet n       -       -       -       -       smtpd

Dovecot SASL / Postfix 整合
啟用 Dovecot 內建的 SASL,修改 /etc/dovecot/conf.d/10-master.conf
Uncomment “#Postfix smtp-auth” 下面一段,並加入 user 及 group。

service auth {
  # auth_socket_path points to this userdb socket by default. It's typically
  # used by dovecot-lda, doveadm, possibly imap process, etc. Its default
  # permissions make it readable only by root, but you may need to relax these
  # permissions. Users that have access to this socket are able to get a list
  # of all usernames and get results of everyone's userdb lookups.
  unix_listener auth-userdb {
    #mode = 0600
    #user =
    #group =
  }
 
  # Postfix smtp-auth
  unix_listener /var/spool/postfix/private/auth {
    mode = 0666
    user = postfix
    group = postdrop
  }
 
  # Auth process is run as this user.
  #user = $default_internal_user
}

Dovecot 建議只在 SMTP Submission (Port 587) 啟用 SASL 驗證,
原因是當 Dovecot SASL 不可用時,也不至於連收信都失敗。
我們就按指引完成:

修改 /etc/postfix/master.cf,把之前指定在 main.cf 的設定都搬過來,並指定 SASL Socket Path

submission inet n       -       -       -       -       smtpd
 -o smtpd_recipient_restrictions=permit_mynetworks,permit_sasl_authenticated,reject_unauth_destination,reject_authenticated_sender_login_mismatch
 -o smtpd_sasl_local_domain=$myhostname
 -o smtpd_sasl_auth_enable=yes
 -o smtpd_sasl_security_options=noanonymous
 -o smtpd_sasl_type=dovecot
 -o smtpd_sasl_path=private/auth
 -o broken_sasl_auth_clients=yes

這個 master.cf 的格式 非常嚴格:
= 前後都不能有空格
-o 前面必需有空格
每項 Option 的 Value 必不能有空格
不能換行,smtpd_recipient_restrictions 要用逗號隔開
修改完成用 Telnet 測試:

telnet 127.0.0.1 587

如果有出現 220 Response 的話,恭喜中獎了

220 server.tiger-workshop-mail.com ESMTP Postfix

若沒有,則查看/var/log/mail.log,看看問題在哪裡。
若成功了,執行ehlo local就會看到下面的敘述:

telnet localhost 587
Trying ::1...
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
220 mail.dubugroup.com ESMTP Postfix (Ubuntu)
ehlo localhost
250-mail.dubugroup.com
250-PIPELINING
250-SIZE 10240000
250-VRFY
250-ETRN
250-STARTTLS
250-AUTH PLAIN
250-AUTH=PLAIN
250-ENHANCEDSTATUSCODES
250-8BITMIME
250 DSN

若看到下面兩個,代表可以驗證成功了!!

250-AUTH PLAIN
250-AUTH=PLAIN

透過外部 SMTP 發送成功了,Email 當然還帶有前面設定過的 SPF 和 DKIM。

到了這裏,只要設定 Dovecot 的 User,
SMTP、IMAP、POP3 都會使用同一個 Username & Password,
而且收信地址也會跟 Username 一樣,實在太美好了…

Ubuntu 其實有提供一個 Package “dovecot-postfix” 整合套件,直接完成以上的東西。
這跟 Windows 下的 XAMPP 和手動安裝 Apache, MySQL, PHP 然後手動整合一樣,
手動設定會學到比較多原理,Debug 比較容易吧。

最後安裝SquirrelMail網頁郵件:
接下來我們可以配置SquirrelMail客戶端。 該應用程序是通過SMTP和IMAP協議發送和接收電子郵件的理想選擇,可以在任何瀏覽器上運行。

要安裝該軟件,請運行以下命令:

$ sudo apt-get install squirrelmail

照著指示依序安裝後即可。
接下來,我們將把SquirrelMail路徑添加到Apache的默認虛擬主機文件中,該文件啟用了LetsEncrypt的加密SSL證書。

$ sudo nano /etc/apache2/sites-enabled/000-default-le-ssl.conf

在ServerName後面加上Alias設置,Alias /mail /usr/share/squirrelmail

<VirtualHost *:443>
... 
ServerName example.com
Alias /mail /usr/share/squirrelmail
...
</VirtualHost>

接著設置SquirrelMail就很簡單了

$domain = 'example.com';
$imapServerAddress = 'example.com';
$imapPort=993;  
$smtpPort=465; 
$smtp_auth_mech='login';
$use_imap_tls='true';
$use_smpt_tls='true';

修改/etc/access

用來允許或拒絕RELAY的網域,可參考 這裡。設定後,執行下面的指令才可轉換為access.db

 postmap hash:/etc/postfix/access

設定別名(Alias)

作為群組發信的很重要的應用,例如:[email protected],這個sales是個團隊,將發送到sales可轉發給其他特定的人員,其詳細說明可參考這裡。執行下面的指令才可轉換aliases.db

postalias hash:/etc/aliases

 

一站式的网络影音视频系统与平台

一站式的服务,包含头端、广播、客户端、以及互联网服务、服务器、云计算、与相关服务

一站式媒体平台 一站式媒体平台

 

我们所提供的服务

头端系统:

  • 集成式的接受装置(IRD):包括数字电视系统(卫星与地面数字电视系统)以及相关组件。
  • 编码器(Encoder)与转码器(Transcoder):软件编码、硬件编码、软件转码、与硬件转码。
  • 转接或汇成:以转换为网络协议(Internet Protocol)的方式传送到广播平台。

广播平台:

  • 采用Goalbit Solutions Inc所提供的系统平台,建构一套专有的串流媒体内容传送网络系统(Stream Media Content Delivery Network)
    • 包括Goalbit Play平台中的Goalbit Suite与Goalbit Media Server,以及Goalbit Apps的应用系统平台。
    • 此系统依据Goalbit开源系统所开发的平台,架设的方案最经济,应用也很广泛。
    • 其他详细讯息可以参考:http://www.thesolarsystems.net/cht/GoalbitPlatform.html
  • 采用Octoshape全球串流媒体内容广播平台
    • 该公司独特的技术,将串流信息透过该公司的网络系统,可抵达全球所有主要国家与地区。
    • 该系统主要特点为:快速开始缓冲速度、频道切换速度、以及超低延迟。
    • 若对Octoshape系统感到兴趣,可以到 http://www.thesolarsystems.net/cht/contact.html 与我们直接联系

客户端系统:

  • 有多种的客户端可以选择,包括多种浏览器支持的播放器插件,在平板与手机的app软件,以及可以在各种电视机收看的机顶盒。
  • 支持各种影音视频格式。

其他有关媒体平台的信息可以到 http://www.thesolarsystems.net/cht/MediaPlatform.html 进行了解。

我们一站式的服务,还包括互联网服务、互联网数据中心服务、以及各种客户端设备等,详细信息可上葵曜系统有限公司官网进行了解。

網路安裝Linux

網路安裝Linux系統

  1. 好處:可以取得最新版的Linux OS,網路安裝程式體積小,約17MB,可安裝于USB或SD卡,方便攜帶。
  2. 到此網址:http://unetbootin.sourceforge.net/ 下載usb燒錄程式。
  3. 到此hinet網路下載http://mirror01.idc.hinet.net/CentOS/ 選擇所需要安裝的OS版本。例如要安裝CentOS 5 x86_64版本的網路下載地址為:http://mirror01.idc.hinet.net/CentOS/5/isos/x86_64/CentOS-5.8-x86_64-netinstall.iso
  4. 於hinet IDC網站上的版本一直維持最新版,若需要舊版,則需到CentOS或其他作業系統的主站下載。
  5. 下載後,執行unetbootin程式,

若使用x86_64必須選擇_x64,會自動從網路上下載檔案後安裝,或者

輸入iso檔位置,iso檔案選擇已下載的開機iso檔案,因為要作為網路安裝,所以採用CentOS-5.8-x86_64-netinstall.iso這個檔案。之後再選擇所要安裝的USB隨身碟,切記,安裝之前先將此隨身碟予以FORMAT。因此程式只有支援到CentOS 5,所以必須留意。

 

  1. 製作此USB完成後即可拿到伺服器進行安裝。于伺服器必須確認可以由USB進行開機,可以進到BIOS進行設定,或者由BIOS所提供的開機選項,選擇使用USB進行開機。
  2. 開機後執行Linux開機選項,即可載入iso所提供的Linux安裝程式。
  3. 開機後,因無法使用滑鼠,可利用上下鍵選擇項目,然後再用TAB來切換到OK或Back或Cancel項目。
  4. 語言選擇“English”,Keyboard Type選擇us,Installation Method選擇http

10. Configure TCP/IP選項,保留Enabled IPv4 support, Dynamic IP configuration (DHCP) (如果網路有支援DHCP,否則必須選擇Manual Configuration以手動方式設定IP地址); Enable IPv6 support按下space取消此選項。

11. HTTP Setup

Web site name以Hinet為主, mirror01.idc.hinet.net (開頭不須加 http://)

CentOS directory為

CentOS/5/os/i386/  :32-bit CentOS

CentOS/5/os/x86_64/ : 64bit CentOS

其完整目錄如下

32bit

http://mirror01.idc.hinet.net/CentOS/5/os/i386/

64bit

http://mirror01.idc.hinet.net/CentOS/5/os/x86_64/

其他版本可以到 http://mirror01.idc.hinet.net/CentOS查看。

 

12. 完成以上動作後,即開始抓取hinet的程式,進行安裝,

其餘安裝步驟如同光碟安裝相同。

13. 其它例如ubuntu,安裝方式,除了製作USB可採用上述的方式外,可參考此網頁 https://help.ubuntu.com/community/Installation/MinimalCD