在Linux下快速搭建LAMP开发平台.doc
生活随笔
收集整理的這篇文章主要介紹了
在Linux下快速搭建LAMP开发平台.doc
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
1.安裝環境
操作系統:Red Hat Linux Enterprise AS 4.0 update4
數據庫:MySQL 5.0.27
Web服務器:Apache 2.2.4
腳本語言:PHP 5.2.1<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /> 2.安裝MySQL 5.0.27
下載軟件包mysql-5.0.27.tar.gz后執行如下命令:
# tar zvxf mysql-5.0.27.tar.gz //解壓縮
# cd mysql-5.0.27 //進入解壓縮后的文件目錄
# ./configure --prefix=/usr/local/mysql //設定安裝目錄
--enable-thread-safe-client //編譯線程安全版的客戶端庫
--without-debug //關閉debug功能
--localstatedir=/data/mysqldata //設定數據庫文件目錄
# make //編譯
# make install //安裝
# /usr/local/mysql/bin/mysql_install_db //初始化授權
# chown –R root:root /usr/local/mysql //文件屬性改為root用戶
# cp /usr/local/mysql/share/mysql/my-medium.cnf /etc/my.cnf //復制配置文件
----------------------------------啟動MySQL服務----------------------------------
# /usr/local/mysql/bin/mysqld_safe --user=root & //啟動MySQL
----------------------------------修改MySQL密碼----------------------------------
# /usr/local/mysql/bin/mysqladmin -uroot password mysqlsecret //修改密碼
----------------------------------關閉MySQL服務----------------------------------
# /usr/local/mysql/bin/mysqladmin -uroot -pmysqlsecret shutdown //關閉MySQL 3.安裝Apache 2.2.4
下載軟件包httpd-2.2.4.tar.gz,后執行如下命令
# tar zvxf httpd-2.2.4.tar.gz
# cd httpd-2.2.4
# ./configure --prefix=/usr/local/apache
--enable-module=most
--enable-shared=max
# make
# make install
----------------------------------啟動Apache服務----------------------------------
# /usr/local/apache/bin/apachectl start
----------------------------------關閉Apache服務----------------------------------
# /usr/local/apache/bin/apachectl stop
----------------------------------重啟Apache服務----------------------------------
# /usr/local/apache/bin/apachectl restart 4.安裝PHP 5.2.1
下載軟件包php-5.2.1.tar.gz后執行如下命令
# tar zvxf php-5.2.1.tar.gz
# cd php-5.2.1
# ./configure --prefix=/usr/local/php
--with-mysqld=/usr/local/mysql
--with-apxs2=/usr/local/apache/bin/apxs
# make
# make install
# cp php.ini-dist /usr/local/php/lib/php.ini 5.配置Apache服務的httpd.conf文件
*在LoadModule處添加 LoadModule php5_module module/libphp5.so
*在DirectoryIndex處添加 index.php
*在AddType application處添加
AddType application/x-httpd-php .php .phtml
AddType applicatoin/x-httpd-php-source .phps
操作系統:Red Hat Linux Enterprise AS 4.0 update4
數據庫:MySQL 5.0.27
Web服務器:Apache 2.2.4
腳本語言:PHP 5.2.1<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /> 2.安裝MySQL 5.0.27
下載軟件包mysql-5.0.27.tar.gz后執行如下命令:
# tar zvxf mysql-5.0.27.tar.gz //解壓縮
# cd mysql-5.0.27 //進入解壓縮后的文件目錄
# ./configure --prefix=/usr/local/mysql //設定安裝目錄
--enable-thread-safe-client //編譯線程安全版的客戶端庫
--without-debug //關閉debug功能
--localstatedir=/data/mysqldata //設定數據庫文件目錄
# make //編譯
# make install //安裝
# /usr/local/mysql/bin/mysql_install_db //初始化授權
# chown –R root:root /usr/local/mysql //文件屬性改為root用戶
# cp /usr/local/mysql/share/mysql/my-medium.cnf /etc/my.cnf //復制配置文件
----------------------------------啟動MySQL服務----------------------------------
# /usr/local/mysql/bin/mysqld_safe --user=root & //啟動MySQL
----------------------------------修改MySQL密碼----------------------------------
# /usr/local/mysql/bin/mysqladmin -uroot password mysqlsecret //修改密碼
----------------------------------關閉MySQL服務----------------------------------
# /usr/local/mysql/bin/mysqladmin -uroot -pmysqlsecret shutdown //關閉MySQL 3.安裝Apache 2.2.4
下載軟件包httpd-2.2.4.tar.gz,后執行如下命令
# tar zvxf httpd-2.2.4.tar.gz
# cd httpd-2.2.4
# ./configure --prefix=/usr/local/apache
--enable-module=most
--enable-shared=max
# make
# make install
----------------------------------啟動Apache服務----------------------------------
# /usr/local/apache/bin/apachectl start
----------------------------------關閉Apache服務----------------------------------
# /usr/local/apache/bin/apachectl stop
----------------------------------重啟Apache服務----------------------------------
# /usr/local/apache/bin/apachectl restart 4.安裝PHP 5.2.1
下載軟件包php-5.2.1.tar.gz后執行如下命令
# tar zvxf php-5.2.1.tar.gz
# cd php-5.2.1
# ./configure --prefix=/usr/local/php
--with-mysqld=/usr/local/mysql
--with-apxs2=/usr/local/apache/bin/apxs
# make
# make install
# cp php.ini-dist /usr/local/php/lib/php.ini 5.配置Apache服務的httpd.conf文件
*在LoadModule處添加 LoadModule php5_module module/libphp5.so
*在DirectoryIndex處添加 index.php
*在AddType application處添加
AddType application/x-httpd-php .php .phtml
AddType applicatoin/x-httpd-php-source .phps
?
轉載于:https://blog.51cto.com/zhgcn/259155
總結
以上是生活随笔為你收集整理的在Linux下快速搭建LAMP开发平台.doc的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: linux构建主从域名服务器
- 下一篇: 我的QTP 9.5装不上去:a prev