LAMP安装配置

来源:互联网 发布:淘宝无印良品是真是假 编辑:程序博客网 时间:2024/05/16 01:07

安装mysql
 ./configure --localstatedir=/var/www/mysql
 make
 make install

 #添加用户组mysql
 groupadd mysql

 #添加用户mysql到用户组mysql下
 useradd -g mysql mysql

 #初始化数据库
 ./scripts/mysql_install_db --user=mysql

 #为root添加新的密码newpassword
 /usr/local/bin/mysqladmin -u root password "newpassword"
安装httpd
 ./configure  --enable-so --enable-mods-shared=most --enable-rewrite 
 make
 make install
 cp /usr/local/apache2/bin/apachect1 /etc/rc.d/init.d/httpd
安装php
 1 安装zlib
 ./configure
 make
 make install
 2 安装gd
 ./configure --with-zlib
 make
 make install
 3 安装php
 ./configure --with-apxs2=/usr/local/apache1/bin/apxs --with-mysql=/usr/local/bin/mysql --with-gd --with-zlib --enable-mbstring
 make
 make install
整合php与apache
 cp php.ini-dist /usr/local/php/lib/php.ini
 在/usr/local/apache2/conf/http.conf中添加以下两行
 LoadModule php5_module modules/libphp5.so
 AddType application/x-httpd-php .php

原创粉丝点击