ubuntu 安裝apache

來源:互聯網
上載者:User

標籤:ubuntu   web server   apt   apache   web   

在ubuntu 12之前直接執行
sudo apt-get install apache2
不需要什麼配置直接在瀏覽器裡面輸入本機ip地址或者localhost

在瀏覽器頁面就會輸出:

It works!

This is the default web page for this server.

The web server software is running but no content has been added, yet.



這樣的字眼,但是今天我在ubuntu 14版本上面做同樣操作始終得不到上面如上效果


做了以下幾次嘗試
(1). ps -ef | grep apache2
www-data 25605 25601  0 16:52 ?        00:00:00 /usr/sbin/apache2 -k start
www-data 25606 25601  0 16:52 ?        00:00:00 /usr/sbin/apache2 -k start
www-data 25607 25601  0 16:52 ?        00:00:00 /usr/sbin/apache2 -k start
www-data 25608 25601  0 16:52 ?        00:00:00 /usr/sbin/apache2 -k start
www-data 25609 25601  0 16:52 ?        00:00:00 /usr/sbin/apache2 -k start
www-data 25617 25601  0 16:54 ?        00:00:00 /usr/sbin/apache2 -k start
www-data 25618 25601  0 16:54 ?        00:00:00 /usr/sbin/apache2 -k start
www-data 25619 25601  0 16:54 ?        00:00:00 /usr/sbin/apache2 -k start



(2).
升級apache版本,並且安裝相關的包,還是無果


在一籌莫展之時,發現/var/www檔案下面多了個html檔案夾
於是grep ‘/var‘/etc/apache2 -nr
/etc/apache2/sites-enabled/000-default:4:DocumentRoot /var/www/html
/etc/apache2/sites-enabled/000-default:9: <Directory /var/www/html>


這下可以真相大白了,原來預設的放網頁檔案的根目錄發生了變化從原來的/var/www 變成了
/var/www/html


問題就這麼解決了

ubuntu 安裝apache

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.