领测软件测试网
第一次安装apache 看了很多资料,尽管很多地方看得一头雾水,不知其深意,但我的apache 终于还是在我的机器上安装成功,运行正常了!
下面我把安装过程写出来供和我一样的新手参考!并请大家批评指正!!
首先我们要确定安装apache需要的几个步骤:下载apache压缩包,解压缩,配置,编译和安装。下面我们一步一步来进行!
1. 可从[url]www.apache.org [/url]和[url]www.sunfreeware.com[/url]等网站下在其压缩包,文件名类似于:apache_1.3.23.tar.gz。文件大小约2.1M
2.将压缩包解压缩:
# gunzip -d apache_1.3.23.tar.gz
# tar -vxf apache_1.3.23.tar
解压缩后得到一个目录名为apache_1.3.23的目录,该目录中既是apache
服务器所需要的所有文件。
3.进入目录apache_1.3.23中,开始对apache 进行配置。命令格式如下:
# ./configure --prefix=[install_dir] --enable-module=[module_name]
注:这里的install_dir是apache要安装的目的目录,这个目录名及其路径随意,只要空间够用就好。如/usr/local/httpd 或/home/www/ 都可
。这里的module_name 是准备额外启用的apache模块名。标准的apache提供约35个模块,而apache 默认不启用其中半数的模块,所以,如果需
要的话,需要我们在这里人工启用它们。上面命令可以启用多个模块,只需要输入多个 “--enable-module=[module_name]”即可。
在这里,我将apache安装到/home/httpd目录下,启用模块。使用命令如下:
#./configure --prefix=/home/httpd --enable-module=auth-anon
4.配置命令完成后,开始编译apache,在同一目录下,使用命令如下:
# make
编译完成后会在src子目录下生成一个名字为“httpd"可执行程序。
在这一步骤中,可能很多人会遇到提示:"make: not found" 没有关系,只要我们知道“make”文件的位置“/usr/ccs/bin/make"就好,可以
用“# path $PATH:/usr/ccs/bin/make”命令把它加到PATH中,也可以使用绝对路径“# /usr/ccs/bin/make”来执行这个命令。
5.到这一步,我们可以来安装apache了,这一步将可执行文件“httpd"和所有apache的配置文件拷贝到安装目录中去。使用命令如下:
# make install
这样apache服务器就算已经安装到你的系统上了。
6.启动和关闭apache需要用到安装目录下的bin子目录中的apachectl命令。命令使用方法如下:
# apachectl start
# apachectl stop
7.如果你需要apache随着系统同时启动和关闭,可按下面的操作来做:
# cp /home/httpd/bin/apachectl /etc/init.d
# cd /etc/rc3.d
# ln -s /etc/init.d S85apachectl
# cd /etc/rc2.d
# ln -s /etc/init.d K15apachectl
这样apache服务器会随系统同时启动和关闭了。
随后需要详细的配置你的apache服务器,主要涉及到httpd.conf , access.conf 和 srm.conf等配置文件,以后再述。
[color=orange:f980ff7f6f][b:f980ff7f6f]附apache模块表一张[/b:f980ff7f6f][/color:f980ff7f6f]
|
apache模块描述以及是否默认启用一览表
race 回复于:2003-11-07 07:41:35
| 谢谢发表原创。
熟悉apache的可以看看有没有什么错误,有没有能改进的地方。
| chly63 回复于:2003-11-07 09:19:54
| 建议加入精华版!
| doni 回复于:2003-11-07 09:35:12
| apache 在 Solaris & linux 下差别有多大?
另外,有没有apache2 for Solaris
| 南非蜘蛛 回复于:2003-11-07 10:03:35
| 写的不错,就是有点太潜了,呵呵,属于基础普及一类
| metor78 回复于:2003-11-07 10:07:57
| 最近原创不少呀!都写的很好,看来我也要努力了
| race 回复于:2003-11-07 10:20:58
| [quote:6558eb5bb9="metor78"]最近原创不少呀!都写的很好,看来我也要努力了[/quote:6558eb5bb9]
我可记住你说的话了
| 醉里方休 回复于:2003-11-07 10:53:14
| 多谢各位老大鼓励!俺还是个新手!对solaris的知识掌握的很粗浅,不过,俺会继续努力的!俺的目标是做第二只蜘蛛!
| C.Arthur 回复于:2003-11-07 11:03:50
| 好文
| 南非蜘蛛 回复于:2003-11-07 11:07:33
| [quote:10990d1c1c="醉里方休"]多谢各位老大鼓励!俺还是个新手!对solaris的知识掌握的很粗浅,不过,俺会继续努力的!俺的目标是做第二只蜘蛛![/quote:10990d1c1c]
那我就做第二个醉里方休
| C.Arthur 回复于:2003-11-07 11:11:06
| 双煞?
| zhoulm 回复于:2003-11-07 12:19:47
| 我在编译时出现这个错误,缺什么包呢?请帮着看看!
# ./configure --prefix=/usr/httpd
Configuring for Apache, Version 1.3.23
+ using installation path layout: Apache (config.layout)
Creating Makefile
Creating Configuration.apaci in src
Creating Makefile in src
+ configured for Solaris 290 platform
+ setting C compiler to cc
+ setting C pre-processor to cc -E
+ checking for system header files
+ adding selected modules
+ using builtin Expat
+ checking sizeof various data types
+ doing sanity check on compiler and options
** A test compilation with your Makefile configuration
** failed. The below error output from the compilation
** test will give you an idea what is failing. Note that
** Apache requires an ANSI C Compiler, such as gcc.
cd ..; cc -DSOLARIS2=290 -DUSE_EXPAT -I./lib/expat-lite -DNO_DL_NEEDED `./apaci` -o helpers/dummy helpers/dummy.c -lsocket -lnsl
/usr/ucb/cc: language optional software package not installed
*** Error code 1
make: Fatal error: Command failed for target `dummy'
======== Error Output for sanity check ========
============= End of Error Report =============
Aborting!
| hardiwang 回复于:2003-11-07 12:27:03
| /usr/ucb/cc: language optional software package not installed
| beginner-bj 回复于:2003-11-07 12:30:04
| [quote:a2e7808004="zhoulm"]我在编译时出现这个错误,缺什么包呢?请帮着看看!
# ./configure --prefix=/usr/httpd
Configuring for Apache, Version 1.3.23
+ using installation path layout: Apache (config.layout)
Creating Makefil..........[/quote:a2e7808004]
估计是缺/usr/ccs/bin/ucbcc等文件。
| zhoulm 回复于:2003-11-07 12:34:43
| [quote:245d528a2a="beginner-bj"]
估计是缺/usr/ccs/bin/ucbcc等文件。[/quote:245d528a2a]
确实没有该文件,我需要装什么具体的包?
| beginner-bj 回复于:2003-11-07 12:41:11
| http://www.brandonhutchinson.com/usr_ucb_cc.html
| beginner-bj 回复于:2003-11-07 12:45:12
| [code:1:d1aa0573f0]bash-2.05$ pkginfo SUNWscpu SUNWbtool SPROcc
system SUNWbtool CCS tools bundled with SunOS
system SUNWscpu Source Compatibility, (Usr)
错误: 未发现"SPROcc"的信息
bash-2.05$[/code:1:d1aa0573f0]
估计你的也是缺SPROcc
| zhoulm 回复于:2003-11-07 12:57:04
| 我没装SPROcc这个package,我去装装看!
| jaak 回复于:2003-11-07 13:10:55
| 太好了!!非常感谢,希望多多发表这类文章,大家相互交流心得.
|
文章来源于领测软件测试网 https://www.ltesting.net/
| |