【Linux】 公有云發佈個人靜態站點

 

在公有云發佈一個個人建的靜態站點
要求:
1、使用騰訊雲申請一個雲主機
2、申請萬網個人域名

 

3、使用三種web服務器來發布個人的站點

 

 

一、首先我選擇了騰訊雲的雲主機:

~1)低消費嘗試一下,當然有錢的可以包年包月

~2) 由於準備安裝的是Linux系統選擇CentOS

 

~3)基礎網絡,收費便宜點

~4)成功設置好信息大家可以看到我們已經在運營了

~5)通過配置安全組

~6) 新建一個專門爲了測試JAVAWEB的安全組

~7) 編輯規則添加三種(apache,tomact,httpd)站點服務器

~8)新建成功

 

 

二、域名申請這個大家有錢可以去 萬網 進行申請,不同域名不同的價格。

三、使用三種web服務器來發布個人的站點(apache,tomca,nginix)

大家首先要安裝好這三個服務器,並且打開防火牆,配置好JDK(tomca需要)

 

開啓防火牆

systemctl enable firewalld.service 

systemctl status firewalld.service 
reboot

1.Apache。

yum install httpd -y
 systemctl  start httpd.service 
 systemctl status httpd.service 

systemctl enable httpd.service 
systemctl is-enabled httpd.service 

firewall-cmd --list-all
firewall-cmd --status

 firewall-cmd --add-service=http --permanent 

 firewall-cmd --reload

firewall-cmd --list-all

在這裏先編輯一下靜態網站內容

 cd /

 cd var

 cd www

 cd html

echo "Hello my name is Huweihui ,you can go to my blog www.blog.csdn.net/huhui_">>index.html
 chmod 705 index.html

瀏覽器通過我的共有云IP訪問:

 

 

3.Tomcat

先安裝JDK

 

 

 

 

 

 

在安裝tomcat

 tar -zxvf apache-tomcat-8.0.28.tar.gz 
sh /opt/anzhuangbao/apache-tomcat-8.0.28/bin/startup.sh 
 ps -aux|grep tomcat

 


firfirewall-cmd --add-port=8080/tcp --permanent 

firewall-cmd --reload
firewall-cmd --list-all

 

 

 

 

外網訪問測試一下:

 

3.Nginix.
 rpm -ivh nginx-release-rhel-7-0.el7.ngx.noarch.rpm 
 yum installnginx -y
yum install nginx -y
 systemctl stop httpd.service 
 systemctl start nginx.service
systemctl status nginx
firewall-cmd --add-service=http --permanent 

 cd /etc/nginx/conf.d/
 cp default.conf default.conf.bak
  vi default.conf

修改文件前:

修改文件後:

 

重啓服務後可以外網訪問測試。

 

 

 

 

 

如果我不對的地方或您有好的方案,請多多包涵,本人還在學習當中。

歡迎大傢俬信指導,可以共同學習,提升更快
原創文章,如需轉載,請註明參考文章等標註並附上我的博文網址

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章