怎么自己在家架设虚拟主机

人们通常会购买网页寄存服务,建立自己的网站。至于想把虚拟主机架设在经营场址的企业,则会花钱购买专业服务。如果你有一台旧笔记本电脑或个人电脑,能连接宽带,不妨自己创建免费网站,把它当作一项有益的爱好。

步骤

  1. {"smallUrl":"https:\/\/www.zenmeban.com\/images_en\/thumb\/f\/f0\/Create-a-Web-Host-in-Your-Home-Step-1.jpg\/v4-460px-Create-a-Web-Host-in-Your-Home-Step-1.jpg","bigUrl":"https:\/\/www.zenmeban.com\/images\/thumb\/f\/f0\/Create-a-Web-Host-in-Your-Home-Step-1.jpg\/v4-728px-Create-a-Web-Host-in-Your-Home-Step-1.jpg","smallWidth":460,"smallHeight":345,"bigWidth":728,"bigHeight":546,"licensing":"<div class=\"mw-parser-output\"><\/div>"} 1 获取Apache服务器软件。从现在开始,旧电脑将是你的“网络服务器”。下载公开授权的Apache HTTP Server到你的旧电脑。这个免费软件是网络上最广泛使用的服务器。
  2. {"smallUrl":"https:\/\/www.zenmeban.com\/images_en\/thumb\/b\/b2\/Create-a-Web-Host-in-Your-Home-Step-2.jpg\/v4-460px-Create-a-Web-Host-in-Your-Home-Step-2.jpg","bigUrl":"https:\/\/www.zenmeban.com\/images\/thumb\/b\/b2\/Create-a-Web-Host-in-Your-Home-Step-2.jpg\/v4-728px-Create-a-Web-Host-in-Your-Home-Step-2.jpg","smallWidth":460,"smallHeight":345,"bigWidth":728,"bigHeight":546,"licensing":"<div class=\"mw-parser-output\"><\/div>"} 2 双击已下载的文件进行安装。在弹出的对话框中,填写必要的栏目。这些都是任意信息,之后还可以更改。
  3. {"smallUrl":"https:\/\/www.zenmeban.com\/images_en\/thumb\/e\/eb\/Create-a-Web-Host-in-Your-Home-Step-3.jpg\/v4-460px-Create-a-Web-Host-in-Your-Home-Step-3.jpg","bigUrl":"https:\/\/www.zenmeban.com\/images\/thumb\/e\/eb\/Create-a-Web-Host-in-Your-Home-Step-3.jpg\/v4-728px-Create-a-Web-Host-in-Your-Home-Step-3.jpg","smallWidth":460,"smallHeight":345,"bigWidth":728,"bigHeight":546,"licensing":"<div class=\"mw-parser-output\"><\/div>"} 3 在接下来的对话框中,选择自定义安装。将Apache安装目录更改到你想要的文件夹。
  4. {"smallUrl":"https:\/\/www.zenmeban.com\/images_en\/thumb\/9\/90\/Create-a-Web-Host-in-Your-Home-Step-4.jpg\/v4-460px-Create-a-Web-Host-in-Your-Home-Step-4.jpg","bigUrl":"https:\/\/www.zenmeban.com\/images\/thumb\/9\/90\/Create-a-Web-Host-in-Your-Home-Step-4.jpg\/v4-728px-Create-a-Web-Host-in-Your-Home-Step-4.jpg","smallWidth":460,"smallHeight":345,"bigWidth":728,"bigHeight":546,"licensing":"<div class=\"mw-parser-output\"><\/div>"} 4 进入安装目录,寻找“conf”文件夹。进入文件夹,打开“httpd.conf”文件。现在,在你的“网络服务器”里,创建网站的根目录,例如"C:\Web\MyWeb"。
  5. 5 在“httpd.conf”文件里,把Apache默认的服务文档改成你网站的根目录。
    • 之前 {"smallUrl":"https:\/\/www.zenmeban.com\/images_en\/thumb\/f\/f2\/Create-a-Web-Host-in-Your-Home-Step-5Bullet1.jpg\/v4-460px-Create-a-Web-Host-in-Your-Home-Step-5Bullet1.jpg","bigUrl":"https:\/\/www.zenmeban.com\/images\/thumb\/f\/f2\/Create-a-Web-Host-in-Your-Home-Step-5Bullet1.jpg\/v4-728px-Create-a-Web-Host-in-Your-Home-Step-5Bullet1.jpg","smallWidth":460,"smallHeight":345,"bigWidth":728,"bigHeight":546,"licensing":"<div class=\"mw-parser-output\"><\/div>"}
    • 之后 {"smallUrl":"https:\/\/www.zenmeban.com\/images_en\/thumb\/c\/cc\/Create-a-Web-Host-in-Your-Home-Step-5Bullet2.jpg\/v4-460px-Create-a-Web-Host-in-Your-Home-Step-5Bullet2.jpg","bigUrl":"https:\/\/www.zenmeban.com\/images\/thumb\/c\/cc\/Create-a-Web-Host-in-Your-Home-Step-5Bullet2.jpg\/v4-728px-Create-a-Web-Host-in-Your-Home-Step-5Bullet2.jpg","smallWidth":460,"smallHeight":345,"bigWidth":728,"bigHeight":546,"licensing":"<div class=\"mw-parser-output\"><\/div>"}
  6. 6 在同一个文件里,将Apache默认的网络目录改成你自己的网络目录。
    • 之前 {"smallUrl":"https:\/\/www.zenmeban.com\/images_en\/thumb\/b\/bc\/Create-a-Web-Host-in-Your-Home-Step-6Bullet1.jpg\/v4-460px-Create-a-Web-Host-in-Your-Home-Step-6Bullet1.jpg","bigUrl":"https:\/\/www.zenmeban.com\/images\/thumb\/b\/bc\/Create-a-Web-Host-in-Your-Home-Step-6Bullet1.jpg\/v4-728px-Create-a-Web-Host-in-Your-Home-Step-6Bullet1.jpg","smallWidth":460,"smallHeight":345,"bigWidth":728,"bigHeight":546,"licensing":"<div class=\"mw-parser-output\"><\/div>"}
    • 之后 {"smallUrl":"https:\/\/www.zenmeban.com\/images_en\/thumb\/0\/07\/Create-a-Web-Host-in-Your-Home-Step-6Bullet2.jpg\/v4-460px-Create-a-Web-Host-in-Your-Home-Step-6Bullet2.jpg","bigUrl":"https:\/\/www.zenmeban.com\/images\/thumb\/0\/07\/Create-a-Web-Host-in-Your-Home-Step-6Bullet2.jpg\/v4-728px-Create-a-Web-Host-in-Your-Home-Step-6Bullet2.jpg","smallWidth":460,"smallHeight":345,"bigWidth":728,"bigHeight":546,"licensing":"<div class=\"mw-parser-output\"><\/div>"}
  7. {"smallUrl":"https:\/\/www.zenmeban.com\/images_en\/thumb\/6\/65\/Create-a-Web-Host-in-Your-Home-Step-7.jpg\/v4-460px-Create-a-Web-Host-in-Your-Home-Step-7.jpg","bigUrl":"https:\/\/www.zenmeban.com\/images\/thumb\/6\/65\/Create-a-Web-Host-in-Your-Home-Step-7.jpg\/v4-728px-Create-a-Web-Host-in-Your-Home-Step-7.jpg","smallWidth":460,"smallHeight":345,"bigWidth":728,"bigHeight":546,"licensing":"<div class=\"mw-parser-output\"><\/div>"} 7 利用你对HTML代码的基本知识,创建一个测试页面。写下“我是赢家!”,把它保存为"C:\Web\MyWeb\index.html"。
  8. {"smallUrl":"https:\/\/www.zenmeban.com\/images_en\/thumb\/2\/26\/Create-a-Web-Host-in-Your-Home-Step-8.jpg\/v4-460px-Create-a-Web-Host-in-Your-Home-Step-8.jpg","bigUrl":"https:\/\/www.zenmeban.com\/images\/thumb\/2\/26\/Create-a-Web-Host-in-Your-Home-Step-8.jpg\/v4-728px-Create-a-Web-Host-in-Your-Home-Step-8.jpg","smallWidth":460,"smallHeight":345,"bigWidth":728,"bigHeight":546,"licensing":"<div class=\"mw-parser-output\"><\/div>"} 8 打开80端口(埠80)进行转发。你可以参阅wikihow的英语文章Open Your Port 80 Behind a Firewall。
  9. {"smallUrl":"https:\/\/www.zenmeban.com\/images_en\/thumb\/9\/99\/Create-a-Web-Host-in-Your-Home-Step-9.jpg\/v4-460px-Create-a-Web-Host-in-Your-Home-Step-9.jpg","bigUrl":"https:\/\/www.zenmeban.com\/images\/thumb\/9\/99\/Create-a-Web-Host-in-Your-Home-Step-9.jpg\/v4-728px-Create-a-Web-Host-in-Your-Home-Step-9.jpg","smallWidth":460,"smallHeight":345,"bigWidth":728,"bigHeight":546,"licensing":"<div class=\"mw-parser-output\"><\/div>"} 9寻找你的网站。在你的“网络服务器”中,打开你喜欢的浏览器,在地址栏输入http://localhost/,你的赢家网页将会在互联网上运行。
  10. 10 获取你家里的IP地址(参阅wikihow的英语文章Open Your Port 80 Behind a Firewall)。这是互联网服务提供商给宽带分配的地址。要求朋友在他的浏览器里输入你的IP地址。现在,你的网站已向公众开放。
    • 假设你的IP地址是98.227.112.49,让你的朋友输入http:// 98.227.112.49/。 {"smallUrl":"https:\/\/www.zenmeban.com\/images_en\/thumb\/7\/7c\/Create-a-Web-Host-in-Your-Home-Step-10Bullet1.jpg\/v4-460px-Create-a-Web-Host-in-Your-Home-Step-10Bullet1.jpg","bigUrl":"https:\/\/www.zenmeban.com\/images\/thumb\/7\/7c\/Create-a-Web-Host-in-Your-Home-Step-10Bullet1.jpg\/v4-728px-Create-a-Web-Host-in-Your-Home-Step-10Bullet1.jpg","smallWidth":460,"smallHeight":345,"bigWidth":728,"bigHeight":546,"licensing":"<div class=\"mw-parser-output\"><\/div>"}
    • 电脑IP地址会变,而且很难记。它需要动态维持,并像其它网站一样指定一个名称,例如http://www.i_am_homesite_proud.com。 {"smallUrl":"https:\/\/www.zenmeban.com\/images_en\/thumb\/e\/e1\/Create-a-Web-Host-in-Your-Home-Step-10Bullet2.jpg\/v4-460px-Create-a-Web-Host-in-Your-Home-Step-10Bullet2.jpg","bigUrl":"https:\/\/www.zenmeban.com\/images\/thumb\/e\/e1\/Create-a-Web-Host-in-Your-Home-Step-10Bullet2.jpg\/v4-728px-Create-a-Web-Host-in-Your-Home-Step-10Bullet2.jpg","smallWidth":460,"smallHeight":345,"bigWidth":728,"bigHeight":546,"licensing":"<div class=\"mw-parser-output\"><\/div>"}

小提示

  • 你需要向动态域名服务提供商(DDNS provider)获取免费或付费服务。他们也能提供容易记忆的网站名,和免费的客户软件,让你安装在网络服务器上,维持不断变化的IP地址。而人们可以使用这个网站名找到你的网站。如果你想要自己喜欢的网站名,就得花钱购买一个。然后按照简单的指示,将它指定到动态域名服务提供商。

警告

  • 别拿你和家人常用的电脑做这些实验。

<<:  怎么不用打孔器给贝壳钻孔

>>:  怎么将计算机ATX电源改装为实验室电源

怎么判断一个已经有男朋友的女孩是否喜欢你

你没法始终控制自己的感情。即使你也不想,但也有可能会爱上一个已经有男朋友的女孩。要弄清楚这种感觉是否...

怎么减小腰围

腹部脂肪危害大,所以减小腰围不只能改善外观,还有益健康。和七十年前相比,人均腰围增加了约18厘米,有...

怎么擦亮皮鞋

一双被擦得很亮的皮鞋是搭配华丽衣服的必备武器,它会让你在走进房间的时候给别人留下很好的印象。这里有一...

医生不负责怎么办?怎么应对不负责任的医生

如果您认为医生不负责任,您可以采取以下步骤: 与医生进行交流:首先,您应该与医生进行交流,表达您的...

怎么学习汉语(普通话)

你身边有没有外国友人想要学习汉语?要知道,学习汉语是一件相当复杂的事情,这对说英语的人来说,更是如此...