歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Linux基礎 >> Linux技術 >> Ubuntu下安裝apache

Ubuntu下安裝apache

日期:2017/3/3 13:03:50   编辑:Linux技術

安裝:sudo apt-get install apache2

啟動服務器:sudo /etc/init.d/apache2 start

測試:在浏覽器輸入:127.0.0.1進行回環地址測試,結果如下:

It works!

This is the default web page for this server.

The web server software is running but no content has been added, yet.
停止服務器:sudo /etc/init.d/apache2 stop

重啟服務器:sudo /etc/init.d/apache2 restart

另外,也可用sudo apache2ctl -k start(stop/restart)進行上述操作

上述內容實際上是服務器根目錄‘/var/www'下的index.html文件。用戶可以將自己開發的網頁放入/var/www根目錄內

Copyright © Linux教程網 All Rights Reserved