首页 技术 正文
技术 2022年11月20日
0 收藏 362 点赞 4,398 浏览 1024 个字

centos7安装apache http server启动失败
    
除了nginx可以开启http服务外,apche http server也可以开启http服务,安装过程如下:
1、 首先,检测是否安装过

httpd -version
2、安装http服务器。在centos里面,我们只需要执行:

yum install httpd
3、看到安装完成之后,我们执行:

httpd -version
如果能看到输出的版本信息,则说明安装成功。

4、启动http服务器,

service httpd start
出现如下错误:

centos7安装apache http server启动失败–Failed to start The Apache HTTP Server.

5、如果出现“address already in use”则我们需要修改我们的端口,上图中是无法绑定88端口,也需要再次修改端口号,执行:

vi /etc/httpd/conf/httpd.conf
进入配置文件后,修改配置文件的此处为

centos7安装apache http server启动失败–Failed to start The Apache HTTP Server.

6、执行semanage port -l|grep http命令

centos7安装apache http server启动失败–Failed to start The Apache HTTP Server.

图中出现的端口号才是可以绑定的端口号,也就是说42行处的端口号可以改为红圈内端口号,80冲突可以换81,当然我们也可以增加端口号,很多blog都是杀掉该进程,但是这不是一种好的解决办法。

7、现在执行命令semanage port -a -t http_port_t -p tcp 888 #增加这个888非标准端口即可,执行之后我们就可以在42行改为888这个端口了。

8、启动http服务,启动命令是

service httpd start
停止是stop,重启是restart
9、效果如图

centos7安装apache http server启动失败–Failed to start The Apache HTTP Server.

说明启动已经成功,而不是杀进程的方式。

  1. 2.安装完成后我们需要先启动httpd服务,然后再查看一下默认情况下httpd服务所使用的端口及进程,如下图

    centos7安装apache http server启动失败–Failed to start The Apache HTTP Server.

  2.  

    3.然后打开浏览器在浏览器中输入localhost或者是当前服务器的IP地址都可以,就可以看到httpd的欢迎页面

    centos7安装apache http server启动失败–Failed to start The Apache HTTP Server.

  3.  

    4.通过rpm -qi 命令可以查看安装软件的详细信息,通过whereis 可以查看软件安装目录的详细信息

    centos7安装apache http server启动失败–Failed to start The Apache HTTP Server.

  4.  

    5.在httpd的配置文件中我们可以看到端口号和网站根目录等一些信息,在修改配置文件之前建议先备份一下,如下图

    centos7安装apache http server启动失败–Failed to start The Apache HTTP Server.centos7安装apache http server启动失败–Failed to start The Apache HTTP Server.centos7安装apache http server启动失败–Failed to start The Apache HTTP Server.

  5.  

    6.备份完成后我们在网站根目录下建立一个测试文件,然后在浏览器中进行访问可以看到如下效果

    centos7安装apache http server启动失败–Failed to start The Apache HTTP Server.centos7安装apache http server启动失败–Failed to start The Apache HTTP Server. 

———————
作者:演员赵诗绎
来源:CSDN
原文:https://blog.csdn.net/u013144287/article/details/78417793
版权声明:本文为博主原创文章,转载请附上博文链接!

相关推荐
python开发_常用的python模块及安装方法
adodb:我们领导推荐的数据库连接组件bsddb3:BerkeleyDB的连接组件Cheetah-1.0:我比较喜欢这个版本的cheeta…
日期:2022-11-24 点赞:878 阅读:8,956
Educational Codeforces Round 11 C. Hard Process 二分
C. Hard Process题目连接:http://www.codeforces.com/contest/660/problem/CDes…
日期:2022-11-24 点赞:807 阅读:5,480
下载Ubuntn 17.04 内核源代码
zengkefu@server1:/usr/src$ uname -aLinux server1 4.10.0-19-generic #21…
日期:2022-11-24 点赞:569 阅读:6,327
可用Active Desktop Calendar V7.86 注册码序列号
可用Active Desktop Calendar V7.86 注册码序列号Name: www.greendown.cn Code: &nb…
日期:2022-11-24 点赞:733 阅读:6,110
Android调用系统相机、自定义相机、处理大图片
Android调用系统相机和自定义相机实例本博文主要是介绍了android上使用相机进行拍照并显示的两种方式,并且由于涉及到要把拍到的照片显…
日期:2022-11-24 点赞:512 阅读:7,741
Struts的使用
一、Struts2的获取  Struts的官方网站为:http://struts.apache.org/  下载完Struts2的jar包,…
日期:2022-11-24 点赞:671 阅读:4,776