分类: LINUX
2008-05-29 11:29:53
1、apache的安装
./configure --prefix=/usr/local/apache --enable-ssl --enable-cgi --enable-mods-shared=all --with-mysql=/usr/local/mysql5022/ --with-ssl=/usr/local/openssl/ --enable-track-vars --enable-rewrite
make
make install
{添加ssl模块
./configure --prefix=/usr/local/apache --enable-ssl=shared --with-ssl=/usr/local/openssl
make install
cd modules/ssl
apxs -i -a -c mod_ssl.c
使用apachectl start 的时候,会出现 module auth_basic_module is built-in and can't be loaded
将相应的模块给屏蔽掉就好了.}
需要的软件可以到chinaunix下载
3、php的安装
(1)安装zlib
./configure;make;make install
(2)安装freetype
./configure --prefix=path;make;make install
(3)安装libpng
到安装目录 cp scripts/makefile.std makefile
make test
make install
(4)安装jpeg
./configure --prefix=/usr/local/jpeg --enable-shared --enable-static
make ; make insall
如果make install 的时候出现不能创建文件夹,则自己手工创建
(5)安装gd
./configure --prefix=path --with-jpeg=path --with-png --with-zlib --with-freetype=path
make
make install
(6)安装php
/configure --prefix=/usr/local/php --with-gd=path --with-jpeg-dir=path --with-zlib --with-png-dir --with-freetype-dir=path --enable-magic-quotes --with-mysql=path --with-iconv --enable-mbstring --with-apxs2=path -enable-track-vars --enable-force-cgi-redirect --enable-ftp --with-config-file-path=/usr/local/php/etc --with-mcrypt=对应libmcrypt的安装路径,没有指定prefix的情况下默认为/usr/local
一点说明:
--prefix=/usr/local/php 指定把php-4.3.10安装到/usr/local/php目录中;
--with-mysql=/usr/local/mysql 指定mysql数据服务器安装的位置;
--with-apxs2=/usr/local/apache/bin/apxs 这是加入apache中为DSO模块的位置;
-enable-track-vars 为启动cookie的get/post等追踪功能
--with-config-file-path=/usr/local/php/etc 指定php的配制文件存放的目录是/usr/local/php/etc目录,我们安装完成后,也要把php.ini复制到这个目录中来
make
make install
cp php.ini-dist /usr/local/php/etc/php.ini
更改apache的配制文件:得加几行,目的是让apache能解释php程序。
查找AddType application/x-tar .tgz 行,在下面添加
AddType application/x-httpd-php .php
AddType application/x-httpd-php .php3
AddType application/x-httpd-php .phtml
AddType application/x-httpd-php-source .phps
找到下面一行在后面加上index.php,这表示网站的默认页也能够为index.php
DirectoryIndex index.html index.html.var index.php
进行php.ini文件的配置工作
查找safe_mode=Off,更改为safe_mode=On
1)查找max_execution_time = 30,更改为max_execution_time = 600
(2)查找max_input_time = 60,更改为max_input_time = 600
(3)查找memory_limit = 8M ,更改为memory_limit = 20M
(4)查找display_errors = On,更改为display_errors = Off
(5)查找register_globals = Off,更改为register_globals = On
(6)查找post_max_size = 8M,更改为post_max_size = 20M
(7)查找upload_max_filesize = 2M,更改为upload_max_filesize = 20M
(8)查找session.auto_start = 0,更改为session.auto_start = 1
保存后退出,从而完成了php.ini文件的配置工作。
4、安装mysql
groupadd -g 3306 mysql
useradd -g 3306 -u 3306 -m mysql
./configure --prefix=mysqlpath --with-charset=gbk
rm -f /usr/bin/mysql*
rm -f /etc/my.cnf
cp support-files/my-medium.cnf /etc/my.cnf
chown -R mysql:root *
/mysqlpath/bin/mysql_install_db --user=mysql
/mysqlpath/bin/mysqld_safe --user=mysql &
vi /etc/profile
PATH=/mysqlpath/bin:$PATH
export PATH