ubuntu 12.04下安裝lamp環境

來源:互聯網
上載者:User

ubuntu 12.04下安裝lamp環境 1) 安裝LAMP    >sudo apt-get install apache2 mysql-server mysql-client php5 php5-gd php5-mysql    配置MYSQL-SERVER密碼。     1.1、安裝完成後,        APACHE的設定檔目錄:/etc/apache2        PHP的設定檔目錄:/etc/php5        MYSQL的設定檔目錄:/etc/mysql    2)配置APACHE    2.1 在/home/目錄下建立apache目錄:        mkdir apache    2.2 cd apache 建立etc和www目錄:        mkdir etc www    2.3 修改/home/apache目錄的許可權:        sudo chown user:user -R /home/apache    2.4 COPY預設的設定檔到/home/etc/        cp -R /etc/apache2/sites-* /home/apache/etc    2.5 修改/etc/apache2/apache2.conf        vi /etc/apache2/apache2.conf    2.6 找到:Include sites-enabled/ 修改為:Include /home/apache/etc/sites-enabled/    2.7 重啟APACHE        sudo apachectl restart    2.8 配置預設網站:        vi /home/apache/etc/sites-available/default    2.9 找到:DocumentRoot /var/www 改為:DocumentRoot /home/apache/www/default.com    2.10 找到:<Directory /var/www/> 改為:<Directory /home/apache/www/default.com>     2.11 建立 /home/apache/www/default.com        sudo mkdir /home/apache/www/default.com    2.12 建立 /home/apache/www/default.com/index.php 檔案        sudo gedit /home/apache/www/default.com/index.php        輸入:        <?php        echo "hello word!";        ?>        儲存退出    2.13 讓配置生效:sudo apachectl graceful    2.14 瀏覽器中輸入:http://localhost/        顯示:hello word!     

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.