说明:
make根据makefile制定的规则,将c/c++文件编译成*.o文件,然后进一步生成可执行文件。
make clean删除源代码(C/C++ code)生成的执行文件和所有的中间目标文件
ps avx|grep mysql 进程
rm -rf php-5.2.1 删除
ln -sf mysql.client.6.sock mysql.server.6.sock
./mysqldump -uroot -p --database sbzy 看数据库
./mysqldump -uroot -p --database sbzy >back.sql 倒出
===============================================================================================================================
=====安装apache
===============================================================================================================================
配置--prefix=/zy/apache2安装路径 --enable-so激活dso --enable-modules=all激活所有模块 --enable-rewrite激活rewrite
cd /root/httpd-2.0.59
./configure --prefix=/zy/apache2 --enable-so --enable-modules=all --enable-rewrite
make clean
make
make install
启动
bin/apachectl
配置
conf/httpd.conf
Listen 9999 ------监听端口
<Directory "/zy/webroot"> ------rewrite目录
AllowOverride All ------允许rewrite ,no
</Directory>
NameVirtualHost *:9999 ------虚拟站点
<VirtualHost *:9999> ------配置虚拟站点
ServerAdmin webmaster@dummy-host.example.com
DocumentRoot /zy/webroot/
ServerName www.zy.com
ErrorLog logs/dummy-host.example.com-error_log
CustomLog logs/dummy-host.example.com-access_log common
</VirtualHost>
rewrite规则文件
cd /zy/webroot/
vi ./.htaccess
RewriteEngine On
RewriteRule ^list-([0-9a-zA-Z]+)-([0-9a-zA-Z]+)/.html$ list.php?pn=$1&ap=$2
RewriteRule ^listall-([0-9a-zA-Z]+)/.html$ listall.php?pn=$1
RewriteRule ^listall-([0-9a-zA-Z]+)-([0-9a-zA-Z]+)/.html$ listall.php?pn=$1&deal=$2
RewriteRule ^detail-([0-9a-zA-Z]+)/.html$ detail.php?houseid=$1
RewriteRule ^test-([0-9a-zA-Z]+)/.html$ test.php?id=$1
===============================================================================================================================
=====安装mysql
===============================================================================================================================
配置
cd /root/mysql-5.0.37
./configure --prefix=/zy/mysql-5.0.37 --with-extra-charsets=all --with-charset=gbk --with-pthread --enable-thread-safe-client --with-innodb --with-tcp-
port=6666
make clean
make
make install
初试化表并且规定用mysql用户来访问。初始化表以后就开始给mysql和root用户设定访问权限
./scripts/mysql_install_db --user=mysql
改权限
chown -R mysql:mysql /zy/mysql-5.0.37/var
chown -R mysql:mysql /zy/mysql-5.0.37
hmod 755 /zy/mysql-5.0.37
启动
bin/mysqld_safe --user=mysql &
改密码
bin/mysqladmin -u root -p password '1'
配置文件
通用配置在/etc/my.cnf
删除/etc/my.cnf复制到在/安装目录/etc/my.cnf为每个mysql单独配置
server-id = 6
[mysqld]
port = 6666
socket = /zy/mysql-5.0.37/tmp/mysql.sock
./mysqldump -uroot -p --database sbzy >back.sql 查看数据库 倒出
./mysqladmin shutdown 关闭
===============================================================================================================================
=====下面安装PHP扩展模块
===============================================================================================================================
安装libxml
cd libxml2-2.6.27
./configure --prefix=/zy/libxml2
make clean
make
make install
安装freetype
cd freetype-2.3.5
./configure --prefix=/zy/freetype
make clean
make
make install
cp /zy/freetype/include/freetype2/freetype/*.h /usr/local/include/
安装libpng
cd libpng-1.2.18
/configure --prefix=/zy/libpng
make clean
make
make install
安装jpeg-6b
cd jpeg-6b
mkdir /zy/jpeg
mkdir -p /zy/jpeg/bin
mkdir -p /zy/jpeg/man/man1/
mkdir /zy/jpeg/include
mkdir /zy/jpeg/lib
./configure --prefix=/zy/jpeg --enable-shared
make clean
make
make install
安装zlib
cd zlib-1.2.3
./configure --prefix = /zy/zlib
make clean
make
make install
===============================================================================================================================
=====安装PHP
===============================================================================================================================
cd php-5.2.1
./configure --prefix=/zy/php-5.2.1 --with-apxs2=/zy/apache2/bin/apxs --with-libxml-dir=/zy/libxml2 --with-freetype-dir=/zy/freetype --with-jpeg-
dir=/zy/jpeg --with-png-dir=/zy/libpng --with-zlib=/zy/zlib --with-mysql=/zy/mysql-5.0.37 --enable-mbstring --enable-sockets --with-gd --enable-gd-
native-ttf
make clean
make
make install
使apache支持php 在apache/conf/httpd.conf中加
AddType application/x-compress .Z
AddType application/x-gzip .gz .tgz
AddType application/x-httpd-php .php
AddType application/x-httpd-php .html
make根据makefile制定的规则,将c/c++文件编译成*.o文件,然后进一步生成可执行文件。
make clean删除源代码(C/C++ code)生成的执行文件和所有的中间目标文件
ps avx|grep mysql 进程
rm -rf php-5.2.1 删除
ln -sf mysql.client.6.sock mysql.server.6.sock
./mysqldump -uroot -p --database sbzy 看数据库
./mysqldump -uroot -p --database sbzy >back.sql 倒出
===============================================================================================================================
=====安装apache
===============================================================================================================================
配置--prefix=/zy/apache2安装路径 --enable-so激活dso --enable-modules=all激活所有模块 --enable-rewrite激活rewrite
cd /root/httpd-2.0.59
./configure --prefix=/zy/apache2 --enable-so --enable-modules=all --enable-rewrite
make clean
make
make install
启动
bin/apachectl
配置
conf/httpd.conf
Listen 9999 ------监听端口
<Directory "/zy/webroot"> ------rewrite目录
AllowOverride All ------允许rewrite ,no
</Directory>
NameVirtualHost *:9999 ------虚拟站点
<VirtualHost *:9999> ------配置虚拟站点
ServerAdmin webmaster@dummy-host.example.com
DocumentRoot /zy/webroot/
ServerName www.zy.com
ErrorLog logs/dummy-host.example.com-error_log
CustomLog logs/dummy-host.example.com-access_log common
</VirtualHost>
rewrite规则文件
cd /zy/webroot/
vi ./.htaccess
RewriteEngine On
RewriteRule ^list-([0-9a-zA-Z]+)-([0-9a-zA-Z]+)/.html$ list.php?pn=$1&ap=$2
RewriteRule ^listall-([0-9a-zA-Z]+)/.html$ listall.php?pn=$1
RewriteRule ^listall-([0-9a-zA-Z]+)-([0-9a-zA-Z]+)/.html$ listall.php?pn=$1&deal=$2
RewriteRule ^detail-([0-9a-zA-Z]+)/.html$ detail.php?houseid=$1
RewriteRule ^test-([0-9a-zA-Z]+)/.html$ test.php?id=$1
===============================================================================================================================
=====安装mysql
===============================================================================================================================
配置
cd /root/mysql-5.0.37
./configure --prefix=/zy/mysql-5.0.37 --with-extra-charsets=all --with-charset=gbk --with-pthread --enable-thread-safe-client --with-innodb --with-tcp-
port=6666
make clean
make
make install
初试化表并且规定用mysql用户来访问。初始化表以后就开始给mysql和root用户设定访问权限
./scripts/mysql_install_db --user=mysql
改权限
chown -R mysql:mysql /zy/mysql-5.0.37/var
chown -R mysql:mysql /zy/mysql-5.0.37
hmod 755 /zy/mysql-5.0.37
启动
bin/mysqld_safe --user=mysql &
改密码
bin/mysqladmin -u root -p password '1'
配置文件
通用配置在/etc/my.cnf
删除/etc/my.cnf复制到在/安装目录/etc/my.cnf为每个mysql单独配置
server-id = 6
[mysqld]
port = 6666
socket = /zy/mysql-5.0.37/tmp/mysql.sock
./mysqldump -uroot -p --database sbzy >back.sql 查看数据库 倒出
./mysqladmin shutdown 关闭
===============================================================================================================================
=====下面安装PHP扩展模块
===============================================================================================================================
安装libxml
cd libxml2-2.6.27
./configure --prefix=/zy/libxml2
make clean
make
make install
安装freetype
cd freetype-2.3.5
./configure --prefix=/zy/freetype
make clean
make
make install
cp /zy/freetype/include/freetype2/freetype/*.h /usr/local/include/
安装libpng
cd libpng-1.2.18
/configure --prefix=/zy/libpng
make clean
make
make install
安装jpeg-6b
cd jpeg-6b
mkdir /zy/jpeg
mkdir -p /zy/jpeg/bin
mkdir -p /zy/jpeg/man/man1/
mkdir /zy/jpeg/include
mkdir /zy/jpeg/lib
./configure --prefix=/zy/jpeg --enable-shared
make clean
make
make install
安装zlib
cd zlib-1.2.3
./configure --prefix = /zy/zlib
make clean
make
make install
===============================================================================================================================
=====安装PHP
===============================================================================================================================
cd php-5.2.1
./configure --prefix=/zy/php-5.2.1 --with-apxs2=/zy/apache2/bin/apxs --with-libxml-dir=/zy/libxml2 --with-freetype-dir=/zy/freetype --with-jpeg-
dir=/zy/jpeg --with-png-dir=/zy/libpng --with-zlib=/zy/zlib --with-mysql=/zy/mysql-5.0.37 --enable-mbstring --enable-sockets --with-gd --enable-gd-
native-ttf
make clean
make
make install
使apache支持php 在apache/conf/httpd.conf中加
AddType application/x-compress .Z
AddType application/x-gzip .gz .tgz
AddType application/x-httpd-php .php
AddType application/x-httpd-php .html