//MYSQL 安装流程整理
apt-get install libncurses5-dev
apt-get install g++
./configure --prefix=/usr/local/mysql
make && make install
sudo cp support-files/my-medium.cnf /etc/my.cnf
bin/mysql_install_db --user=mysql
sudo groupadd mysql
sudo useradd -g mysql mysql
mysql:bin/mysqld_safe –user=mysql &
//apache的配置
apache 直接 编译安装即可 没有什么特别的
./configure --prefix=/usr/local/apache2
make
make install
//php 的配置
解压freetype
./configure --prefix=/usr/local/freetype
make && make install
或者
apt-get install libfreetype6-dev
编译php
apt-get install libxml2-dev
apt-get install libpng-dev
apt-get install libgif-dev
apt-get install libjpeg62-dev
./configure --prefix=/usr/local/php5 --sysconfdir=/etc --with-gd --with-curl --with-apxs2=/usr/local/apache2/bin/apxs --with-mysql=/usr/local/mysql --with-mysqli=/usr/local/mysql/bin/mysql_config --with-png-dir=/usr/local --enable-exif --with-freetype-dir=/usr/local/freetype --with-jpeg-dir=/usr --disable-cli
6.2,编辑“/usr/local/apache2/conf/httpd.conf ”文件:
6.2.1,找到 AddType application/x-gzip .gz .tgz 在其下添加如下内容
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps
6.2.2,设置 WEB 默认文件:
查找:
DirectoryIndex index.html
替换为:
DirectoryIndex index.htm index.html index.html.var index.php
//在 WEB 目录不到默认文件,httpd 就会执行 /var/www/error/noindex.html
6.2.3,让Apache 支持rewrite:
找到这一段:
# AllowOverride controls what directives may be placed in .htaccess files.
# It can be “All”, “None”, or any combination of the keywords:
# Options FileInfo AuthConfig Limit
#
AllowOverride None
将“AllowOverride None”修改为:
AllowOverride All
6.2.4,更改网站根目录:
查找:
DocumentRoot “/usr/local/apache2/htdocs”
改为:
DocumentRoot “/home/www”
查找:
<Directory “/usr/local/apache2/htdocs”>
改为:
<Directory “/home/www”>
6.2.5:找到以下内容并去掉注释:
Include conf/extra/httpd-mpm.conf
Include conf/extra/httpd-info.conf
Include conf/extra/httpd-vhosts.conf
Include conf/extra/httpd-default.conf
6.2.6,让页面支持gzip:
在“LoadModule php5_module modules/libphp5.so”之后添加:
<IfModule mod_deflate.c>
DeflateCompressionLevel 6
AddOutputFilterByType DEFLATE text/html text/plain text/xml application/x-httpd-php
AddOutputFilter DEFLATE css js
</IfModule>