LAMP的301跳转没有成功求助

回复 收藏

实现访问www.aaa.com跳转到www.test.com上去

1.配置虚拟主机配置文件:

[root@localhost ~]# vim /usr/local/apache2/conf/extra/httpd-vhosts.conf

 QQ截图20170301102158.png

 

2.[root@localhost ~]# apachectl -t

httpd: Could not reliably determine the server's fully qualified domain name, using localhost.localdomain for ServerName

Syntax OK

 

 

3.[root@localhost ~]# apachectl restart

httpd: Could not reliably determine the server's fully qualified domain name, using localhost.localdomain for ServerName

httpd not running, trying to start

(98)Address already in use: make_sock: unable to listen for connections on address [::]:80

(98)Address already in use: make_sock: unable to listen for connections on address 0.0.0.0:80

no listening sockets available, shutting down

Unable to open logs

4.由于apache无法重启,所以重启虚拟机

5.输入www.aaa.com还是没有跳转到www.test.com上去

 QQ截图20170301102115.png

 

 

 

2017-03-01 10:19 举报
已邀请:
0

阿铭 管理员

赞同来自:

今天我在问题提问区回复的不知道是不是你的。  

你应该是启动了 rpm的httpd。 ps uax |grep httpd  看下进程。 

启动、重启的时候,尽量用绝对路径吧,  /usr/local/apache2/bin/apachectl 

0

漂流

赞同来自:

[root@localhost ~]# /usr/local/apache2/bin/apachectl restart 

我现在重新使用了这个命令,没有报错。但是还是输入www.aaa.com还是没有跳转到www.test.com上面去

0

阿铭 管理员

赞同来自:

那还得检查  /usr/local/apache2/bin/apachectl  -M  模块列表里有没有rewrite

回复帖子,请先登录注册

退出全屏模式 全屏模式 回复
评分
可选评分理由: