官網下載VMware並安裝,點擊進入VMware後在vmvare上點擊新建一個虛擬機。html
安裝來源欄選擇安裝程序光盤映像文件,找到儲存ISO文件的地方並選擇。shell
ubuntu server比desktop消耗的內存要小,所以然後分配內存大約選擇內存1G,硬盤20G。要記住本身設置的密碼,這在登陸server的時候會用到。apache
安裝好的ubuntu server沒有desktop那樣的界面,而只有命令輸入界面。進入以後,首先使用你的用戶名,密碼登陸。而後使用命令sudo passwd來設置你的root密碼。這將讓你有權限進入管理者模式,務必牢記root密碼。ubuntu
首先使用命令 apt-get update 來更新軟件源,而後分別使用命令 apt-install openssh-server 和 apt-get install vim 來安裝 openssh 和 vim ,這兩個軟件會在後面的更新源步驟用到。vim
在Windows系統下安裝這些軟件:Xshell,XFTP,sublime,這些軟件均可以在相應的官網下載到,Xshell和XFTP能夠選擇下載學生和家庭版本,以後官網會將連接發到你的郵箱,而後你就能夠在郵箱裏點擊連接下載文件了。網絡
首先在server端用sudo su root得到管理者權限,而後輸入ifconfig查看虛擬機的IP地址。(網絡配置選擇NAT模式)。
打開Xshell建立一個新的會話,在主機寫上你剛纔查看的IP地址,點擊肯定,以後再會話列表中找到這個會話,點擊並鏈接,便可鏈接上你的虛擬機。連接上後點擊任務欄裏「新建文件傳輸」的選項,便可進入xftp,與虛擬機創建鏈接,能夠開始文件傳輸。ssh
首先備份spa
而後打開source.list的文件夾(vim /etc/apt/sources.list),更改它的讀寫權限rest
chmod 777 source.list
將source.list拖拽到Windows桌面,用sublime打開,只保留第一個#號,其他內容都替換爲如下內容code
# 默認註釋了源碼鏡像以提升 apt update 速度,若有須要可自行取消註釋 deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial main restricted universe multiverse # deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial main restricted universe multiverse deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-updates main restricted universe multiverse # deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-updates main restricted universe multiverse deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-backports main restricted universe multiverse # deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-backports main restricted universe multiverse deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-security main restricted universe multiverse # deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-security main restricted universe multiverse
而後將修改後的source.list拖拽回原來文件夾,選擇「覆蓋」。以後回到server終端,執行指令
sudo apt-get update
至此,清華源更新完成。
apt-get install apache2
$sudo /etc/init.d/apache2 start
獲取server root權限,使用xshell和xftp鏈接,更改var/www/html文件夾的讀寫屬性爲777,而後將你作好的網頁文件夾放在這個文件夾中。若是可以在網頁中用IP查看到你的網頁,說明操做成功。如192.168.153.130/example/caculator1.html