網站備案
在我們備案過一個網站后,必須要在自己的主頁底部放入自己的備案號並可跳轉至工信部網站。
但在我們開發的初始階段,沒有成型的項目發布在服務器上,這時我們可以放一個靜態的html界面在這個主頁上,這也是此次分享的目的。
步驟
安裝apache2
debian系列(Ubuntu, Debian): apt-get install apache2
Fedora系列(rhel, centos):yum install httpd
開啟apache服務
systemctl start httpd/apache2
systemctl stop httpd/apache2
編輯源碼
在/var/www/html/目錄下修改或新建index.html文件,添加源代碼,如下:
<html>
<head>
<title>優惠八五二測試站(備案用)</title>
<meta charset="UTF-8">
<style>
header { background-color:black; color:white; text-align:center; padding:5px;}nav { line-height:30px; background-color:#eeeeee; height:480px; width:100px; float:left; padding:5px;}section { width:350px; float:left; padding:10px;}footer { background-color:black; color:white; clear:both; text-align:center; padding:5px;}
</style>
</head>
<body>
<header>
<h1>此網站用於個人開發測試。</h1>
</header>
<nav>
Bawuer
</nav>
<section>
<h1>黑龍江省寶清縣八五二農場</h1>
<p>
非常美,美得自然。
</p>
<p>
呼吸着新鮮的空氣,一眼望不到邊的良田。
</p>
</section>
<footer>
<a href="http://www.beian.miit.gov.cn">備案號:黑ICP備18006514號</a>
</footer>
</body>
</html>
測試
訪問自己的域名(設置過域名解析),如訪問 http://www.xxx.com,應出現如下網頁: