下文是我边试边做的记录,不保证内容的完整性和正确性。

由于我的Apsire机器是最简安装Foreda8,所以需要安装httpd,熟悉一遍也是很好的嘛。

我从网上搜罗并下载了apchehttpd-2.4.6.tar.gz以及安装httpd需要的包apr-1.4.6.tar.gz,apr-util-1.5.1.tar.gz。

安装apr-1.4.6基本是解压,make,make install;安装过程中提示gcc没安,于是用yum install gcc*安上了。

安装apr-util-1.5.1也是一样的解压,make,make install;

Apchehttpd-2.4.6.tar.gz是解压,./configure,make,make install.

安装后httpd被放到了usr/local/apache2下。

之后将usr/local/apache2/conf/httpd.conf 拷贝到/usr/local/httpd/conf/下,之前需要创建目录http和子目录conf。

然后进入usr/local/apache2/bin,用命令  ./apachectl start 启动httpd。下图就是浏览器看到的启动结果。

但是,使用service httpd start/stop ,系统不识别,说httpd: unrecognized service。

So,又去请教百度大神,大神保佑这次没花多少时间,具体操作如下:

把apachectl拷贝到/etc/rc.d/init.d/下,名为httpd

[root@bogon init.d]#  cp /usr/local/apache2/bin/apachectl /etc/rc.d/init.d/httpd

加权限
[root@bogon init.d]# chmod 700 /etc/rc.d/init.d/httpd

看一下

[root@bogon init.d]# ls
acpid         dund        killall                   nfslock      rsyslog
anacron       firstboot   kudzu                     nscd         saslauthd
atd           functions   lm_sensors                ntpd         sendmail
auditd        fuse        mdmonitor                 openvpn      setroubleshoot
autofs        gpm         messagebus                pand         single
avahi-daemon  haldaemon   microcode_ctl             pcscd        smartd
bluetooth     halt        multipathd                psacct       smolt
btseed        httpd       netconsole                racoon       sshd
bttrack       ip6tables   netfs                     rdisc        udev-post
capi          iptables    netplugd                  restorecond  winbind
ConsoleKit    irda        network                   rpcbind      wpa_supplicant
cpuspeed      irqbalance  NetworkManager            rpcgssd      ypbind
crond         isdn        NetworkManagerDispatcher  rpcidmapd    yum-updatesd
cups          jexec       nfs                       rpcsvcgssd

然后编辑httpd这个文件
[root@bogon init.d]# vi httpd

下面是文件内容,下面第三行起的三行红字是新增加的,其它部分照旧。

#!/bin/sh
#
#
#Comments to support chkconfig on Redhat Linux
#chkconfig:2345 90 90
#description:http server
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements.  See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License.  You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
#
# Apache control script designed to allow an easy command line interface
# to controlling Apache.  Written by Marc Slemko, 1997/08/23
#
# The exit codes returned are:
#   XXX this doc is no longer correct now that the interesting
#   XXX functions are handled by httpd
#       0 - operation completed successfully
#       1 -
#       2 - usage error
#       3 - httpd could not be started
#       4 - httpd could not be stopped
#       5 - httpd could not be started during a restart
#       6 - httpd could not be restarted during a restart
#       7 - httpd could not be restarted during a graceful restart
#       8 - configuration syntax error
#
# When multiple arguments are given, only the error from the _last_
# one is reported.  Run "apachectl help" for usage info
#
ACMD="$1"
ARGV="$@"

.....

加完三行就行了,它的目的是在使用chkconfig时不会提示你这个错service httpd does not support chkconfig。

之后执行
[root@bogon init.d]# chkconfig --add httpd
[root@bogon init.d]# chkconfig --level 2345 httpd on

完成后就能用service httpd start/stop了

[root@bogon init.d]# service httpd start
AH00557: httpd: apr_sockaddr_info_get() failed for bogon
AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1. Set the 'ServerName' directive globally to suppress this message
httpd (pid 2293) already running
[root@bogon init.d]# service httpd stop
AH00557: httpd: apr_sockaddr_info_get() failed for bogon
AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1. Set the 'ServerName' directive globally to suppress this message
[root@bogon init.d]# service httpd start
AH00557: httpd: apr_sockaddr_info_get() failed for bogon
AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1. Set the 'ServerName' directive globally to suppress this message
[root@bogon init.d]#

<全文完>

在Foreda8上试安装Apchehttpd-2.4.6.tar.gz的更多相关文章

  1. Centos 6.4 安装mysql-5.6.14-linux-glibc2.5-i686.tar.gz

    创建用户和组 创建链接 授权own和grp给mysql-5.5.8-linux2.6-i686文件夹,就是下面的BASE_DIR 执行的mysql_install_db的时候后面带参数 ./scrip ...

  2. MySQL脚本自动安装mysql-5.6.15-linux-glibc2.5-x86_64.tar.gz

    脚本安装mysql-5.6.15-linux-glibc2.5-x86_64.tar.gz 先准备好数据文件的路径 softdir='/data/soft' 把脚本和tar包放在相应的路径下,其实就是 ...

  3. linux安装 redis(redis-3.0.2.tar.gz) 和 mongodb(mongodb-linux-x86_64-rhel62-4.0.0)

    1:首先 要下载 这两个 压缩包 注意:liunx是否已经安装过 gcc没安装的话 先安装:yum install gcc-c++ 2:安装 redis:redis-3.0.2.tar.gz (1): ...

  4. 如何在Ubuntu下安装”.deb“、”.bin“、”.tar.gz“、”.tar.bz2“格式的软件包!

    今天在Ubuntu11.10中安装Google chrome浏览器是遇到了问题,下载好的“.deb”格式的安装文件google-chrome-stable.deb双击后或者右键快捷菜单选择 Synap ...

  5. Linux CenterOS安装mysql-5.6.12-linux-glibc2.5-x86_64.tar.gz步骤

    1.首先配置IP. Cd /etc/sysconfig/network-scripts/ vim ifcfg-ens32 将ONBOOT=no,改为ONBOOT=yes.(开机启动激活网卡) 2.构建 ...

  6. Linux下安装解压版(tar.gz)MySQL5.7

            最近尝试在Linux中安装了解压版MySQL,期间查阅了许多博客.很多博客看得我很懵逼,因此记录下自己的安装过程,方便后续查阅.         环境说明:CentOs7.2 一.清理 ...

  7. centos 安装 mysql-5.7.23-linux-glibc2.12-x86_64.tar.gz 详细步骤

    1.卸载Linux系统上自带的mysql插件(old版本) 查找mysql相关安装: rpm -qa|grep -i mysql 可能会出现以下的一个或多个,没有更好,说明你的系统很干净,但是以防万一 ...

  8. Ubuntu系统里下载安装配置redis-2.2.13.tar.gz

    不多说,直接上干货! Redis是一个NoSQL数据库,在数据需要频繁更新,并且数据的访问热点范围比较广的应用场景下,Redis的效率很不错. 下面介绍Redis的安装过程,如下面的步骤所示. 第一步 ...

  9. LINUX 安装JDK (rpm格式和tar.gz格式)

    谷歌博客地址:http://tsaiquinn.blogspot.com/2014/10/linux-jdk-rpmtargz.html JDK rpm方式: 我使用的是SecureCRT,先下载了然 ...

随机推荐

  1. luoguP4466 [国际集训队]和与积 莫比乌斯反演

    自然想到枚举\(gcd(a, b)\),不妨设其为\(d\),并且\(a = di, b = dj(a > b)\) 那么\(\frac{ab}{a + b} = \frac{dij}{i + ...

  2. [BZOJ4864][BeiJing2017Wc]神秘物质(splay)

    首先merge就是先delete两次再insert,Max就是整个区间的最大值减最小值,Min就是区间中所有相邻两数差的最小值. Splay支持区间最大值,区间最小值,区间相邻差最小值即可. #inc ...

  3. Codeforces 1090J $kmp+hash+$二分

    题意 给出两个字符串\(s\)和\(t\),设\(S\)为\(s\)的任意一个非空前缀,\(T\)为\(t\)的任意一个非空前缀,问\(S+T\)有多少种不同的可能. Solution 看了一圈,感觉 ...

  4. 【洛谷】2607: [ZJOI2008]骑士【树形DP】【基环树】

    P2607 [ZJOI2008]骑士 题目描述 Z国的骑士团是一个很有势力的组织,帮会中汇聚了来自各地的精英.他们劫富济贫,惩恶扬善,受到社会各界的赞扬. 最近发生了一件可怕的事情,邪恶的Y国发动了一 ...

  5. IIS7.5 配置 PHP 5.3.5

    本机环境:IIS7.5 windows2008 64位 首先确认IIS中启用了CGI功能: watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQveWVmaWdod ...

  6. 制作MACOSX10.10.3/10.9安装启动盘U盘的教程

    下载MACOSX 10.10.3/10.9镜像文件,下载地址http://www.chinamac.com/download/mac14032.html1.准备好你需要的大于等于6G以上的U盘或者移动 ...

  7. MVC批量更新,可验证并解决集合元素不连续控制器接收不完全的问题

    在"MVC批量添加,增加一条记录的同时添加N条集合属性所对应的个体"中,有2个问题待解决: 1.由jquery动态生成了表单元素,但不能实施验证. 2.一旦集合元素不连续,控制器就 ...

  8. Spring MVC的异步模式DefferedResult

    原文:http://www.importnew.com/21051.html 什么是异步模式 要知道什么是异步模式,就先要知道什么是同步模式,先看最典型的同步模式: (图1) 浏览器发起请求,Web服 ...

  9. KJBitmap与KJHttp的深度用法

    摘要 本文原创,转载请注明地址:http://kymjs.com/code/2015/09/24/01这篇文章是对KJFrameForAndroid使用的一个深入学习 之前写过一些有关KJFrame的 ...

  10. mysql批量insert速度超慢

    在进行大批量数据insert的时候,我使用的是hibernate的进行save,而数据库采用mysql.但是在save的时候,速度很慢.         刚开始以为是MYSQL进行DNS解析的问题,于 ...