Hosting your website on your LAN - easyphp

There's this little issue i have. my website has been hosted on the intranet before using easyphp but now, i want to host it but with a name like samuel.org such that if i connect to the same network my computer(which is the server) is on and you enter samuel.org, it takes you to my developing site. Thanks in advance. By the way, virtual host has been tried.

Editing your local host file should accomplish this.
On Windows you can go to %SystemRoot%\system32\drivers\etc\hosts and add it like so:
127.0.0.1 domain.com
And as for linux, you can go to /etc/hosts and edit that file and do the same

Related

Redirect/rewrite to different internal IIS sites using query string

EDIT: Ugh I forgot to put this on Server Fault...
I have an Azure VM that is hosting a web application.
The application will be accessible via the VM's IP address:
http://191.238.112.62
I want to be able to use query strings to redirect to completely different sites that are within the local IIS. For example:
http://191.238.112.62/?site=1
would redirect to
www.site1.com
The way I have structured IIS can be seen below:
Each site has an entry in the systems host file.
127.0.0.1 wwww.site1.com
127.0.0.1 wwww.site2.com
127.0.0.1 wwww.site3.com
There is likely a better way to achieve what I am going for here so any pointers would be greatly appreciated.
Thanks.
Here is how I would do it. Not sure why you want to use query strings for this as IIS is made to do that if you configure it properly.
In your DNS server register all your websites to point to that IP. This is for when you go live. For development the hosts file is a good solution.
When you create the websites add a Host header like below
Now try loading any website by their full name
http://www.site1.com
http://www.site2.com
http://www.site3.com
Here is more info about IIS host headers.
Again, when you go live make sure you have the DNS set up for all the websites to point to the IP address of your server.
Hope this helps.
Edit based on comment:
Right, here is how I solved this in the past.
You can do all this with the hosts file but it's less painful if you have a proper DNS server to resolve the names.
The basic idea is to use slightly different URLs for development on the local machine.
All devs would have site1.com point to the IP of the shared server and site1.com.local point to 127.0.0.1. So a hosts file on a developer machine would look something like:
191.238.112.62 www.site1.com
127.0.0.1 www.site1.com.local
On all development machines you need to make sure you have the .local host header for all sites.
On the shared server you just need to add the right host headers and no hosts file changes. It's actually a bad idea to change the server hosts file.

rdp web client of virtualbox

thank you for reading my question.
I want to login the virtual machine romotely through rdpweb shipped with virtualbox sdk.Of course, the virtual machine was installed in the virtualbox.The rdpweb(a folder) contains 4 files, webclient3.html, swfobject.js, webclient.js and RDPClientUI.swf.
Firstly, I copy rdpweb to the /.../tomcat/webapp. So i can visit webclinet3.html now. And there is a image which shows what i get.Sorry, i haven't enough reputation for posting a image.I just can put a link to the image.
http://i.minus.com/jbdHDzjWwQntWQ.PNG
An error happened. Google says that putting the crossdomin.xml to the root of webapp would solve the bug.The bug may be aroused by flash.But it is invalid for me. Why ?
My physical host is win7(ip:192.168.1.107), and my virtual guest is windowsxp(ip:192.168.1.111). The version of the virtualbox is 4.1.8.
Any help would be appreciated!Thank you very much.
I am so sorry for my poor english.
Update:
Your configuration looks like you have configured your WinXP guest with a bridged network adapter, and you are trying to connect directly to it. Have you enabled Remote Desktop on the WinXP guest? Go to the Control Panel -> System applet, then choose the remote tab and be sure to check both boxes to allow remote desktop connections. You will also need to make sure the firewall will allow this connection to the guest.
VirtualBox also have the capability to serve up a virtual machines display over RDP or VNC (VNC in the OSE - Open Source Edition). If you are wanting to use that capability then you should be connecting to the HOST IP address - not the guest. Since your host is Windows 7 you will also need to adjust the Remote Display Server Port for your guest (in the VM Settings in VirtualBox) to use a port besides 3389. I usually pick 3390. Your screenshot doesn't show somewhere you can enter the TCP port, so this approach may not be supported, but you could try appending :3390 to the IP address.
Original Answer:
Could you post the crossdomain.xml file you are currently using? This is almost certainly a problem with it.
My guess is that your crossdomain.xml file should look something like this:
<?xml version="1.0"?>
<!-- http://127.0.0.1:8080/crossdomain.xml -->
<cross-domain-policy>
<allow-access-from domain="192.168.1.111" />
</cross-domain-policy>
You could start with just putting * instead of the IP address in the file as well - though that is generally not recommended as it opens the possibility that the flash player can access any resource on any network. It would make it easier to access other virtual machines you might use in the future with different addresses.

Viewing a local web site on the LAN under a different hostname

In short I'm trying to browse a Mac's web site on the local wifi network under a .local hostname that is not the same as the machine's 'computer name' and think I'm missing a setup step.
I have a local install of nginx on my Macbook, with the proper /etc/hosts and nginx.conf entries to serve multiple sites, each with their own distinct local hostname. Assume the Macbook's network name is computername.local, and I have 2 sites running, one at http://computername.local and another at http://servicename.local. I can access each of these sites just fine from the local machine, but also want to be able to access http://servicename.local from an iPhone on the same WiFi network. I'm getting a timeout for that URL, but the other one works just fine.
I'm guessing something has to be done to allow servicename.local to be used on the local network, which I've left out. What is required to do that? Do I need to use Bonjour for that? Where would I add this new local hostname?
Another Mac on the same network can access this one under servicename.local just fine if I define the IP in its /etc/hosts file too, but I can't modify that file on the iPhone obviously. It's not jailbroken, and I'm not really interested in doing that just to get this working.
Not sure if it will help the OP, but another way of doing this - besides running a DNS server or jailbreaking the phone - is to run an HTTP proxy on the Mac, and configure the iPhone to use the proxy. Then the iPhone will pick up the Mac's local hosts file entries because it resolves DNS queries through the proxy. I've blogged about how to do this using the free Mac proxy "SquidMan" here: http://egalo.com/99j

make virtual host available through local network for iphone

I'm building a site on my localhost with a virtual host (mynewsite.com). Instead of uploading files to an actual server and I'd prefer to just test locally. I have the virtual host working on my desktop, I just want it to be available so I can see it on my iPhone or any computer on my network. So if I go to mynewsite.com on my iPhone it will display the site from my localhost. I think I need to do port forwarding but I'm having difficulty figuring it out. I'm on a Mac with MAMP.
How do I make the virtual host available to my iPhone through my Linksys router for testing?
My httpd.conf in MAMP looks like:
<VirtualHost *:80>
DocumentRoot "/Users/jaysonp/Sites/mynewsite"
ServerName "mynewsite.com"
ServerAlias *.mynewsite.com
...
Then in my host file I have:
127.0.0.1 mynewsite.com
I should note that I can't just hit the ipaddress on my iPhone, there is code that checks against the domain name for the site to work.
Thanks!
Please see my answer here. But basically, you just have to modify the Wifi settings in your iPad to use the IP address of your development machine as an HTTP proxy.
You can use application to edit hosts file on the devices. Use iFile application. You can add more any hostname. You can see some picture here but I wrote in my language.
http://www.anop72.info/iphoneipad-เรียก-url-vhost-ทำอย่างไร/
Hope this helps.
You just need to change the host file of respective machine on which you want to see your virtual host.
For Example:
(in Linux and macOS ): /etc/hosts
(in Windows ): c:/windows/system32/drives/etc/hosts
(in Android ): Android is also the part of linux so the host file location is same in android too. But you need root access to change the host file.
(in iOS ): (anyone who knows can edit here!!)
Open the host file and
192.168.1.70 mynewsite.com
192.168.1.70 is the ip address of the machine in which your project is running on a virtual hosting -> mynewsite.com
All of the other devices must be connected to the same network .
Just use the IP address of your virtual host. If your iPhone is on the same local network as your [virtual] host - the IP address will work fine.
I am not quite sure how you are defining "virtual" host - i.e. are you using Xen or VMware or something - or just running a web service on your dekstop?
If it is the former - you need to set up the IP services through Xen/VMware - if it's the later - its you desktop machine's IP address.

How to serve a website over a wifi without internet?

I want to serve a website over an open wifi connection but I do not want this wifi connection to have access to the internet. Is this possible and how would I go about doing it.
I have setup websites locally and have gotten access in the browser through localhost or the IP address but I am not sure how I would go about setting up a webserver and serving the website via wifi.
Any insight on this?
you can access your machine's localhost via any computer easily, as long as that computer is connected to the said wifi.
get your computer name, and access it from other machine like this:
http://<your_computer_name_here:port_if_applicable>/website_folder_name
I do this to test my websites on mac and windows at home. My windows machine is called "The-Genius" and I access it via my mac like this:
http://The-Genius/Test/
which leads to the IIS.. if I want to access Apache, which is on port 78, I do this:
http://The-Genius:78/Test/
Hope it helps..
If you are using a wifi router, you don't have to do anything to get this to work. Whenever a client connects over wifi, they will be able to type in your webserver's IP address to see the website. If you want to use a DNS name then you might be able to set up the DNS names on the router itself.
Based on #LocustHorde's answer,
I tired the pc's IP address instead of using the pc name.
This worked fine for me...
http://172.168.1.21:8080/test/aa.php