N
N
Nikita2014-08-19 12:04:02
PHP
Nikita, 2014-08-19 12:04:02

How to set up PHP via fastCGI/Nginx in ubuntu server 14.04 in virtualbox with access forwarding from host machine?

We have Host machine Xubuntu 14.04 in it Virtualbox 4.3.10 in which ubuntu server 14.04 is raised. Two hosts are forwarded to the guest one, the first through NAT, which is created by default by virtualbox, the second is static, forwarded according to the instructions yapro.ru/web-master/unix/virtualbox-statichniy-ip.html .
There is access via ssh from the host to the guest. Next, Nginx + fastCGI is configured in the guest. Access to fastCGI goes through the port, listen = 127.0.0.1:9000 is written in pool.d/www.conf, in the nginx config:

include fastcgi_params;
fastcgi_pass 127.0.0.1:9000;
fastcgi_param DOCUMENT_ROOT /var/www/site.local;
fastcgi_param SCRIPT_FILENAME $document_root/$fastcgi_script_name;

Through lynx in the console of the guest OS, the site opens, how to open from the host?
I forgot to add that in the Nginx logs this error:
recv() failed (104: Connection reset by peer) while reading response header from upstream, client

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Sergey, 2014-08-19
Protko @Fesor

You need to configure the network via host-only so that the guest machine will ping from the host. Then you can directly access the IP of the guest machine from the host browser.
php has nothing to do with it. You only need to reach nginx, everything else is already working within the virtual machine. If you want to use xdebug remotely, again, there is no problem if you have set up a network.

A
Alexey Skobkin, 2014-08-20
@skobkin

Configure Nginx according to the manual from the official site. The virtual machine can be configured in different ways. For example, hang it on a bridge and forward ports with a firewall from a host or router to this virtual machine. Here, however, the details are lacking.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question