all gone

all gone

#

RH9下安装apache2.x.x+php4.x.x+mysql3.x.x

******************************************************************************

先安装Mysql
******************************************************************************

shell> groupadd mysql
shell> useradd -g mysql mysql
shell> gunzip < mysql-VERSION.tar.gz | tar -xvf -
shell> cd mysql-VERSION
shell> ./configure --prefix=/usr/local/mysql
shell> make
shell> make install
shell> cp support-files/my-medium.cnf /etc/my.cnf
shell> cd /usr/local/mysql
shell> bin/mysql_install_db


shell> chown -R root .
shell> chown -R mysql var
shell> chgrp -R mysql .
shell> bin/mysqld_safe --user=mysql &

******************************************************************************

再安装PHP和apache
******************************************************************************

1. gzip -d httpd-2_0_NN.tar.gz
2. tar xvf httpd-2_0_NN.tar
3. gunzip php-NN.tar.gz
4. tar -xvf php-NN.tar
5. cd httpd-2_0_NN
6. ./configure --enable-so
7. make
8. make install
现在您已经将 Apache 2.0.NN 安装在 /usr/local/apache。本安装支持可装载模块
和标准的 MPM prefork。之后,可以使用如下命令启动 Apache 服务器:
/usr/local/apache2/bin/apachectl start
如果成功,您可以停止 Apache 服务器并继续安装 PHP:
/usr/local/apache2/bin/apachectl stop.
9. cd ../php4-NN


10. 现在我们需要配置 PHP。在这里您可以用各种各样的参数来自定义PHP,例如启动哪
些扩展功能包的支持等。用 ./configure --help 命令可以列出当前可用的所有参
数。在我们的例子中,我们将给出一个在有 MySQL 支持的 Apache 2 上进行配置的
范例。您本地的 apxs 的路径可能会不同,事实上,在您的系统中,它可能被命名为
apxs2。
./configure --with-apxs2=/usr/local/apache2/bin/apxs
11. make
12. make install
如果您决定在安装后改变配置选项,您只需重复最后的三步,然后需要重新启动
Apache 使新模块生效。无需重新编译。
请注意,除非明确有提示,否则 'make install' 命令将安装 PEAR、各种 PHP 工具
诸如 phpize,安装 PHP CLI 等等。
13. 配置 php.ini
cp php.ini-dist /usr/local/lib/php.ini
您可以编辑 php.ini 文件以修改 PHP 的选项。如果您想要把此文件放到另外的位置,
您需要在步骤 10 添加 --with-config-file-path=/path 选项。
如果您选择 php.ini -recommended,请务必阅读其中的变更的列表,它们将影响
PHP 的执行。
14. 编辑 httpd.conf 文件以调用 PHP 模块。LoadMolude 表达式右边的路径必须指向您

系统中的 PHP。以上的 make install 命令可能已经帮您完成了这些,但务必要检查。
对于 PHP 4:
LoadModule php4_module modules/libphp4.so


对于 PHP 5:
LoadModule php5_module modules/libphp5.so
15. 告知 Apache 将特定的扩展名解析成 PHP,例如,我们让 Apache 将扩展名 .php
解析成 PHP。您可以将任何扩展名指定为 PHP,只需添加它们,每一个用空格分隔。
例如,我们要添加 .phtml:
AddType application/x-httpd-php .php .phtml
通常,我们还将 .phps 扩展名设置成显示高亮的 PHP 源文件,可以这样来完成:
AddType application/x-httpd-php-source .phps
16. 启动您的 Apache 服务器:
/usr/local/apache2/bin/apachectl start

按照上面的步骤您便可以使 Apache 2.0 将 PHP 作为 SAPI 模块了。当然 Apache 和
PHP 都还有很多配置选项,您可以在相应的源代码目录中使用 ./configure --help 获得

更多信息。假如您要编译一个多线程版本的 Apache 2.0,您必须覆盖标准的
MPM-Module
prefork,或者 worker 或者 perchild。要这样,您需要在上面的第 6 步使用
--with-mpm=worker 或者 --with-mpm=perchild 选项。之前您需要了解您正在做什么。

多信息请参考 Apache 文档中关于 MPM-Modules 的部分。

posted @ 2005-12-09 19:23 all gone 阅读(233) | 评论 (0)编辑 收藏

Linux下编写OpenGL程序的一些准备工作

linux下编写OpenGL程序的一些准备工作

需要用到的软件包有两个,glut 和tmake,分别可以从以下两个网址下载:
http://www.opengl.org/resources/libraries/glut/glut-3.7.tar.gz
ftp://ftp.trolltech.com/freebies/tmake/tmake-1.8.tar.gz

下载后的文件假设都放在/usr/src中

首先是安装glut库,以下是从www.linux.com找到的编译glut库的手册。

Install GLUT 3.7 Distribution (optional)

If you installed the MesaDemos/MesaLib package, then you have already installed GLUT 3.7 since it is included with MesaDemos. However, you may be interested in installing the GLUT

manpages and you can skip right to the "Install GLUT manual pages", below ...

Installing GLUT is a bit tricky. I'm not too familiar with imake, the program that it uses to manage the Makefiles, and didn't quite see how to get GLUT to install to where I wanted it (/usr/lib,

but MesaDemos will do this without any trouble though). It can be done manually anyhow:

 cd /usr/src
 tar -xvzf glut-3.7.tar.gz
 cd glut-3.7

 Read the file: README.linux
 cd linux
 READ the file: README
 cp Glut.cf ..
 cd ..
 Edit Glut.cf: remove any Mesa references.
 Replace any -lMesaGL -lMesaGLU with -lGL -lGLU if needed.
 In particular, replace:
  OPENGL = $(TOP)/../lib/libMesaGL.so
  GLU = $(TOP)/../lib/libMesaGLU.so
 with:
  OPENGL = -lGL
  GLU = -lGLU

 ./mkmkfiles.imake
 cd lib/glut
 cp /usr/src/glut-3.7/linux/Makefile .
 Edit the Makefile: remove any Mesa references.
 Replace any -lMesaGL -lMesaGLU with -lGL -lGLU if needed.
 In particular, replace:
  OPENGL = $(TOP)/../lib/libMesaGL.so
  GLU = $(TOP)/../lib/libMesaGLU.so
 with:
  OPENGL = -lGL
  GLU = -lGLU

 make
 ln -s libglut.so.3.7 libglut.so
 ln -s libglut.so.3.7 libglut.so.3
 cp -d libglut.* /usr/lib
 cd ..
 cd gle
 # make a shared lib for libgle
 make
 gcc -shared -o libgle.so.3.7 *.o
 ln -s libgle.so.3.7 libgle.so
 ln -s libgle.so.3.7 libgle.so.3
 cp -d libgle.* /usr/lib
 cd ..
 cd mui
 # make a shared lib for libmui
 make
 gcc -shared -o libmui.so.3.7 *.o
 ln -s libmui.so.3.7 libmui.so
 ln -s libmui.so.3.7 libmui.so.3
 cp -d libmui.* /usr/lib

        # Install the GLUT manual pages (not included with MesaDemos)
 cd /usr/src/glut-3.7
 make SUBDIRS=man Makefile
 cd man/glut
 make install.man
 ldconfig

 cd ../../progs/demos/ideas
 # edit the Makefile, change OPENGL = -lGL and GLU = -lGLU
 make
 ./ideas
 # test compiling some demos
 # take a look at which libraries have to be linked (-lX11 ...) in
 # the Makefiles.  Qt's tmake program available at www.troll.no
 # is a quick way to make a Makefile but you have to edit it
 # and add the -l needed.
ideas如果运行成功的话,说明glut已经可以用了,这时可以将include/GL下的glut等头文件复制到/usr/include中去。

上面的几步中,下载的glut包放在/usr/src目录下,如果放在其他目录下,将/usr/src改为相应的目录即可。
此外应该注意的是两个Makefile文件的修改
 改 
·  OPENGL = $(TOP)/../lib/libMesaGL.so
  GLU = $(TOP)/../lib/libMesaGLU.so
 为
  OPENGL = -lGL
  GLU = -lGLU
因为所指定的目录中没有libMesaGL.so和libMesaGLU.so。

之后是tmake的配置,后面我们可以用它来生成pro工程文件和makefile文件。

先将下载的tmake解压缩,tar  -zxvf  tmake-1.8.tar.gz
得到tmake-1.8目录,之后设置两个环境变量:PATH和TMAKEPATH
PATH=$PATH:/usr/src/tmake-1.8/bin
export PATH
TMAKEPATH=/usr/src/tmake-1.8/lib/linux-g++
export TMAKEPATH

新建一个测试目录test,将glut-3.7目录下的progs/redbook目录下的hello.c复制到test目录中

之后生成一个pro文件:progen  -o hello.pro

然后生成makefile文件:tmake hello.pro -o Makefile

编辑生成的Makefile文件,在加载动态连接库的行里面加入 -lglut -lXi -lXmu

保存,make。

./hello 可以看到运行结果就可以了。

posted @ 2005-12-09 19:22 all gone 阅读(617) | 评论 (0)编辑 收藏

仅列出标题
共17页: First 上一页 9 10 11 12 13 14 15 16 17 下一页