`
knight_black_bob
  • 浏览: 841792 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论

linux apache 安装

阅读更多

 

linux  apache 安装 

 

wget http://mirrors.hust.edu.cn/apache//apr/apr-1.5.2.tar.gz
wget http://mirrors.hust.edu.cn/apache//apr/apr-util-1.5.4.tar.gz

wget http://mirrors.hust.edu.cn/apache//httpd/httpd-2.2.32.tar.gz


yum -y install pcre-devel

【No recognized SSL/TLS toolkit detected】
yum install openssl openssl-devel

./configure --prefix=/usr/local/apr 
make && make install

./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr
make && make install

./configure --prefix=/usr/local/apache --sysconfdir=/etc/httpd --enable-so --enable-rewirte --enable-ssl --enable-cgi --enable-cgid --enable-modules=most --enable-mods-shared=most --enable-mpms-shared=all --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-util
make && make install


vim /etc/httpd/httpd.conf    
在ServerRoot下面添加一行
PidFile "/var/run/httpd.pid"

vim /etc/init.d/httpd

#!/bin/bash
#
# httpd        Startup script for the Apache HTTP Server
#
# chkconfig: - 85 15
# description: Apache is a World Wide Web server.  It is used to serve \
#      HTML files and CGI.
# processname: httpd
# config: /etc/httpd/conf/httpd.conf
# config: /etc/sysconfig/httpd
# pidfile: /var/run/httpd.pid


# Source function library.
. /etc/rc.d/init.d/functions


if [ -f /etc/sysconfig/httpd ]; then
        . /etc/sysconfig/httpd
fi


# Start httpd in the C locale by default.
HTTPD_LANG=${HTTPD_LANG-"C"}


# This will prevent initlog from swallowing up a pass-phrase prompt if
# mod_ssl needs a pass-phrase from the user.
INITLOG_ARGS=""


# Set HTTPD=/usr/sbin/httpd.worker in /etc/sysconfig/httpd to use a server
# with the thread-based "worker" MPM; BE WARNED that some modules may not
# work correctly with a thread-based MPM; notably PHP will refuse to start.


# Path to the apachectl script, server binary, and short-form for messages.
apachectl=/usr/local/apache/bin/apachectl
httpd=${HTTPD-/usr/local/apache/bin/httpd}
prog=httpd
pidfile=${PIDFILE-/var/run/httpd.pid}
lockfile=${LOCKFILE-/var/lock/subsys/httpd}
RETVAL=0


start() {
        echo -n $"Starting $prog: "
        LANG=$HTTPD_LANG daemon --pidfile=${pidfile} $httpd $OPTIONS
        RETVAL=$?
        echo
        [ $RETVAL = 0 ] && touch ${lockfile}
        return $RETVAL
}


stop() {
echo -n $"Stopping $prog: "
killproc -p ${pidfile} -d 10 $httpd
RETVAL=$?
echo
[ $RETVAL = 0 ] && rm -f ${lockfile} ${pidfile}
}
reload() {
    echo -n $"Reloading $prog: "
    if ! LANG=$HTTPD_LANG $httpd $OPTIONS -t >&/dev/null; then
        RETVAL=$?
        echo $"not reloading due to configuration syntax error"
        failure $"not reloading $httpd due to configuration syntax error"
    else
        killproc -p ${pidfile} $httpd -HUP
        RETVAL=$?
    fi
    echo
}


# See how we were called.
case "$1" in
  start)
start
;;
  stop)
stop
;;
  status)
        status -p ${pidfile} $httpd
RETVAL=$?
;;
  restart)
stop
start
;;
  condrestart)
if [ -f ${pidfile} ] ; then
stop
start
fi
;;
  reload)
        reload
;;
  graceful|help|configtest|fullstatus)
$apachectl $@
RETVAL=$?
;;
  *)
echo $"Usage: $prog {start|stop|restart|condrestart|reload|status|fullstatus|graceful|help|configtest}"
exit 1
esac


exit $RETVAL


为此脚本赋予执行权限: chmod +x /etc/rc.d/init.d/httpd
加入服务列表: chkconfig --add httpd
给3,5启动 chkconfig --level  3  httpd on            chkconfig --level  5 httpd on
最后加路径  export PATH=$PATH:/usr/local/apache/bin
vim /etc/profile.d/httpd.sh完成后重新登录就可以了

httpd -k start 
httpd -k stop

/usr/local/apache/bin/apachectl start

 

 

 

在ServerRoot下面添加一行 PidFile "/var/run/httpd.pid"


 

 



 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

捐助开发者 

在兴趣的驱动下,写一个免费的东西,有欣喜,也还有汗水,希望你喜欢我的作品,同时也能支持一下。 当然,有钱捧个钱场(支持支付宝和微信 以及扣扣群),没钱捧个人场,谢谢各位。

 

个人主页http://knight-black-bob.iteye.com/



 
 
 谢谢您的赞助,我会做的更好!

  • 大小: 107.1 KB
  • 大小: 20.5 KB
0
1
分享到:
评论

相关推荐

    linux Apache安装(图文)

    下载适用于Linux的Apache安装程序。通常,官方提供的安装程序是tar.gz压缩格式。例如,你可能会找到名为httpd-version.tar.gz的文件,其中version是Apache的特定版本号。 安装过程分为以下几个步骤: 1. **解压...

    RedHat9linuxapache安装配置[整理].pdf

    以下是对"RedHat9linuxapache安装配置[整理].pdf"文档中提到的知识点的详细解释: 1. **安装万维网服务器**:在Red Hat 9上,你可以通过yum包管理器来安装Apache。首先,更新系统包列表,然后执行`sudo yum install...

    apache for linux安装

    本文将详细讲解如何在Linux环境下安装Apache。 首先,了解Apache的基础知识是必要的。Apache是一款开源、免费的Web服务器软件,它能够解析HTTP协议,处理来自Web浏览器的请求,并将静态网页或动态生成的网页返回给...

    linux离线安装apache

    这些准备工作的目的是为了满足Apache安装过程中可能存在的依赖关系。 1. **安装GCC和G++** GCC (GNU Compiler Collection) 是一套用于C和C++语言的编译器,而G++是GCC的一个组成部分,专门用于C++的编译。这两个...

    RedHat9linuxapache安装配置.pdf

    在Red Hat 9 Linux系统中,Apache HTTP Server的安装与配置是进行Web服务的基础工作,对于技术人员来说,熟悉这一过程至关重要。以下将详细介绍标题和描述中提到的知识点,并且涵盖标签"技术"所涵盖的相关内容。 1....

    Linux下安装APACHE

    Linux 下安装 APACHE Linux 作为一个开源的操作系统,广泛应用于服务器端,APACHE 是一个流行的 Web 服务器软件,而安装 APACHE 在 Linux 下则需要遵循特定的步骤,以避免安装过程中的错误。 下载必要的文件 在...

    Linux下Apache安装

    ### Linux下Apache安装详解 在Linux环境中安装Apache服务器是一项基础且关键的任务,尤其对于搭建Web服务、测试环境或运行各种基于Web的应用程序至关重要。本文将深入解析Linux环境下Apache的安装流程,涵盖解压缩...

    linux下安装apache

    Linux 下安装 Apache Linux 下安装 Apache 是一个复杂的过程,需要安装多个依赖项,包括 APR、APR-UTIL 和 PCRE。在本文中,我们将详细介绍 Linux 下安装 Apache 遇到的问题,以及解决办法。 一、安装前准备 在...

    Linux下Apache+PHP+Mysql安装与配置

    Linux 下 Apache+PHP+Mysql 安装与配置 Apache installation * 介绍 Apache 的安装过程,包括卸载原有 Apache 用户、解压缩 Apache 源代码、配置和安装 Apache。 * "--prefix" 参数用于指定安装后的存放路径;"--...

    linux系统 Apache http 安装源码

    本篇将详细介绍如何在Linux系统上通过源码安装Apache HTTP Server 2.4.43及其依赖库。 首先,我们需要准备的源码文件有:apr-1.7.0,apr-util-1.6.1,pcre-8.42,openssl-1.1.1g,以及httpd-2.4.43。这些文件分别...

    Linux apache环境多域名配置

    查找Apache安装目录** - 使用`find / -name httpd.conf`命令找到Apache的主配置文件httpd.conf。 - 或者直接导航到Apache的安装目录,通常位于`/etc/httpd/`或`/usr/local/apache2/`。 #### 三、多域名配置步骤 ...

    linux下安装apache+php+mysql的最简步骤

    在Linux系统中,构建一个基于Apache、PHP和MySQL的服务器环境,通常被称为LAMP(Linux、Apache、MySQL、PHP)架构。这是一种常见的Web开发平台,适用于动态网站和应用程序的部署。下面将详细介绍如何在Linux环境下...

    linux中apache安装与配置

    本文将详细介绍如何在Linux环境中安装和配置Apache,包括所需的依赖包和基本步骤。 首先,让我们从安装Apache开始。在大多数Linux发行版中,你可以通过包管理器来安装Apache。例如,在Ubuntu或Debian上,使用`apt`...

    Linux下安装Apache httpd.doc

    在Linux环境下安装Apache是常见的需求之一,尤其是在构建Web服务器时。 #### 二、环境准备 本文档将基于以下环境进行Apache的安装与配置: - **操作系统**:CentOS 6.5 (Final) - **内核版本**:2.6.32-431.el6.x86...

    Linux搭建PHP+MySQL+Apache环境

    安装完成后,通过运行`sudo systemctl start apache2`(Debian系)或`sudo systemctl start httpd`(RPM系)启动Apache,并用`sudo systemctl enable apache2`或`sudo systemctl enable httpd`设置开机启动。...

    Linux上apache的安装文件

    本文件包提供了在Linux上安装Apache所需的核心组件,包括httpd、apr、apr-util以及pcre库。接下来,我们将详细介绍这些组件以及如何在Linux系统上安装和配置Apache。 1. **httpd**: 这是Apache HTTP Server的主要...

    linux 安装Apache+openssl 过程

    在Linux系统中安装Apache服务器并集成OpenSSL安全套接层库是一个涉及多个步骤的过程,目的是为了构建一个既能够处理HTTP请求,又能提供SSL/TLS加密通信的Web服务器。以下是详细的知识点描述: 1. 安装apr(Apache ...

    ubuntu linux下安装apache

    ubuntu linux下安装apache。

    Linux下安装配置 Apache2.2.x+MySql5.x+PHP5.x 详解

    Linux 下安装配置 Apache2.2.x+MySql5.x+PHP5.x 详解 本篇文章详细介绍了在 Linux 操作系统下安装和配置 Apache2.2.x、MySql5.x 和 PHP5.x 的步骤,使用的操作系统为 Redhat AS5,内核版本为 Linux 2.6.18-8.el5,...

    linux下安装apache2

    怎样在linux下安装apache2,具体的安装方法,和安装过程中遇到的问题

Global site tag (gtag.js) - Google Analytics