当前位置:首页 > 新闻动态 > 网站文章

在Linux上搭建一个自己的网站

来源: 浏览:119 时间:2023-08-16

前言

httpd

配置

yum install httpd -yrpm -ql httpd | grep /etctree /etc/httpdconfconf.d
yum install curl -ysystemctl start httpd/var/www/html/index.htmlecho Hello, World! > /var/www/html/index.htmlcurl 192.168.32.128

实验

我们成功下载 Apache Web 服务器,并且成功访问了他的静态页面,我们也可以写一些配置文件对细节做一些设置

基于不同IP访问

nmcli connection modify ens33 +ipv4.addresses 192.168.32.100/24 +ipv4.addresses 192.168.32.200/24nmcli connection up ens33index.htmlmkdir -p /var/www/ip/{100,200}cat /usr/share/doc/httpd/httpd-vhosts.confvim /etc/httpd/conf.d/ip.confsystemctl restart httpdcurl 192.168.32.100curl 192.168.32.200

基于不同端口访问

mkdir -p /var/www/port/{10000,20000}vim /etc/httpd/conf.d/port.confsystemctl restart httpd

基于域名访问

mkdir /var/www/portnmcli connection modify ens33 +ipv4.addresses 192.168.32.10/24echo this is a test > /var/www/host/index.htmlvim /etc/httpd/conf.d/host.confsystemctl restart httpdvim /etc/hostsC:WindowsSystem32driversetchostscurl www.test.com

地址 · ADDRESS

地址:建邺区新城科技园嘉陵江东街18号2层

邮箱:309474043@qq.Com

点击查看更多案例

联系 · CALL TEL

400-8793-956

售后专线:025-65016872

业务QQ:309474043    售后QQ:1850555641

©南京安优网络科技有限公司 版权所有   苏ICP备12071769号-4  网站地图