如何搭建自己的web服务器以及自己的服务器购买

如何搭建自己的web服务器

[root@localhost~]# cat /etc/sysconfig/network-scripts/ifcfg-eth0

DEVICE=eth0

BOOTPROTO=static

ONBOOT=yes

HWADDR=00:0c:29:5d:a8:80

IPADDR=192.168.1.13

NETMASK=255.255.255.0

2、配置主机名

[root@localhost~]# cat /etc/sysconfig/network

NETWORKING=yes

NETWORKING_IPV6=yes

HOSTNAME=web.gx.com

3、修改hosts文件

[root@localhost~]# cat /etc/hosts

127.0.0.1 localhost.localdomain localhost

::1 localhost6.localdomain6 localhost6

192.168.1.253 web.xxxxx.com web

[root@localhost~]# service network restart

[root@localhost~]# chkconfig network on

4、安装

[root@localhost~]# rpm -q httpd

package httpd is not installed

[root@localhost~]# yum -y install httpd

5、启动web服务

[root@localhost~]# service httpd restart

[root@localhost~]# chkconfig httpd on

试验二:基本HTTP服务器的配置

 Web服务器域名:www.xxxxx.com

 默认首页包括:index.html、index.*

 开启保持连接 

 网站用自己的静态网页musicapp测试

服务器操作:

1、备份主配置文件

[root@localhost ~]# cd /etc/httpd/conf

[root@localhost conf]# cp httpd.conf httpd.conf.bak

2、修改主配置文件

[root@localhost ~]# vim /etc/httpd/conf/httpd.conf

74 KeepAlive On

265 ServerName www.gx.com:80

391 DirectoryIndex index.html index.php

3、启动服务

[root@localhost ~]# service httpd restart

超好用的服务器

链接: https://bandwagonhost.com/aff.php?aff=40805.
这个服务器价格便宜而且好用,欢迎大家使用

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值