linux服务器怎么搭建网站

540
2020/12/5 15:00:31
栏目: 云计算
开发者测试专用服务器限时活动,0元免费领,库存有限,领完即止! 点击查看>>

linux服务器怎么搭建网站

linux服务器搭建网站的案例:

1.打开终端控制台,输入命令:“yum -y install httpd”,安装web服务软件。

2.输入命令:“systemctl start httpd”,启动httpd服务。

3.输入命令:“vim /etc/httpd/conf/httpd.conf”。进入主配置文件。

4.输入命令:“vim /etc/httpd/conf.d/httpd-vhosts.conf”。编辑一个子配置文件,代码:

<VirtuaLHost *:80>

DocumentRoot "/ var/www/htmt"

<Directory "/var/www/html">

<RequireAll>

Require all granted

</RequireAll>

</Directory>

</VirtuaLHost>

5.输入命令:“systemctl restart httpd ”。重启服务。

6.输入命令:“cat /var/www/html/index.html”。查看index.html 文件中的内容。

7.输入命令:“ifconfig ens33”。查看ens33网卡的地址。

8.在浏览器中输入地址即可访问。



辰迅云「云服务器」,即开即用、新一代英特尔至强铂金CPU、三副本存储NVMe SSD云盘,价格低至29元/月。点击查看>>

推荐阅读: linux中fcitx怎么启用