---
# System prepended metadata

title: 伺服器架設期末考

---

#    期末考可以做的內容:
1. 安裝linux  
2. 使用network設定網路
3. ssh server (無密碼登錄,sftp)
4. ipv6架站
5. https架站 
6. NFS 
7. samba 
8. ngrok
9. httpd + php + mysql
10. httpd(資料夾限制ip存取, 密碼登錄下載檔案) 
11. VPN (pptpd) 
12. FTP server (vsftpd)
At least complete 6 items, and then you can pass this subject.

##    NFS 課程日期10/3
###    NFS
https://qizhanming.com/blog/2018/08/08/how-to-install-nfs-on-centos-7
##    VPN server 課程日期11/14

###    參考
> [配置PPTP VPN服务端到客户端]https://help.aliyun.com/zh/ecs/how-do-i-configure-a-connection-between-a-pptp-vpn-server-and-a-pptp-vpn-client-on-a-centos-7-instance

> [pptpd]https://github.com/stereomp3/note/blob/main/linux/111semester01/7-VPN.md#pptpd

##    課程日期11/21
##    課程日期11/28
### Linux 建立自訂 Systemd 服務 O
1.  編輯/opt/echo_server.py :
```linux=
gedit /opt/echo_server.py
```
2. 撰寫一個 echo 伺服器 :
```python=
#!/usr/bin/env python3
#記得yum install python3
import socket

# 建立 socket
serv = socket.socket(socket.AF_INET, socket.SOCK_STREAM)

# 綁定所有網路介面的 9000 連接埠
serv.bind(('0.0.0.0', 9000))

# 開始接受 client 連線
serv.listen()

while True:

    # 接受 client 連線
    conn, addr = serv.accept()
    print('Client from', addr)

    while True:

        # 接收資料
        data = conn.recv(1024)

        # 若無資料則離開
        if not data: break

        # 傳送資料
        conn.send(data)

    conn.close()
    print('Client disconnected')
```
3. 建立好 /opt/echo_server.py 之後，順便開啟執行權限：


> [Systemd服務教學]https://blog.gtwang.org/linux/linux-create-systemd-service-unit-for-python-echo-server-tutorial-examples/
### 安装”Telnet“服务
> [安装”Telnet“服务]https://cloud.tencent.com/developer/article/2274078

##    課程日期12/5 O
###    Apche
![image](https://hackmd.io/_uploads/rynMVBnST.png)
###    mysql
![image](https://hackmd.io/_uploads/SJb2XShB6.png)
###    PHP
![image](https://hackmd.io/_uploads/rkT3QB3BT.png)

> [Apache,mysql,PHP]
> https://github.com/stereomp3/note/blob/main/linux/111semester01/13-.md