Solaris10操作系统 源代码安装apache

1 查看apache2是否已经安装
[root@solaris188:/]#pkginfo | grep apch2

2 卸载已经安装的软件
[root@solaris188:/]#pkgrm SUNWapch2d
[root@solaris188:/]#pkgrm SUNWapch2r
[root@solaris188:/]#pkgrm SUNWapch2u

3 增加PATH路径
编辑/etc/profile中PATH配置,增加/usr/sfw/bin 和 /usr/ccs/bin
配置完成后source /etc/profile使配置生效
[root@solaris188:/]#vi /etc/profile
[root@solaris188:/]#source /etc/profile
使用which命令查看能否找到gcc和make命令
[root@solaris188:/]#which gcc
[root@solaris188:/]#which make

查看是否已安装gcc编译器,能够显示出来说明已经安装
[root@solaris188:/]#gcc -v

4 上传软件包

启动xftp
新建连接,使用SFTP协议

将相关软件包上传到/software目录下

[root@solaris188:/software/apache]#ls -l

5 按顺序 安装apache需要的额外软件包
[root@solaris188:/software/apache]#gzip -d aprutil-1.2.2-sol8-x86-local.gz
[root@solaris188:/software/apache]#gzip -d libgcc-3.4.6-sol10-x86-local.gz
[root@solaris188:/software/apache]#gzip -d libiconv-1.11-sol10-x86-local.gz
[root@solaris188:/software/apache]#gzip -d libintl-3.4.0-sol10-x86-local.gz
[root@solaris188:/software/apache]#ls

要按照顺序逐一安装
[root@solaris188:/software/apache]#pkgadd -d aprutil-1.2.2-sol8-x86-local
[root@solaris188:/software/apache]#pkgadd -d libiconv-1.11-sol10-x86-local
[root@solaris188:/software/apache]#pkgadd -d libintl-3.4.0-sol10-x86-local
[root@solaris188:/software/apache]#pkgadd -d libgcc-3.4.6-sol10-x86-local
对应软件包如下
SMCaprutil SMCliconv SMClintl SMClgcc346
6 配置、编译、安装apache
[root@solaris188:/software/apache]#gzip -d httpd-2.0.59.tar.gz
[root@solaris188:/software/apache]#tar -xvf httpd-2.0.59.tar
[root@solaris188:/software/apache]#cd httpd-2.0.59
[root@solaris188:/software/apache/httpd-2.0.59]#./configure --prefix=/usr/local/apache2
[root@solaris188:/software/apache/httpd-2.0.59]#make
[root@solaris188:/software/apache/httpd-2.0.59]#make install

7 修改配置文件
[root@solaris188:/]#vi /usr/local/apache2/conf/httpd.conf
268行 修改为 Group nobody
291行 下面 增加 ServerName 192.168.6.188


8 增加PATH路径
[root@solaris188:/]#ls -l /usr/local/apache2

编辑/etc/profile,在PATH增加一个路径 /usr/local/apache2/bin
[root@solaris188:/]#vi /etc/profile
[root@solaris188:/]#source /etc/profile
[root@solaris188:/]#which apachectl

9 启动apache服务器
[root@solaris188:/]#apachectl start

浏览器输入ip地址 ,打开页面。

[root@solaris188:/]#cd /usr/local/apache2/htdocs
[root@solaris188:/usr/local/apache2/htdocs]#ls
[root@solaris188:/usr/local/apache2/htdocs]#echo "hello,oracle" > index.html

吕星昊
2016.1.13