Apache http server 安装过程

PS:Apache http server 需要依赖 apr、apr-util、pcre,所以要先下载和安装这三个东东。而apr-util和pcre又依赖apr,所以要先安装apr。


步骤:
1、  下载apr、apr-util、pcre、Apache httpserver
地址如下:
apr/ apr-util: http://apr.apache.org/download.cgi
pcre: http://www.pcre.org/
apache http server: http://httpd.apache.org/download.cgi#apache24
 
2、  将文件上传到服务器(linux)
例如目录:/usr/mytest/source
3、  分别解压四个文件
例如解压到当前目录:
解压apr : tar –vxf apr-1.5.0.tar.gz(在source目录下会多出一个目录apr-1.5.0)
解压apr : tar –vxf apr-util-1.5.3.tar.gz(在source目录下会多出一个目录apr-util-1.5.3)
解压pcre : tar –vxf pcre-8.33.tar.gz(在source目录下会多出一个目录pcre-8.33)
解压Apache http server:tar –vxf httpd-2.4.9.tar.gz(在source目录下会多出一个目录httpd-2.4.9)
PS:注意,我下载的都是tar.gz格式的,如果是其他格式的,请参考linux关于解压方面的相关命令。
 
4、  安装apr
切换到apr-1.5.0文件夹下,依次执行命令:
(1)./configure--prefix=/usr/mytest /soft/apr (该命令的意思是配置安装文件,指定安装路径为绝对路径)
(2)make (编译)
(3)make install(安装)
5、  安装apr-util
切换到apr-util-1.5.3文件夹下,依次执行命令:
(1)./configure--prefix=/usr/mytest /soft/apr-util --with-apr=/usr/mytest
/soft/apr/bin/apr-1-config
 (该命令的意思是配置安装文件,指定安装路径为绝对路径;且需要依赖apr,否则将会出错)
(2)make (编译)
(3)make install(安装)
6、  安装pcre
切换到pcre-8.33文件夹下,依次执行命令:
(1)./configure --prefix=/usr/mytest /soft/pcre --with-apr=/usr/mytest
/soft/apr/bin/apr-1-config
 (该命令的意思是配置安装文件,指定安装路径为绝对路径;且需要依赖apr,否则将会出错)
(2)make (编译)
(3)make install(安装)
 
7、  安装Apache httpserver(安装http服务的话需要把 apr 和 apr-util 源文件复制到httpd-2.4.9下的srclib文件夹下。)
切换到httpd-2.4.9文件夹下,依次执行命令:
(1)./configure --prefix=/usr/mytest/soft/httpd 
--with-apr=/usr/mytest/soft/apr/bin/apr-1-config  
--with-apr=/usr/mytest/soft/apr-util/bin/apu-1-config
--with-apr=/usr/mytest /soft/pcre/bin/pcre-config
或者
./configure --prefix=/usr/mytest/soft/httpd 
--with-apr=/usr/mytest/source/http-2.4.9/srclib/apr/ 
--with-apr=/usr/mytest/source/http-2.4.9/srclib/apr-util
--with-apr=/usr/mytest/soft/pcre
 (该命令的意思是配置安装文件,指定安装路径为绝对路径;且需要依赖apr/apr-util/pcre,否则将会出错)
(2)make (编译)
(3)make install(安装)
 
至此安装完成并结束。
 
8、  启动测试:
(1)    需要首先修改配置文件:(/usr/mytest /soft/httpd/conf/httpd.conf)
ServerName (如127.0.0.1:1025)
Listener  (如127.0.0.1:1025)
PS:如果配置文件中Listen定义的是默认的80端口(或1024以下),那么启动Apache将需要root权限以将它绑定在特权端口上。
参考网址:http://www.jinbuguo.com/apache/menu22/invoking.html
 
(2)    切换到/usr/mytest /soft/httpd/bin目录下,
执行:./apachectl –k start
(3)    到浏览器中输入ServerName配置的属性值,得到:It  works!
 
9、  共享服务器使用说明:
在httpd/htdocs 目录下面增加目录、文件等,浏览器中即可查看。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值