共计 1940 个字符,预计需要花费 5 分钟才能阅读完成。
Apache HTTPD 在 Linux 上的安装与配置
1.apache httpd 与依赖库下载
apache httpd 下载地址:
http://httpd.apache.org/
pcre(Perl Compatible Regular Expressions) 下载地址:
http://www.pcre.org/
https://sourceforge.net/projects/pcre/files/pcre/
openssl 下载地址:
http://www.openssl.org/
apr(Apache Protable Runtime)下载地址:
http://apr.apache.org/
2. 安装 pcre
# tar zxvf pcre-8.35.tar.gz
# cd pcre-8.35
# ./configure -prefix=/usr/local/pcre
# make
# make install
3. 安装 apr
# tar zxvf apr-1.5.1.tar.gz
# cd apr-1.5.1
# ./configure -prefix=/usr/local/apr -with-pcre=/usr/local/pcre
# make
# make install
4. 安装 apr-util
# tar zxvf apr-util-1.5.3.tar.gz
# cd apr-util-1.5.3
# ./configure -prefix=/usr/local/apr-util -with-apr=/usr/local/apr
# make
# make install
5. 安装 httpd
# tar zxvf httpd-2.4.9.tar.gz
# cd httpd-2.4.9
# ./configure -prefix=/usr/local/httpd -with-pcre=/usr/local/pcre -with-apr-util=/usr/local/apr-util
# make
# make install
或者可以不用单独安装依赖包 apr 与 apr-util,将 httpd 解压后有个 srclib 目录,将 apr 和 apr-util 的包解压到 srclib,去掉版本号。安装 httpd 时自动安装 apr 与 apr-util。
# tar zxvf httpd-2.4.9.tar.gz
# cd /software/httpd-2.4.9/srclib
# tar -zxvf apr-1.5.1.tar.gz
# tar -zxvf apr-util-1.5.3.tar.gz
# mv apr-1.5.1 apr
# mv apr-util-1.5.3 apr-util
# ./configure -prefix=/usr/local/httpd -with-pcre=/usr/local/pcre
# make
# make install
6. 运行 apache httpd,默认端口 80
启动 apache httpd
# cd /usr/local/httpd
# ./httpd -k start
# ./httpd -k restart
测试 web 服务.
打开防火墙 80 端口,以使外部网络可以访问
# vi /etc/sysconfig/iptables
-A INPUT -p tcp -m tcp –dport 80 -j ACCEPT
# service iptables restart
外部网络通过浏览器访问:
http://192.168.16.133
停止 apache httpd
# ./httpd -k stop
Ubuntu 14.04 配置 LAMP+phpMyAdmin PHP(5.5.9)开发环境 http://www.linuxidc.com/Linux/2014-10/107924.htm
Windows 7 下硬盘安装 Ubuntu 14.10 图文教程 http://www.linuxidc.com/Linux/2014-10/108430.htm
U 盘安装 Ubuntu 14.10 http://www.linuxidc.com/Linux/2014-10/108402.htm
Ubuntu 14.10 正式发布下载 http://www.linuxidc.com/Linux/2014-10/108363.htm
Ubuntu 14.04 LTS 如何升级到 Ubuntu 14.10 http://www.linuxidc.com/Linux/2014-10/108381.htm
Ubuntu 14.10 下安装 LAMP 服务图文详解 http://www.linuxidc.com/Linux/2014-12/110082.htm