阿里雲 Ubuntu14.04安裝PHP+MySQL+Apache

1,更新鏡像源php

sudo apt-get updatehtml

2,安裝基礎包mysql

sudo apt-get install apache2

sudo apt-get install php5 libapache2-mod-php5sql

sudo apt-get install mysql-server libapache2-mod-auth-mysql php5-mysql mysql-client

3,安裝PHP經常使用擴展apache

sudo apt-get install php5-mcrypt php5-gd php5-curl

4,把apache根目錄改到數據盤緩存

(持載數據盤請參考:http://jingyan.baidu.com/article/90808022d2e9a3fd91c80fe9.html)curl

  把/etc/apache2/sites-available/000-default.conf 裏的DocumentRoot改爲新目錄url

把/etc/apache2/mods-enabled/dir.conf文件裏的DirectoryIndex改爲默認首頁是index.phpserver

<IfModule mod_dir.c>
        DirectoryIndex index.php index.html index.cgi index.pl index.xhtml index.htm
</IfModule>htm

apache配置

sudo a2enmod rewrite

sudo a2enmod deflate //開啓mod_deflate

//使用Apache mod_expires 與 mod_headers模塊實現文件緩存

(http://www.jbxue.com/article/15060.html)

sudo a2enmod expires

sudo a2enmod headers 

相關文章
相關標籤/搜索