安装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. taro 消息机制

    Taro 提供了 Taro.Events 来实现消息机制,使用时需要实例化它 同时 Taro 还提供了一个全局消息中心 Taro.eventCenter 以供使用,它是 Taro.Events 的实例 ...

  2. JFrame添加组件

    jframe.add(button) 与 jframe.getContentPane().add(button) 结果是一样的, 都是将组件添加到jframe自带的容器ContentPane中.

  3. mysql show master status为空值

    问题 执行show master status,输出结果为空: mysql> show master status; Empty set (0.00 sec) 原因 mysql没有开启日志. 查 ...

  4. dragino2 ar9331将LED管脚当做普通gpio使用

    1. 将gpio13和gpio17也当作普通gpio使用,修改 target/linux/ar71xx/files/arch/mips/ath79/mach-dragino2.c文件如下 /* * D ...

  5. 2015.4.21第一篇cnblog文章

    个人学习记录第一篇. 输出才是最好一条途径,这也是开源的精神所在.

  6. C# 生成时间戳

    编写网络程序中难免用到一些时间戳. 早前不知道哪里复制过一个代码,如下: public static string GetTimeStamp() { TimeSpan ts = DateTime.Ut ...

  7. gitlab 10.8.1 迁移

    参考官网: https://docs.gitlab.com/ee/raketasks/backup_restore.html    Backing up and restoring GitLab 及 ...

  8. Excel导出文件流下载

    Controller.cs @CrossOrigin(allowCredentials="true", allowedHeaders="*", methods= ...

  9. 【Git】Git使用--常用命令

    查看所有分支 git branch -a 查看本地分支 git branch 切换分支 git checkout test demo git checkout release_1.3.1 (切换到re ...

  10. .NET使用HttpRuntime.Cache设置程序定时缓存

    第一步:判断读取缓存数据 #region 缓存读取 if (HttpRuntime.Cache["App"] != null) { return HttpRuntime.Cache ...