user7030890
user7030890

Reputation:

Vagrant - centos networking

I have set up a Vagrant machine with this configuration --

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

This is how my script looks like -- 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 is producing this --

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" "-"

Really strange behavior from nginx because it some times produces log and sometimes it doesn't. When I open up my firefox developer it produces log and when I am on google chrome it doesn't.

Every time I put in the URL into browser it says

the connection has timed out.

Anyhow I want to get connected to this machine. What am I doing wrong ??

Upvotes: 3

Views: 517

Answers (2)

Oliver
Oliver

Reputation: 893

Please check your network on the guest-mashine with:

nmap -sT -O localhost

Check if the ports your are using in your nginx configuration are open. If not, open them in your firewall and check again.

Upvotes: 3

user7030890
user7030890

Reputation:

It was a firewall issue inside this machine "intprog/centos7-ez6". It wasn't listening to the port https. I have followed those steps:

  1. firewall-cmd --add-service=https
  2. firewall-cmd --add-service=https --permanent
  3. firewall-cmd --reload

and it all worked.

Upvotes: 1

Related Questions