利用源代码包搭建LAMP
????????
?
利用×××LAMP主要有以下三個步驟:???? 1.?./configure(腳本)--prefix(指明安裝路徑)--sysconfir(安裝完后配置腳本配置路徑)
???? 2.?Make?(編譯成二進制文件或模塊)
???? 3.?make?install
?
這些服務的源代碼我們可以試著在它的官網上下載
??? Apache (官網)www.apache.org Mysql (官網)www.mysql.com Php (官網) ?www.php.net 一、編譯安裝mysql ? [root@MueYing?~]#?cd?/home/ ?[root@MueYing?home]#?tar?-zxvf?mysql-5.5.15-linux2.6-i686.tar.gz?-C?/usr/local/
[root@MueYing?home]#?cd?/usr/local/
?[root@MueYing?local]#?ln?-s?mysql-5.5.15-linux2.6-i686?mysql
[root@MueYing?~]#?groupadd?-r?mysql? [root@MueYing?~]#?useradd?-r?-g?mysql?-s?/sbin/nologin?-M?mysql
?[root@MueYing?~]#?cd?/usr/local/mysql
?[root@MueYing?mysql]#?chown?-R?mysql:mysql?.? [root@MueYing?mysql]#?scripts/mysql_install_db?--user=mysql ?[root@MueYing?mysql]#?cp?support-files/my-medium.cnf?/etc/my.cnf
[root@MueYing?mysql]#?cp?support-files/mysql.server?/etc/init.d/mysqld? [root@MueYing?mysql]#?cd?/usr/include/
?[root@MueYing?include]#?ln?-s?/usr/local/mysql/include?mysql?
[root@MueYing?include]#?chkconfig?--list?|grep?mysqld
?mysqld?0:off?1:off?2:on?3:on?4:on?5:on?6:off
二、接著我們來安裝apache?
[root@MueYing?home]#?tar?-jxvf?httpd-2.2.19.tar.bz2?-C?/usr/src
[root@MueYing?httpd-2.2.19]#?./configure?--help?|less?
--prefix=安裝路徑
--sysconfdir=配置腳本存放位置
--enable-so?開啟dso(動態共享對象)
--with-z?使用zlib
--enable-ssl?加密
[root@MueYing?httpd-2.2.19]#?./configure?--prefix=/usr/local/apache?--sysconfdir=/etc/httpd?--enable-so?--with-z?--enable-ssl
[root@MueYing?apache]#?cd?/usr/src/httpd-2.2.19/?
[root@MueYing?httpd-2.2.19]#?less?INSTALL
?$?./configure?--prefix=PREFIX
?$?make
?$?make?install
?$?PREFIX/bin/apachectl?start?apache啟動方法
?
啟動apache
?[root@MueYing?httpd-2.2.19]#?cd?/usr/local/apache/?
[root@MueYing?apache]#?./bin/apachectl?start?
[root@MueYing?apache]#?netstat?-tupln?|grep?http?
tcp?0?0?:::80?:::*?LISTEN?19115/httpd
?[root@MueYing?apache]#?./bin/apachectl?stop?
?[root@MueYing?apache]#?netstat?-tupln?|grep?http
?[root@MueYing?apache]#?./bin/apachectl?start
?
三、php的源碼安裝? 嘗試使用php測試連接mysql
?[root@MueYing?~]#?cd?/usr/local/apache/htdocs/
[root@MueYing?htdocs]#?vim?index.php?
<html><body><h1>It?works!</h1></body></html>
?<?php
?$link=mysql_connect('127.0.0.1','root','');
?if?($link)
?echo?"connect?success!!!";
?else
?echo?"connect?failed!!!?"
??>
?
當關閉數據庫時再用客戶端測試:
[root@MueYing?htdocs]#?service?mysqld?stop
? 此時php便安裝成功了Lamp的源碼的搭建也坐完了,我們接著就可以做應用了
?
?????
?
??
轉載于:https://blog.51cto.com/fengiyu/811736
總結
以上是生活随笔為你收集整理的利用源代码包搭建LAMP的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 常用的压缩归档命令
- 下一篇: MD5SHA加密util类(Java)