一.原理
LAMP 指的Linux(操作系统) ApacheHTTP 服务器, MySQL(数据库软件) 和PHP(有时也是指Perl或 Python) 的第一个字母,一般用来建立的web 服务器。
软件组件 LinuxLinux 是免费开源软件,这意味着源代码可用的操作系统。
Apache
Apache 是使用中最受欢迎的一个开放源码的WEB服务器软件。
MySQL
MySQL 是多线程、多用户的SQL数据库管理系统。
MySQL 已拥有由Oracle公司自 2010 年 1 月 27 日通过SUN 购买。SUN 最初于 2008 年 2 月 26 日收购 MySQL。
PHP,Perl 或 Python
PHP 是一种编程语言最初设计生产动态网站。PHP 是主要用于服务器端的应用程序软件。Perl 和 Python 类似。
二.案例
安装mysql
1.解压
[[email protected] ~]# tar -zxvf mysql-5.5.15-linux2.6-i686.tar.gz -C /usr/local/
2.切换目录
[[email protected] local]# cd mysql-5.5.15-linux2.6-i686/
3.查看安装说明
[[email protected] mysql-5.5.15-linux2.6-i686]# less INSTALL-BINARY
4.按步骤安装mysql
[[email protected] mysql]# groupadd mysql
[[email protected] mysql]# useradd -r -g mysql mysql
[[email protected] mysql]# cd /usr/local
[[email protected] local]# cd mysql
[[email protected] mysql]# chown -R mysql .
[[email protected] mysql]# chgrp -R mysql .
[[email protected] mysql]# scripts/mysql_install_db --user=mysql
[[email protected] mysql]# chown -R root .
[[email protected] mysql]# chown -R mysql data
[[email protected] mysql]# cp support-files/my-medium.cnf /etc/my.cnf
[[email protected] mysql]# bin/mysqld_safe --user=mysql &
5.
[[email protected] mysql]# cp support-files/mysql.server /etc/init.d/mysqld
6.
[[email protected] mysql]# chkconfig --add mysqld
[[email protected] mysql]# chkconfig mysqld on
7.链接库文件
[[email protected] mysql]# cd /etc/ld.so.conf.d/
[[email protected] ld.so.conf.d]# vim mysql.conf
8.链接头文件
安装http
1.解压
[[email protected] ~]# tar -jxvf httpd-2.2.19.tar.bz2 -C /usr/local/src/
2.检测执行./configure
[[email protected] httpd-2.2.19]# ./configure --prefix=/usr/local/apache --sysconfdir=/etc/httpd --enable-so --enable-ssl enable-track-vars --with-z
3.编译
[[email protected] httpd-2.2.19]# make
4.安装
[[email protected] httpd-2.2.19]# make install
5.启动
[[email protected] src]# /usr/local/apache/bin/apachectl start
6.链接库文件
[[email protected] apache]# vim /etc/ld.so.conf.d/httpd.conf
7.链接头文件
[[email protected] include]# ln -s /usr/local/apache/include apache
安装php
1.解压
[[email protected] ~]# tar -jxvf php-5.3.7.tar.bz2 -C /usr/local/src/
2.检测执行./configure
[[email protected] php-5.3.7]#
./configure --prefix=/usr/local/php --with-apxs2=/usr/local/apache/bin/apxs --with-mysql=/usr/local/mysql --with-mysqli=/usr/local/mysql/bin/mysql_config --enable-mbstring=all
3.编译
[[email protected] php-5.3.7]# make
4.安装
[[email protected] php-5.3.7]# make install
5.测试apache
6.编辑一个php文件测试
7.成功访问
转载于:https://blog.51cto.com/269144332/975523