1.sudo apt-get install g++
ln -sf /usr/bin/make /usr/bin/gmake
wget http://ftp.gnu.org/pub/gnu/ncurses/ncurses-5.6.tar.gz
tar zxvf ncurses-5.6.tar.gz
cd ncurses-5.6
./configure –prefix=/usr/local/mysql –with-shared –without-debug
make
make install clean
shell> groupadd mysql
shell> useradd -g mysql mysql
shell> gunzip < mysql-VERSION.tar.gz | tar -xvf -
shell> cd mysql-VERSION
shell> ./configure --prefix=/usr/local/mysql --with-charset=utf8 --with-extra-charsets=all
shell> make WITH_CHARSET=utf8 WITH_XCHARSET=all
shell> make install
shell> cp support-files/my-medium.cnf /etc/my.cnf
shell> cd /usr/local/mysql
shell> bin/mysql_install_db --user=mysql
shell> chown -R root .
shell> chown -R mysql var
shell> chgrp -R mysql .
shell>sudo chown -R 777 var
shell> bin/mysqld_safe --user=mysql &
shell>sudo share/mysql/mysql.server start --user=root
#cp share/mysql/mysql.server /etc/rc.d/init.d/mysqld /
shell>cp share/mysql/mysql.server /etc/rc.d/init.d/mysqld //开机自动启动 mysql。
卸载:make uninstall
三、安装php, gd, zlib,phpadmin 库
shell>sudo wget http://www.libgd.org/releases/gd-2.0.35.tar.gz
shell> tar -zxvf gd-2.0.35.tar.gz
shell>cd gd-2.0.35/
shell> ./configure --prefix=/usr/local/gd2
shell>make
shell>make install
shell>cd ..
shell>sudo wget http://www.zlib.net/zlib-1.2.3.tar.gz
shell>sudo tar -zxvf zlib-1.2.3.tar.gz
shell>cd zlib-1.2.3/
shell>sudo ./configure --prefix=/usr/local/zlib
shell>sudo make
shell>sudo make install
shell>sudo apt-get install libxml2-dev
shell>cd ../php-xxx
shell>sudo make clean
shell> sudo ./configure --prefix=/usr/local/php5 --with-mysql=/usr/local/mysql --with-apxs2=/usr/local/apache2/bin/apxs --with-gd=/usr/local/gd2 --with-zlib-dir=/usr/local/zlib --enable-socket
shell>sudo make
shell>sudo make install
shell> sudo cp php.ini-dist /usr/local/lib/php.ini
shell>sudo vi /usr/local/apache2/conf/httpd.conf
完成这步以後,查找这两行,把前面的#去掉(AddType text/html .shtml AddOutputFilter,AddOutputFilter INCLUDES .shtml).在#AddType application/x-gzip .tgz的后面加上AddType application/x-httpd-php .php
# sudo apt-get install libmysqlclient15-dev
shell>sudo /usr/local/apache2/bin/apachectl start
shell>sudo vi /usr/local/apache2/htdocs/test.php
输入<?php phpinfo();?>
shell>cd /usr/local/apache2/htdocs/
shell>sudo wget http://prdownloads.sourceforge.net/phpmyadmin/phpMyAdmin-3.0.1.1-all-languages.tar.gz?download
shell>sudo tar -zxvf phpMyAdmin-3.0.1.1-all-languages.tar.gz
shell> sudo mv phpMyAdmin-3.0.1.1-all-languages phpmyadmin
shell>
四、安装phpmyadmin
# cd /usr/local/apache2/htdocs/
# wget http://nchc.dl.sourceforge.net/sourc...-8-only.tar.gz
# tar zxvf phpMyAdmin-2.11.1-all-languages-utf-8-only.tar.gz
# mv phpMyAdmin-2.11.1-all-languages-utf-8-only phpmyadmin
# cd phpmyadmin/libraries
修改配置文件
# vi config.default.php
找到这几行进行修改:
$cfg['Servers'][$i]['auth_type'] = 'http'; // Authentication method (valid choices: config, http, HTTP, signon or cookie)
$cfg['Servers'][$i]['user'] = 'root'; // MySQL user
$cfg['Servers'][$i]['password'] = 'PASSWORD'; // MySQL password (only needed
经过这几个步骤,我们一个比较安全的LAMP服务器就环境基本建立成功啦。
五、其它命令
查看进程 :ps auxw
设置变量 :export
4.http://dev.mysql.com/doc/refman/5.1/zh/installing.html#installing-source
5.http://www.php.net/manual/zh/install.unix.php