使用【阿里云】服务器、【Xshell】搭建自己的【网站】—— { }

重置实例密码在这里插入图片描述

打开Xshell连接主机

在这里插入图片描述
在这里插入图片描述
在这里插入图片描述

Apache 服务

  • 安装
    yum install httpd* -y
  • 操作
    • 启动
      systemctl start httpd.service
    • 查看状态
      systemctl status httpd.service
    • 停止
      systemctl stop httpd.service

此时在浏览器打开云服务器的公网IP就可以访问了,出现下面这样的画面代表成功

在这里插入图片描述

如果出现无法访问,就需要到云服务器控制台“添加安全组”

在这里插入图片描述
在这里插入图片描述

Apache网站配置

  • 网站数据目录
    /var/www/html

使用绝对路径进入目录,Xshell输入命令:cd /var/www/html
这里放你的 index.html 文件

测试

  • 在 html 目录输入命令:vim index.html
  • 按下 i 进入 vim 的输入模式
  • 输入:Hello Linux
  • 按下 Esc 退出输入模式
  • 输入英文冒号 :,输入wq,保存并退出
  • 在浏览器输入公网IP地址
    在这里插入图片描述

猜你喜欢

转载自blog.csdn.net/weixin_43921423/article/details/121144276