# 雲端MidTerm - **1063012 方語軒** 目錄 == [Toc] 伺服器的BIOS設定與USB boot製作 === ## USB Boot製作 ## 建立ubuntu開機碟   ## 伺服器BIOS設定 ### 設定帳號密碼  ## 設定網路  **installing...**   ### 利用PuTTY連上server  ### 連上畫面  ## 安裝kvm套件 ``` sudo apt update sudo apt install qemu-kvm libvirt-daemon-system libvirt-clients bridge-utils ```  ## 設定網路ip ``` sudo ip addr flush sudo ip addr add 10.2.200.206/25 dev eno1 sudo ip addr set dev eno1 sudo ip link ```  安裝OpenStack === ## 安裝microstack Install OpenStack yourself : https://ubuntu.com/openstack/install ``` $ sudo snap install microstack --devmode --beta ```  ``` $ sudo microstack init --auto --control ``` ### 登入openstack  **帳號:admin 密碼:cyrpDtvZggMT44eHEUCb2JzYWwcgkNf4**  ### Working  ## 連接網路 https://connection.rnascimento.com/2021/03/08/openstack-single-node-microstack/ ## 建立 Physical Network  ### 建立子網路  **IP區間 : 10.2.200.207-210**  ### 建立 Router  ### Add Interface  ### Allocate FloatingIPs   <font size=4>**Floating ip:**</font><br> - **10.2.200.210** - *1 ### 重啟 microstack ``` sudo snap disable microstack sudo snap enable microstack ``` ## 掛載 Ubuntu image https://docs.openstack.org/glance/pike/admin/manage-images.html ``` $ openstack image create --disk-format qcow2 --container-format bare \ --public --file ubuntu-20.04.2-live-server-amd64.iso ubuntu-20.04.2 ``` https://www.geek-share.com/detail/2777268145.html https://ask.openstack.org/en/question/117479/failed-to-discover-available-identity-version-when-contacting-http192168xx5000v3-attempting-to-parse-version-from-url/ https://blog.csdn.net/m0_37313888/article/details/89358538 https://clay-atlas.com/blog/2020/03/23/linux-%E4%BD%BF%E7%94%A8%E5%91%BD%E4%BB%A4%E5%88%97%E6%8E%9B%E8%BC%89-usb-%E8%A3%9D%E7%BD%AE/ h10 server  https://ithelp.ithome.com.tw/articles/10185936 ## 建立虛擬機 ## 設定名稱  #### 虛擬機掛載ubuntu  #### 設定網路  #### 綁定flouting IP   #### 虛擬機執行畫面   #### 遠端連線  ## 虛擬機運作(LAMP,phpinfo()) ``` sudo dhclient ens3 ``` 安裝Lamp == https://ithelp.ithome.com.tw/articles/10216362 ### 更新套件清單 ``` sudo apt update ``` ## 安裝Lamp Server **安裝具有Apache+MariaDB+PHP7.2語言+資料庫管理介面phpMyAdmin套件,完成一個具有資料庫的動態網頁程式設計的開發環境** * 安裝 Apache Server `sudo apt-get intstall apache2` * 安裝 phpmyadmin 套件 `sudo apt-get install phpmyadmin` * 下載 EPEL Repository 及 Remi Repo : `yum install epel-release` `rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-7.rpm` * 安裝MariaDB `sudo yum -y install nginx php70-php-fpm mariadb-server` * 安裝httpd `sudo yum -y install httpd` * 避免網頁目錄被讀取 修改 /etc/apache2/apache2.conf 檔案 移除<Directory / > 和 </Directory> 中間的Indexs字眼 * 移除網頁伺服器資訊 修改/etc/apache2/conf-available/localized-error-pages.conf 設定ErrorDocume 403 內容 * 修改/etc/apache2/mods-available/php5.conf,設定 ``` <IfModule mod_userdir.c> <Directory /home/*/public_html> php_admin_value engine On </Directory> </IfModule> ``` * 重啟apache `sudo service apache2 restart` * 允許防火牆讓 HTTP、HTTPS 封包通過。 `sudo firewall-cmd --permanent --zone=public --add-service=http` `sudo firewall-cmd --permanent --zone=public --add-service=https` `sudo firewall-cmd --reload` * 啟動 httpd,並讓它在開機後自動啟動。 `sudo systemctl start httpd` `sudo systemctl enable httpd` * 啟動 MariaDB Server,並讓它在開機後自動啟動。 `sudo systemctl restart mariadb` `sudo systemctl enable mariadb` * 為 Apache 加入 PHP 的支援,重新啟動 Apache 就可以了。 `sudo systemctl restart httpd` * 建立一個 PHP 測試檔。 `sudo vi /var/www/html/info.php` * 呼叫內建函數。 `<?php phpinfo(); ?>` ### 建立一個call phpinfo()的網頁 ``` cd /var/www/html sudo nano info.php ``` ### info.php填入以下內容 ``` <?php phpinfo(); ?> ``` ### 在 Openstack 編輯 Security Group Project > Network > Security Group > Manage Rules > Add Rules   ## 對虛擬機 Associate Floating IP 於此步驟後在瀏覽器上打上位址即可看到phpinfo()所回應之結果  結果 == ### 1063012 方語軒 http://10.2.200.210/info.php 
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up