Apache http server linux 安装过程说明 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./download.cgi pcre: http://www./ apache http server: http://httpd./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 切换到httpd-2.4.9文件夹下,依次执行命令: (1)./configure--prefix=/usr/mytest /soft/httpd --with-apr=/usr/mytest/soft/apr/bin/apr-1-config --with-apr-util=/usr/mytest/soft/apr-util/bin/apu-1-config --with-pcre=/usr/mytest /soft/pcre/bin/pcre-config (该命令的意思是配置安装文件,指定安装路径为绝对路径;且需要依赖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./apache/menu22/invoking.html
(2) 切换到/usr/mytest /soft/httpd/bin目录下, 执行:./apachectl –k start (3) 到浏览器中输入ServerName配置的属性值,得到:It works!
9、 共享服务器使用说明: 在httpd/htdocs 目录下面增加目录、文件等,浏览器中即可查看。 相关文档: http://jingyan.baidu.com/article/86112f13704e202736978761.html http://blog.csdn.net/sundenskyqq/article/details/24733923http://www./ http://apr./download.cgi
|
|
来自: peijs5201314 > 《Apache》