人们通常会购买网页寄存服务,建立自己的网站。至于想把虚拟主机架设在经营场址的企业,则会花钱购买专业服务。如果你有一台旧笔记本电脑或个人电脑,能连接宽带,不妨自己创建免费网站,把它当作一项有益的爱好。
步骤
{"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到你的旧电脑。这个免费软件是网络上最广泛使用的服务器。
{"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
双击已下载的文件进行安装。 在弹出的对话框中,填写必要的栏目。这些都是任意信息,之后还可以更改。
{"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安装目录更改到你想要的文件夹。
{"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
在“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
在同一个文件里,将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>"}
{"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"。
{"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。
{"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
获取你家里的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地址。而人们可以使用这个网站名找到你的网站。如果你想要自己喜欢的网站名,就得花钱购买一个。然后按照简单的指示,将它指定到动态域名服务提供商。
警告