setting up symfony ubuntu on virtual machine from mac - symfony

Is it possible to run Symfony dev on a virtual machine?
In the config.php it queries the request uri, if not 127.0.0.1 in errors and says it can only be configured on localhost.
How do i get around this?

There is a good reason for that - config and app_dev are private resources and should only be ran from localhost.
Since you want to run your dev from VM Host (rather than VM Guest) you should just add your interface address to both config.php and app_dev.php.
For example, I have set up VMWare which allocated the address 192.168.78.10 to my VM Guest. My VM Host is at 192.168.78.1 (first address in that network). So you need to add 198.168.78.1 to both of those files.

Alternatively, you can comment out the line judging the IP (127.0.0.1) in app_dev.php.
Sometimes it is worthy to do so especially when everything is fine in the local env but fails in the actual prod env.

Related

Jupyter notebook inside WSL

When running jupyter notebook inside a conda virtual enviornment in wsl (Windows subsystem for linux), copy pasting the url wont work. It always shows "It took too long to respond" or "Connection timed out".
• Try in another browser (e.g. if you normally use Firefox, try with Chrome). This helps pin down where the
problem is.
• Try disabling any browser extensions and/or any Jupyter extensions you have installed.
• Some internet security software can interfere with Jupyter. If you have security software, try turning it off
temporarily, and look in the settings for a more long-term solution.
• In the address bar, try changing between localhost and 127.0.0.1. They should be the same, but in some
cases it makes a difference.
I ran into a similar problem but I wasn't using a virtual environment. Are you trying to connect to the server from the host computer? And are you using the private IP address or localhost address to connect?
I couldn't connect to the server on WSL from the local or remote network.
Apparently, WSL 2 uses a virtual network adapter that has its own IP address. It also changes the IP address every time the server is restarted. I had to write a script that forwarded the network traffic from the virtual machine to the host computer. This allowed me to access the server using the private IP address of the host computer.
I wrote an article about how to do it to make it easier for everyone:
How to Set Up the Jupyter Notebook Home and Public Server On Windows Subsystem for Linux 2 (WSL2)

Accessing a local website from another computer inside the local network in IIS 10

On my computer I have deployed my web site on IIS. If I access this website locally with :8080 works perfect, but when I try to access this site from another machine or my Android phone I get 'The site can't be reached. my_ip_address took too long to respond ERR_CONNECTION_TIMED_OUT –' this error.
I have tried solutions from this question, but nothing worked for me. Need some help!
There are few factors which can affect the accessibility of the site hosted on your local computer:
Is the client machine (including your phone) in the same network as the Server (In this case your site)
Is the firewall configured to allow connections on port 8080
Have you tried accessing the server using the IP Address. For e.g. http://192.168.0.1:port
Steps to isolate
Ping the server Ip from the client machine and see if it is able to connect to it.
ping 192.168.0.1
If the above fails, then I would assume that you are not on the same network. If it succeeds then check if the port is open.
You can also use nmap to see whether the ports are open or not
nmap -p 8080 kaushal.com
If the above fails, then open the port in your Firewall configuration and then try again.
Try this and share the results.

Port 8080 redirect troubles with Wordpress in a Vagrant VM

So I have a problem with Wordpress running in a Vagrant VM. The VM is an Ubuntu box, precise32, running under VirtualBox. It's configured for a private network, with no specific port forwarding rules:
config.vm.network "private_network", ip: "192.168.33.10"
The VM has a basic LAMP stack, with no added config -- no virtual hosts, for example.
From the host machine I can reach standard resources on the VM via HTTP just fine: the basic index.html, or anything I care to put into subdirectories.
I have WordPress installed into /wordpress. When I try to access
http://192.168.33.10/wordpress
from a browser on the host, I get redirected to
http://192.168.33.10:8080/wordpress
Which fails, because nothing is listening there.
When I create a specific hostname for the VM and add it to my hosts /etc/hosts file and access WP via the host name, I get the same result.
References I can find are mostly to do with running WP behind a reverse proxy. But I'm not doing that -- unless something in my Vagrant setup means I really am and just don't know it.
Any ideas?
I suggest to use port 8080 both in the guest and the server. Configure the webserver to listen on port 8080 and map that port to Vagrant host via forwarded_port.

Accessing local IP address via a hostname

How can I access a local network IP address (e.g. 192.168.1.91) via a hostname from another machine in the same network (e.g. localhost)?
The reason I want to do this is because my local server running my development application can be accessed from other machines via the IP, however the web app is Dependant on the host name remaining consistent.
You can see where the problem arises when the server is told to fetch images and scripts that rely on the host being localhost and not 192.168.1.91.
I'd suggest that you use localhost only to refer the loopback address (127.0.0.1).
In your case best option would be to register the server in DNS (e.g. test-server.example.com).
If you don't have access to DNS you should be able to use hosts files instead. Just add the following line to your hosts file on all computers that need to access the server:
192.168.1.91 test-server.example.com
hosts file can be found in /etc/hosts in Linux and in %WINDIR%\system32\drivers\etc\hosts in Windows.

HTTP request from one Virtual machine to another

I have started 2 virtual machines in my computer (using VirtualBox on Windows 8.1) in same time. On first i have Linux Debian with Apache http server. On second running Windows XP. Both networks are set as NAT.
Http request must have specific URL (for example: "xxx.local"). So when I try connect from my real computer to virtual machine with Linux server its easy and its work, there I add only redirect for domain "xxx.local" to virtual machine IP and everything working fine.
But I need send request and receive reply from second virtual machine with Windows XP.
Is there any way to do that?
You can add additional network adapters to both VMs attached to one host-only network.
Ok I got it. There is important to set "host only network adapter" for both virtual machines (but not the same one!) with same IP radius. Then you set IP of server machine to target domain in host file and that is all.
Works fine :-)

Resources