I have developed an API which is available locally on loc.api and on production on live.api (obviously the domains are just an example).
The API runs locally on a classic apache server.
Now I am playing with Laravel, using this API. No problem connecting to live.api (as I am using the real domain), but fails to connect to my local API.
I am guessing it is just a host config issue, as Homestead fails to connect to my normal apache server on my cumputer.
If that is the case, I should just have to define an IP linked to loc.api, but I have no idea what IP I should use there.
So to recapitulate, no problem running loc.api on my local apache server, no problem running live.api, no problem running Laravel on its own or connected to live.api, but can't seem to get Laravel to work with my loc.api
Any ideas ?
Homestead runs on something akin to a virtual machine. The virtual machine's localhost is indeed the local IP address used internally within the virtual machine. In order to communicate with the host machine (the machine running the virtual machine) you need to use the default gateway IP address. This is the IP address which the virtual machine uses to refer to its host system.
The default varies depending on the configuration of the virtual machine. Ideally, if you've setup your API normally on your localhost and access it locally via 127.0.0.1 (or localhost) then setting your local site configuration to the default gateway will work.
However, if you set up your API through a virtual host and you access it via local.api or some host like this you need to modify your virtual machine's /etc/hosts file (since homestead is serving an Ubuntu OS) and enter a line like
<gateway IP> local.api
This way you can use local.api as your API host address which will resolve to the gateway IP and call the API using the correct hostname.
Related
I have created VM instance for Ubuntu 14.4 and installed Apache2 on it. I created my project set up onto it (project has PHP and Wordpress and m SQL).
I am able to get the access log when I hit it by public IP of VM, but now I wanted to access it by domain name. I have added server name into by own .conf file and linked it to sites-enabled on apache2.
When I hit URL using domain name it only gives 522.
I have enabled port 80, 442 3306 from VM, and added SSL configuration into .conf file and certificates also.
If you want to access the websites on the Azure VM via domain DNS name, you could use either Azure provided DNS name or your custom domain in your DNS domain provider.
For using Azure provided DNS name, you could create FQDN for the Azure VM, restart the Azure VM then you can access the site via its FQDN URL.
For using your custom domain, you could add an A or CNAME record to map the subdomain like www.example.com to your Azure VM IP or FQDN value in the domain example.com. Then you could access the site via URL http://www.example.com. You could get more details about understanding CNAME and A records here.
Here is a tutorial: Install a LAMP web server on a Linux virtual machine in Azure
Hope this could help you.
I have installed xampp on my local machine as well as Windows Server 2008 and Apache and MySql is running on both.
I created a test application which I am running on my local machine.
http://localhost/example/
I want to test this example application on the server. How can I do this?
adding 192.168.1.11/example/(ip address of the server) gives me 404 - File or directory not found.
You would have to move those files over to the server instance. and make a change in your XAMPP configuration to allow the IP of your local machine to connect to the instance.
Do you have physical access to the server instance? (I.E. VM/SSH, In basement)
This question might be helpful if you are looking to allow an external IP.
httpd-xampp.conf: How to allow access to an external IP besides localhost?
I'm a computer engineering student and I've developed a web project for my thesis. I've already developed my project using Xampp in a LAN network. I use Apache in Xampp for Domain name in LAN to access from any other computers. But, however, I've configured any Apache configuration files, my website(example-www.techlibrary.com)can't be call with it's domain name instead of it's ip address(example-192.168.43.10). How can I do this???
When you try to access your Xampp in Local Area with DNS Name, you have to edit your hosts file.
Under Windows you find it in c:\windows\System32\drivers\etc\hosts
Then put this line in it
192.168.43.10 example-www.techlibrary.com
and you can reach on this pc example-www.techlibary.com
There are a few ways to do this :
Set up a local DNS server which will resolve the name for the machines on the network. I recommend using linux. Note that you would have to configure the machines to use this machine as the DNS :
http://www.aboutdebian.com/dns.htm
An easier way to achieve this is to edit the hosts file of your machines if the number of machines is less. Note that you would need admin access for that.
Windows : C:\Windows\System32\Drivers\etc
Linux : /etc/hosts
Edit the file according to the link below.
http://www.rackspace.com/knowledge_center/article/how-do-i-modify-my-hosts-file
I have opened a micro instance on AWS with a Windows_Server-2008-R2_SP1-English-64Bit-Base-2013.11.13 (ami-1e53c82e) virtual machine. RDS is open and I have connected with remote desktop connection. Additionally, at initialization I set HTTP (port 80), and HTTPS (port 443) although I do not know how to verify that now. From within the VM I navigated to XAMPP and installed a default installation (minus MySQL). I then navigated to XAMPP control panel V3.2.1 and started Apache. I set a password on XAMPP directory. I set a "Hello World" test txt file in htdoc and that loads in the VM browser. However, when I try to access the pubic IP, my local browser times out.
I think I covered the first three checks on
"xampp configuration in windows server 2008 r2 ec2 instance" post
but not sure how to change the elastic or private IP response if that is relevant.
If you're using VPC, you have to allow both inbound/outbound in the network ACL and inbound for the security group. You probably also have to open the ports in the windows firewall.
Edit: You definitely don't want to disable the firewall altogether. Also, it doesn't matter whether you use public ips from within AWS. And public host names resolve locally anyway.
Hello I have a problem in accessing the localhost in my android device. I can't open my localhost in my browser. I installed an application that supports httpd, php and mysql. But when I have a connection in the Internet there's no error in displaying the localhost. But if I disable it, I can't open the localhost. Is there a configuration file that I need to configure in my device? I am using ICS. I am using 127.0.0.1 as my localhost I also did 127.0.0.1:8080 but it doesn't work also.
If you're trying to access your web server over your local network, then you'll need to bind the web server to an IP address that the device can access - this is not 127.0.0.1. Assuming you're on wifi with your android, you'll want to have your web server listen to something along the lines of 192.168.1.X. If you use 0.0.0.0 it will accept on all interfaces, this should work as well. Either case, you'll need to access your web server from your device using your web server's local IP address, not localhost and not 127.0.0.1
Localhost as the url in a browser should access the server running on that device.it sounds to me maybe you are connected to a remote desktop or something. Tcp/ip utilities in particular try tracert localhoast or route. config /release maybe your touting tables are messed up,weird
The localhost refers to the device on which the code is running, in this case the emulator.
If you want to refer to the computer which is running the Android simulator, use the IP address 10.0.2.2 instead 127.0.0.1. You can read more from here.
I encountered the same problem while working with my localhost too. The problem turns out to be with the antivirus that i was using. I was able to access my locahost again after turning the antivirus off. But because i cannot continue using my machine without an antivirus I just have to change the antivirus to another one. It worked for me, Hope it will for you too.