首页 > 代码库 > Lamp源码搭建
Lamp源码搭建
Lamp
Centos6.5 + Apache/2.2.29 + PHP 5.3.29 + Mysql5.6.20
Apache(/usr/local/apache)
PHP(/usr/local/bin/php)
Mysql(/usr/local/mysql)
Apache cat /usr/local/apache/build/config.nice
./configure --prefix=/usr/local/apache --enable-so --enable-modules=all --enable-mods-shared=all
make && make install
--enable-so 动态共享对象
Mysql(mysql-advanced-5.6.20-linux-glibc2.5-x86_64)(二进制包安装)
groupadd mysql
cd /usr/local
ln -s mysql-advanced-5.6.20-linux-glibc2.5-x86_64 mysql
cp mysql-advanced*/support-files/my-default.cnf /etc/my.cnf
cp mysql-advanced*/support-files/mysql.server /etc/init.d/mysqld
chmod 755 /etc/init.d/mysqld
cd mysql
chown -R mysql:mysql .
scripts/mysql_install_db --user=mysql
chown -R root .
chown -R mysql data
bin/mysqld_safe --user=mysql &
Php
./configure --with-apxs2=/usr/local/apache/bin/apxs --with-mysql=/usr/local/mysql
make && make install
cp php.ini-production /usr/local/lib/php.ini
vim /usr/local/apache/conf/httpd.conf
AddType application/x-httpd-php .php
#检查apache是否有php模块
apachectl -M | grep php
#检查php中是否有mysql模块
php -i | grep mysql
#查看此lamp架构中的各个模块(ip 192.168.1.2)
192.168.1.2/phpinfo.php
Lamp源码搭建