linux - 公有云发布个人静态站点

来源:互联网 发布:联想淘宝旗舰店 编辑:程序博客网 时间:2024/04/19 08:03
在公有云发布一个个人建的静态站点
要求:
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

修改文件前:


修改文件后:


重启服务后可以外网访问测试。






如果我不对的地方或您有好的方案,请多多包涵,本人还在学习当中。

欢迎大家私信指导,可以共同学习,提升更快
原创文章,如需转载,请注明参考文章等标注并附上我的博文网址

0 0
原创粉丝点击