nginx - Vagrant - centos 网络

标签 nginx centos vagrant centos7

我已经用这个配置设置了一个 Vagrant 机器 --

Vagrant.configure("2") do |config|
  config.vm.box = "intprog/centos7-ez6"
    config.ssh.insert_key = false
    config.vm.network "public_network", ip: "192.168.33.243"
    config.vm.provision "file", source: "/server/bin/nginx/conf/domains-enabled/cemcloudMigration.conf", destination: "~/cemcloud.conf"
    config.vm.provision "shell", path: "webroot/bootstrap/script.sh"
end

这就是我的脚本的样子 -- sudo su

#update the centos version
#yum update -y

yum -y erase httpd httpd-tools apr apr-util
#getting nginx from the right address
yum install -y http://http://nginx.org/packages/centos/7/x86_64/RPMS/nginx-1.10.0-1.el7.ngx.x86_64.rpm
yum install -y nginx

#installing composer
curl -sS https://getcomposer.org/installer | php
chmod +x composer.phar
mv composer.phar /usr/bin/composer

cd /srv/www/cemcloud2
composer install

#removal of old mariadb5.5 and installation of the new one
yum -y remove mariadb-server mariadb mariadb-libs
yum clean all
yum -y install MariaDB-server MariaDB-client

#clear unnecessary software
yum -y remove varnish

## restart the service
service mysql restart
service php-fpm restart
service nginx restart

/var/log/nginx/access.log 正在产生这个——

10.0.2.2 - - [17/Oct/2016:11:42:10 +0000] "GET / HTTP/1.1" 301 185 "-" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:51.0) Gecko/20100101 Firefox/51.0" "-"

nginx 的行为非常奇怪,因为它有时会生成日志,有时不会。当我打开我的 firefox 开发人员时,它会生成日志,而当我使用 google chrome 时,它​​不会。

每次我将 URL 输入浏览器时,它都会显示

the connection has timed out.

无论如何我想连接到这台机器。我究竟做错了什么 ??

最佳答案

请在访客机器上检查您的网络:

nmap -sT -O localhost

检查您在 nginx 配置中使用的端口是否打开。 如果没有,请在防火墙中打开它们并再次检查。

关于nginx - Vagrant - centos 网络,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40086201/

相关文章:

macos - Vagrant 插件和 nokogiri 安装问题

vagrant - 将项目从 VM 导入到 IntelliJ

php - NGINX/PHP 下载而不是执行

linux - 取决于 : libssl0. 9.8 (>= 0.9.8m-1) 但它不可安装

php - 带有php服务器的html中的相对路径

jenkins - 来自守护程序 : chtimes/var/lib/docker/tmp/docker-export-$: invalid argument 的错误响应

linux - 无法在本地浏览器访问ip地址

vagrant - 如何加快我的 puppet 模块开发-测试周期?

php - 在共享内存中记录访问

PHP:重命名没有扩展名的文件