日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

利用源代码包搭建LAMP

發布時間:2025/5/22 编程问答 15 豆豆
生活随笔 收集整理的這篇文章主要介紹了 利用源代码包搭建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的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。