安装apache服务器

(推荐方法)

安装前清确保已安装gcc、g++

1)安装依赖包apr-1.6.5.tar.gz,下载地址:http://apr.apache.org/download.cgi

tar -xvf apr-1.6.5.tar.gz

cd apr-1.6.5

./configure --prefix=/usr/local/apr

make && make install

2)安装依赖包apr-util-1.6.1.tar.gz,下载地址:http://apr.apache.org/download.cgi

tar -xvf apr-util-1.6.1.tar.gz

cd apr-util-1.6.1

./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr/bin/apr-1-config

上述问题可能会出现此问题:

通过apt-get install libexpat-dev解决此问题

make && make install

3)安装依赖包pcre-8.42.tar.gz,下载地址:https://sourceforge.net/projects/pcre/files/

tar -xvf pcre-8.42.tar.gz

cd pcre-8.42

./configure --prefix=/usr/local/pcre

4)安装apache

下载apache:http://httpd.apache.org/download.cgi

tar -xvf httpd-2.4.37.tar.gz #解压

cd httpd-2.4.37

./configure --prefix=/usr/local/apache2 --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-util --with-pcre=/usr/local/pcre

make && make install

5)测试

•启动Apache:/usr/local/apache2/bin/apachectl start
•停止Apache:/usr/local/apache2/bin/apachectl stop
•重启Apache:/usr/local/apache2/bin/apachectl restart

将apache添加到服务中(ubuntu适用,其他系统未知):

cp /usr/local/apache/bin/apachectl /etc/init.d/apache

systemctl daemon-reload

如果启动apahce的时候报了这个错误:

httpd: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1. Set the 'ServerName' directive globally to suppress this message

请尝试按照以下方法解决:

nano /usr/local/apache/conf/httpd.conf

#修改ServerName为localhost:80

ServerName localhost:80

如果上述方法不可行,请尝试下列方法:

安装apache2:apt-get install apache2

•启动apache:/etc/init.d/apache2 start 或 service apache2 start

•停止apache:/etc/init.d/apache2 stop 或 service apache2 stop

•重启apache:/etc/init.d/apache2 restart 或 service apache2 restart

linux:Apache服务器相关的更多相关文章

  1. linux apache服务器优化建议整理(很实用)

    转载:http://www.cnblogs.com/zhongbin/archive/2013/06/11/3131865.html 1.apache服务器的time_wait过多 fin_wait1 ...

  2. linux apache服务器

    apache服务器 服务端功能是侦听和响应客户端的http请求.http协议的默认端口是80. 1996年以来,apache成为最流行的web服务器. IIS web服务器只能安装在windows上. ...

  3. 浅谈Linux ftp服务器相关配置

    首先我们需要在Linux系统下安装FTP服务器  Ubuntu sudo apt-get install.......  centos yun....... 然后,我们要配置vsftpd.conf文件 ...

  4. CentOS 6.3安装配置LAMP服务器(Linux+Apache+MySQL+PHP5)

    服务器系统环境:CentOS 6.3 客户端系统环境:Windows 7 ultimate(x86)sp1 简体中文旗舰版 ※  本文档描述了如何在Linux服务器配置Apache.Mysql.PHP ...

  5. 在Linux系统中如何设置APACHE服务器里的后台页面只允许某个IP地址访问

    补充资料 本网络中使用LINUX服务器,web服务器是由APACHE搭建,IP地址为192.168.1.5,后台页面为/admin/login.jsp . 如何设置后台页面LOGIN.JSP只允许19 ...

  6. 分享:linux下apache服务器的配置和管理

    linux下apache服务器的配置和管理. 一.两个重要目录: Apache有两个重要的目录:1.配置目录/etc/httpd/conf:2.文档目录/var/www: 二.两种配置模式: Apac ...

  7. Linux下服务器环境的搭建和配置之一——Apache篇

    最近一个多月(2016-06-20开始至今),一直在忙海外广告平台FAQ系统的开发,既要负责服务器环境的搭建,又要写前端,还要写后台和数据库,甚至还要考虑产品需求和设计.所以是一个很大的挑战,对自身也 ...

  8. Linux中Apache服务器的简单配置

    配置Apache服务器: 1.安装Apache,可以参考Linux 中yum的配置来安装: yum install http* -y 2.修改SELinux: setenforce 0 查看: 3.防 ...

  9. Linux+Apache+PHP+MySQL服务器环境(CentOS篇)

    1.前言 CentOS(Community ENTerprise Operating System)是Linux发行版之一,它是来自于Red Hat Enterprise Linux依照开放源代码规定 ...

随机推荐

  1. gets_s()函数的参数太少,strcpy_s():形参和实参 2 的类型不同,等c函数在Visual Studio上出现的问题, get()函数和scanf()读取字符串的区别,栈的随机性

    首先,这些C函数,在VS上要加_s后缀的原因是,这些函数存在字符串越界等问题,可以参考这篇文章,https://blog.csdn.net/silleyj/article/details/854540 ...

  2. 在free bsd上跑JMeter 的 plugin "PerfMon Server Agent"

    在free bsd上跑JMeter 的 plugin "PerfMon Server Agent" 目的: 在free bsd上跑JMeter 的 plugin "Per ...

  3. Zookeeper基本数据模型

    一.Zookeeper基本数据模型 是一个树形结构,类似于前端开发中的tree.js组件 zk的数据模型也可以理解为linux/unix的文件目录  /usr/local/... 每一个节点称之为zn ...

  4. ASP.NET AJAX入门系列(9):在母版页中使用UpdatePanel

    本文简单介绍一下在母版页中使用UpdatePanel控件,翻译自官方文档. 主要内容 1.添加UpdatePanel控件到Content Page 2.通过Master Page刷新UpdatePan ...

  5. Linux crontab配置

    crontab配置 1.命令功能 通过crontab 命令,我们可以在固定的间隔时间执行指定的系统指令或 shell script脚本.时间间隔的单位可以是分钟.小时.日.月.周及以上的任意组合.这个 ...

  6. Java消息机制 ActiveMQ入门实例

    转载自:http://www.cnblogs.com/wyh3721/p/5917316.html 1.下载ActiveMQ 去官方网站下载:http://activemq.apache.org/  ...

  7. Video to SDI Tx Bridge模块video_data(SD-SDI)处理过程

    Video to SDI Tx Bridge模块video_data(SD-SDI)处理过程 1.Top Level Block Diagram of Video to SDI TX Bridge V ...

  8. Vivado HLS初识---阅读《vivado design suite tutorial-high-level synthesis》(2)

    Vivado HLS初识---阅读<vivado design suite tutorial-high-level synthesis>(2) 1.实验目的 2.启动命令行  将命令行切换 ...

  9. Excel技巧--让折线图带面积更直观生动

    上图为带面积的折线图,比单纯的折线图更直观更好看. 制作办法: 1.先制作纯折线图: 2.再复制一遍数据列,选中图表,点击粘贴(ctrl+v): 3.右键图表,点击“更改图表类型”,对话框如下设置: ...

  10. LeetCode——8. String to Integer (atoi)

    一.题目链接:https://leetcode.com/problems/string-to-integer-atoi/ 二.题目大意: 实现一个和C语言里atoi具有相同功能的函数,即能够把字符串转 ...