0
点赞
收藏
分享

微信扫一扫

启动httpd服务卡住

近期安装了两次httpd服务,重启httpd服务是卡住,查看状态发现:could not reliably determine the server's fully qualif domain name。

服务httpd启动卡住,报错domain name

主机系统环境:centos7.6

安装:yum  install httpd

配置:未作任何修改,直接启动服务

启动服务: systemctl  start  httpd

问题现象:启动httpd服务时卡住,且无法启动服务

正在启动httpd:httpd:could not reliably determine the server's fully qualif domain name,using::1 for servername

正在启动httpd:httpd:could not reliably determine the server's fully qualif domain name,
using::1 for servername

启动httpd服务卡住_启动httpd卡

解决方法:修改配置--注释 #ServerName www.example.com:80

启动httpd服务卡住_httpd中Alias配置_02

改成  ServerName   localhost:80     ##去掉前面的注释符号

启动httpd服务卡住_启动httpd卡_03

重启httpd成功

启动httpd服务卡住_httpd中Alias配置_04


别名网页配置

查看http版本

Server version: Apache/2.4.6 (CentOS)

Server built:   Mar 24 2022 14:57:57

别名配置的目录/etc/httpd/conf.d目录下有一个配置文件autoindex.conf

通过修改autoindex.conf中Alias关键字进行别名配置。如默认配置中例子

21 Alias /icons/ "/usr/share/httpd/icons/"
22 
23 <Directory "/usr/share/httpd/icons">
24     Options Indexes MultiViews FollowSymlinks
25     AllowOverride None
26     Require all granted
27 </Directory>

启动httpd服务卡住_启动httpd卡_05

复制这几行,创建新的目录进行配置,例如

Alias /mytest/ "/shared_dir/"

<Directory "/shared_dir/">
    Options Indexes MultiViews FollowSymlinks
    AllowOverride None
    Require all granted
</Directory>

启动httpd服务卡住_启动httpd卡_06

测试验证  访问ip地址下的目录mytest。  http://10.195.52.4/mytest/

启动httpd服务卡住_httpd中Alias配置_07




举报

相关推荐

0 条评论