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

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 运维知识 > 数据库 >内容正文

数据库

我的LAMP源码编译安装linux+Apache+mysql+php

發布時間:2025/3/15 数据库 19 豆豆
生活随笔 收集整理的這篇文章主要介紹了 我的LAMP源码编译安装linux+Apache+mysql+php 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

httpd-2.2.17.tar.gz

mysql-5.1.51.tar.gz

php-5.2.17.tar.gz

mysql的安裝

#安裝需要的庫
yum -y install ncurses ncurses-devel

#
創建MySQL用戶及用戶組
groupadd mysql
useradd -g mysql -s /sbin/nologin mysql

cp /home/root/mysql-5.1.41.tar.gz /usr/local/src
cd /usr/local/src
tar zxvf mysql-5.1.41.tar.gz
chown -R mysql:mysql mysql-5.1.41
cd mysql-5.1.41
./configure \
--prefix=/usr/local/mysql \
--localstatedir=/usr/local/mysql/data \
--with-unix-socket-path=/usr/local/mysql/data/mysql.sock \
--with-plugins=innobase,partition,myisam,heap \
--enable-assembler \
--with-charset=utf8 \
--enable-thread-safe-client \
--with-client-ldflags=-all-static \
--with-mysqld-ldflags=-all-static \
--enable-static=yes \
--with-big-tables

make
make install



-------------------------
#
根據應用程序的負載選擇對應的配置文件
mkdir /usr/local/mysql/etc
cp /usr/local/mysql/share/mysql/my-medium.cnf /usr/local/mysql/etc/my.cnf
vi /usr/local/mysql/etc/my.cnf

#
[mysqld]中添加:
pid-file = /usr/local/mysql/etc/mysql.pid
datadir = /usr/local/mysql/data
#
設置pid位置及數據存放位

chown -R mysql:mysql /usr/local/mysql
--------------------------
#
安裝系統表
/usr/local/mysql/bin/mysql_install_db \
--basedir=/usr/local/mysql \
--defaults-file=/usr/local/mysql/etc/my.cnf \
--skip-external-locking \
--user=mysql

#
啟動MySQL
/usr/local/mysql/bin/mysqld_safe \
--defaults-file=/usr/local/mysql/etc/my.cnf \
--user=mysql &
--------------------------
#
MySQL添加到系統服務
cp /usr/local/mysql/share/mysql/mysql.server /etc/init.d/mysqld
chmod 700 /etc/init.d/mysqld
chkconfig --add mysqld


Apache的安裝

#安裝需要的庫
yum -y install zlib-devel

cp /home/root/httpd-2.2.17.tar.gz /usr/local/src
cd /usr/local/src
tar xzvf httpd-2.2.17.tar.gz

./configure --prefix=/usr/local/apache2 --enable-so --enable-threads--with-mpm=worker --enable-cache --enable-rewrite=shared -enable-deflate=shared--enable-expires=shared

make
make install
-----------------------------
#
啟動apache
/usr/local/apache2/bin/apachectl start
#
若出現noticehttpd: Could notreliably determine the server's fully qualified domain name, using 127.0.0.1for ServerName
vi /usr/local/apache2/conf/httpd.conf
修改ServerName那行為:ServerNamelocalhost:80
/usr/local/apache2/bin/apachectl restart




php的安裝

?#先安裝需要的庫
?#yum -y install libxml2
?#yum -y install libxml2-devel
?#yum -y install gd
?#yum -y install gd-devel
?#yum -y install curl curl-devel
?#yum -y install libjpeg libjpeg-devellibpng libpng-devel
?#yum -y install freetypefreetype-devel
?#yum -y install openldap
?#yum -y install openldap-devel
?#
?#cp /home/root/php-5.2.17.tar.gz/usr/local/src
?#cd /usr/local/src
?#tar xzvf php-5.2.17.tar.gz
?#
?#./configure --prefix=/usr/local/php5\
?#--with-mysql=/usr/local/mysql \
?#--with-apxs2=/usr/local/apache2/bin/apxs\
?#--with-libxml-dir=/usr/local/lib\
?#--with-gd \
?#--with-jpeg-dir=/usr/local/jpeg6\
?#--with-zlib \
?#--with-curl \
?#--with-ldap \
?#--with-gettext \
?#--with-iconv \
?#--enable-mbstring \
?#--enable-soap \
?#--with-png-dir=/usr/local/libpng2\
?#--with-freetype-dir=/usr/local/freetype\
?#--with-xmlrpc \
?#--with-config-file-path=/usr/local/php5/etc
?#
?#make
?#make install
?#
?#cp /usr/local/src/php.ini-dist/usr/local/php5/etc/php.ini
?


#
配置
#vi /usr/local/apache2/conf/httpd.conf
#DirectoryIndex index.html
后增加index.php
#DirectoryIndex index.html index.php
#
##<IfModule mime_module>
中增加:
#AddType application/x-httpd-php .php .phtml
#AddType application/x-httpd-php-source .phps
#
#/usr/local/apache2/bin/apachectl restart
##
若遇到錯誤如:/usr/local/apache2/modules/libphp5.so: cannotrestore segment prot after reloc: Permission denied
##
解決辦法:
#setenforce 0
#chcon -c -v -R -u system_u -r object_r -t textrel_shlib_t/usr/local/apache2/modules/libphp5.so
#/usr/local/apache2/bin/apachectl restart
#setenforce 1
#/usr/local/apache2/bin/apachectl restart
?



總結

以上是生活随笔為你收集整理的我的LAMP源码编译安装linux+Apache+mysql+php的全部內容,希望文章能夠幫你解決所遇到的問題。

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