Vagrant 流浪汉:192.168.33.10拒绝连接

Vagrant 流浪汉:192.168.33.10拒绝连接,vagrant,vagrantfile,Vagrant,Vagrantfile,您好,我通过vagrant在虚拟机中安装了centOS6,还安装了httpd和php 但是,当我试图访问我在Vagrant文件中设置的ip地址时,我无法打开网页 我在/var/www/html目录下创建了一些文件 $ cd /var/www/html/ $ ls index.html test.php 这是我在Vagrant文件中更改设置的地方 # Create a forwarded port mapping which allows access to a specific port

您好,我通过vagrant在虚拟机中安装了centOS6,还安装了httpd和php

但是,当我试图访问我在Vagrant文件中设置的ip地址时,我无法打开网页

我在/var/www/html目录下创建了一些文件

$ cd /var/www/html/
$ ls
index.html  test.php
这是我在Vagrant文件中更改设置的地方

  # Create a forwarded port mapping which allows access to a specific port
  # within the machine from a port on the host machine. In the example below,
  # accessing "localhost:8080" will access port 80 on the guest machine.
  config.vm.network "forwarded_port", guest: 80, host: 8080

  # Create a private network, which allows host-only access to the machine
  # using a specific IP.
  config.vm.network "private_network", ip: "192.168.33.10"
$ which httpd
/usr/sbin/httpd


[vagrant@localhost ~]$ sudo service httpd status
Redirecting to /bin/systemctl status  httpd.service
httpd.service - The Apache HTTP Server
   Loaded: loaded (/usr/lib/systemd/system/httpd.service; disabled)
   Active: active (running) since Sun 2016-05-08 18:44:38 EDT; 53s ago
     Docs: man:httpd(8)
           man:apachectl(8)
 Main PID: 3180 (httpd)
   Status: "Total requests: 0; Current requests/sec: 0; Current traffic:   0 B/sec"
   CGroup: /system.slice/httpd.service
           ├─3180 /usr/sbin/httpd -DFOREGROUND
           ├─3181 /usr/sbin/httpd -DFOREGROUND
           ├─3182 /usr/sbin/httpd -DFOREGROUND
           ├─3183 /usr/sbin/httpd -DFOREGROUND
           ├─3184 /usr/sbin/httpd -DFOREGROUND
           └─3185 /usr/sbin/httpd -DFOREGROUND

May 08 18:44:37 localhost.localdomain httpd[3180]: AH00558: httpd: Could not reliably determine the server's fully qualifie...ssage
May 08 18:44:38 localhost.localdomain systemd[1]: Started The Apache HTTP Server.
Hint: Some lines were ellipsized, use -l to show in full.
httpd正在运行中

  # Create a forwarded port mapping which allows access to a specific port
  # within the machine from a port on the host machine. In the example below,
  # accessing "localhost:8080" will access port 80 on the guest machine.
  config.vm.network "forwarded_port", guest: 80, host: 8080

  # Create a private network, which allows host-only access to the machine
  # using a specific IP.
  config.vm.network "private_network", ip: "192.168.33.10"
$ which httpd
/usr/sbin/httpd


[vagrant@localhost ~]$ sudo service httpd status
Redirecting to /bin/systemctl status  httpd.service
httpd.service - The Apache HTTP Server
   Loaded: loaded (/usr/lib/systemd/system/httpd.service; disabled)
   Active: active (running) since Sun 2016-05-08 18:44:38 EDT; 53s ago
     Docs: man:httpd(8)
           man:apachectl(8)
 Main PID: 3180 (httpd)
   Status: "Total requests: 0; Current requests/sec: 0; Current traffic:   0 B/sec"
   CGroup: /system.slice/httpd.service
           ├─3180 /usr/sbin/httpd -DFOREGROUND
           ├─3181 /usr/sbin/httpd -DFOREGROUND
           ├─3182 /usr/sbin/httpd -DFOREGROUND
           ├─3183 /usr/sbin/httpd -DFOREGROUND
           ├─3184 /usr/sbin/httpd -DFOREGROUND
           └─3185 /usr/sbin/httpd -DFOREGROUND

May 08 18:44:37 localhost.localdomain httpd[3180]: AH00558: httpd: Could not reliably determine the server's fully qualifie...ssage
May 08 18:44:38 localhost.localdomain systemd[1]: Started The Apache HTTP Server.
Hint: Some lines were ellipsized, use -l to show in full.
我对网络不太了解

我如何解决这个问题? 有人能教我吗

附加信息-完整文件
第一:使用固定IP时不需要转发端口;实际上,您将直接从固定IP到达80端口

因此,请删除转发端口并重试

第二:不清楚以下错误

五月八日18:44:37 localhost.localdomain httpd[3180]:AH00558:httpd: 无法可靠地确定服务器的完全合格消息


您是否在conf文件中使用localhost作为服务器名称?如果您确实删除了它并让apache进行配置和绑定

您是否可以发布完整的配置文件。请随意掩盖任何机密信息。谢谢您的帮助!我添加了完整的Vagrant文件。我看到配置文件有一些错误;当我退出vagrant ssh时,它显示到127.0.0.1的连接已关闭。应该是这样吗?[vagrant@localhosthtml]$exit到127.0.0.1的连接已关闭。我刚刚在帖子底部添加了我在执行“流浪者行动”时得到的内容。谢谢你的支持。