Jump to content

Virtualbox: Webserver in VM


GeekGoneCrazy
 Share

Recommended Posts

Running a bit low on funds and my bluehost account is expiring shortly. So i'd like to setup a Virtual Machine on my mac mini and run the web server on it. At least till I can get another hosting plan or setup an ESXi box.

Everything is cool locally, but I can't seem to grasp what needs to be done to make the virtual machine accessible to the web. I set virtualbox to use the bridged connection and I've opened port 80 and the usual web ports pointing to the ip of the virtualbox. But still nothing. Any ideas how I can go about doing this?

Thanks,

Link to comment
Share on other sites

Running a bit low on funds and my bluehost account is expiring shortly. So i'd like to setup a Virtual Machine on my mac mini and run the web server on it. At least till I can get another hosting plan or setup an ESXi box.

Everything is cool locally, but I can't seem to grasp what needs to be done to make the virtual machine accessible to the web. I set virtualbox to use the bridged connection and I've opened port 80 and the usual web ports pointing to the ip of the virtualbox. But still nothing. Any ideas how I can go about doing this?

Thanks,

Just to be clear, lets assume your host is 10.0.0.2 and the guest running the web server is at 10.0.0.3. Is the router is forwarding port 80 to 10.0.0.3?

Link to comment
Share on other sites

How many hits per a day/month traffic do you get? if you are only getting say 1 to 2000 unique vistors a week why not go with a free hosting service until you can afford the pay service again? I have seen some good free ones lately, and just made a thread about it in the questions forum on here recently (Be sure to check the hosting TOS). But if you are determined to learn how to create your own web hosting threw a VM, I can respect that. It is always good to learn something new.

Link to comment
Share on other sites

Using bridged Adapter on the VM.

The router assigned:

Host IP: 172.16.1.37

Guest IP: 172.16.1.41

The router is set with port 80 forwarding to the guest ip 172.16.1.41.

Apache2 is running on the guest machine and is accessible when I visit http://172.16.1.41 on another machine in the house.

How many hits per a day/month traffic do you get? if you are only getting say 1 to 2000 unique vistors a week why not go with a free hosting service until you can afford the pay service again? I have seen some good free ones lately, and just made a thread about it in the questions forum on here recently (Be sure to check the hosting TOS). But if you are determined to learn how to create your own web hosting threw a VM, I can respect that. It is always good to learn something new.

Been to the free hosting scene a few times, once you leave and have full control over your sites no going back.

Link to comment
Share on other sites

Does the VM have a second network adapter? What does it's routing table look like?

The VM only has one network adapter. Its a brand new install of Ubuntu Server 9.10 with apache2 installed. No adjustments made to the routing table. A bit of a n00b when it comes to the routing table and more advanced stuff. Trying to figure it out as needed.

[edit]

I'd prefer to stick with virtualbox but if another software does this better i'd be willing to give it a go.

Might be a bit of a hack but what about an ssh tunnel? Forward port 80 to my host. Then tunnel from the guest to the host? I know theoretically something like that might work. But i'm not sure how.

Anyone have any ideas?

[/edit]

Link to comment
Share on other sites

I Apologize for the double post. If anyone has any ideas i'm good with googling, just can't seem to find anything. I really need to figure this out in the next couple of days. I need to rsync everything from my hosting to vm by the 2nd if possible.

My mac is wireless Idk if that helps any.

Link to comment
Share on other sites

You can access the web server local right? I believe, the only things that need to be done is to set up port forwarding on the router (forward port 80 to the VM's IP) and use something like dyndns if you have a dynamic IP address.

Not sure if or how you can use dyndns if you have an existing domain name tho.

Link to comment
Share on other sites

I know someone who runs their web server from home and uses a VM to do it as well. Here is the thing though, aside from port forwarding on the router and all, your ISP may block access to port 80 at your home. Depends on your ISP as well as your type of account. He has a static IP address and uses a DNS service to forward his domain name to his home.

Link to comment
Share on other sites

You can access the web server local right? I believe, the only things that need to be done is to set up port forwarding on the router (forward port 80 to the VM's IP) and use something like dyndns if you have a dynamic IP address.

Not sure if or how you can use dyndns if you have an existing domain name tho.

I know someone who runs their web server from home and uses a VM to do it as well. Here is the thing though, aside from port forwarding on the router and all, your ISP may block access to port 80 at your home. Depends on your ISP as well as your type of account. He has a static IP address and uses a DNS service to forward his domain name to his home.

My ISP allows port 80 I have AT&T. I've run a web server from home in the past. Was using openSuSe gonna give Ubuntu a try. I have an old machine 900mhz. So slow... I guess if I can't figure this out i'll put it back up again.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...