linux 5.2i386
APACHE httpd-2.2.16.tar
MYSQL mysql-5.1.50.tar.gz
PHP php-5.3.3-nts-Win32-VC9-x86.zip
还需要libmcrypt-2.5.7.tar.gz
libxml2-2.7.4.tar.gz
一、安装apache2
进入目录
tar -zvxf httpd-2.2.16.tar
解压httpd-2.2.0.tar.gz
# cd httpd-2.2.16
进入httpd-2.2.16目录
# mkdir -p /usr/local/apache2
生成/usr/local/apache2目录
# ./configure --prefix=/usr/local/apache2
或者# ./configure --prefix=/usr/local/apache2 --enable-modules=so --enable-rewrite
# make; make install
安装apache
配置apache# vi /usr/local/apache/conf/httpd.conf
--prefix=/usr/local/mysql5 ### 数据库安装目录
--localstatedir=/var/lib/mysql5 ### 数据库存放目录
--with-charset=gbk --with-collation=gbk_chinese_ci --with-extra-charsets=all
make
cd /usr/local/mysql
./scripts/mysql_install_db --user=mysql###写入数据
控制台打印出:
Installing MySQL system tables...
OK
Filling help tables...
OK
.....
即说明安装成功。
chown -R root:mysql . //设置权限,注意后面有一个 "."
chown -R mysql /usr/local/mysql //设置 mysql 目录权限
chgrp -R mysql . //注意后面有一个 "."
cp share/mysql/my-huge.cnf /etc/my.cnf或者 cp share/mysql/my-medium.cnf /etc/my.cnf
cp share/mysql/mysql.server /etc/rc.d/init.d/mysql //开机自动启动 mysql。
chmod 755 /etc/rc.d/init.d/mysql5
chkconfig --add mysql
启动mysql
/usr/local/mysql/bin/mysqld_safe --user=mysql &
远程登录mysql
grant all on *.* to user_name@ '%' identified by 'user_password' ;