Linux - NetworkingThis forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Hello i'm using Virtualmin to create virtual servers however im still quite new to the idea of using these virtual servers, I understand that I can modify the default apache server then people can access this default server via the external IP say http://60.240.96.175:80 and I can access via the internal IP http://10.0.0.10 or localhost my question is that if I create a virtual server how can I access it externally over the internet without getting the default website to appear but the virtual server instead?
I hope I am being clear enough, thanks for your help.
at the bottom of your http.conf you sould see a section called VirtualHosts, this is where you will add the virtual hosts, there are many different techniques for this, assuming that you will be using name based virtual hosting as opposed to ip based virtual hosting tou will also want to uncomment the line that says NameVirtualHost 192.168.0.4:80 substituting the address for your NIC's local address.
Okay let's say that I am not using any names at the moment just IP addresses, a person accessing the virtual server from the internet cant access the virtual interface IP tho can they? I want people from the internet to be able to view the virtual servers aswell say like a web host how they have many different users.. i'm quite confused. The default server uses 10.0.0.10 this can be accessed by my internet IP but the virtual server uses 10.0.0.11 what IP can I give people to access this? I am not using DNS or names atm tho.
The only way I can think of to do what you are asking is a workaround, and that would be to set up permanent redirects for subdirectories of the main site to non-standard ports that are forwarded to the other local ip's by your router.
Its not the "right" way to go about it. If I were you I'd invest 6 dollars in a domain name and learn a bit about hosting your own dns. You could then at least set up subdomains to point to other websites. If you had multiple external(WAN) ip addresses to work with it would be possible but that would cost more than just getting a domain name anyway.
Put it this way, basically there's 2 types of virtualhosts in Apache, ip-based and name-based.
With ip-based Apache serves content based on which ip address the client connects to(ie you have more than one public ip addresses, and you setup vhosts on each of them)
With name-based Apache checks the domain name which the client used to connect, and serves content based on that. If you configured name-based vhosts and client uses the ip address to connect , the default vhost will be used(usually the first one defined in the configuration file)
Therefore, for your situation if you have an ip-based configuration, why not just put the website you want external clients to see on the external IP, since they will only be able to access your public IP address anyway. If you're behind a router simply forward port 80 to whichever LAN ip the virtualhost is using on the server.
Also if you want to use name-based virtualhosts without purchasing a domain name there's plenty of free DNS services around, here's one I personally use: http://www.afraid.org
For anything more complex you need to learn how to use mod_rewrite.
Basically what I want to do is to have at least 5 websites hosted for people, I want them to be able to log in via FTP into a folder which contains their websites and where they can update their websites, I then want apache to look into these directories. Are there any good tutorials on this sort of work? any examples? I am still confused on configuring domain names.
Then create local user accounts for each user, their root web directory will be in ~/public_html. So for user "john", he has to upload his stuff to /home/john/public_html, and it can be accessed via http://yourserver/~john/
Using DNS for name-based virtualhost, eg john can access his website using http://john.yourdomain.com, is a little more complex. If mod_userdir does not achieve what you want let me know, I can give you another short tutorial.
BEWARE: If you add hosts using mod_userdir and have ssh/sftp access open to the outside these clients will be able to browse above their home directories.
It sounds like what you want to do is build a LAMP style mass hosting environment. There are many tutorials on this and it is quite an endeavor. If you need help just keep posting, I have set up quite a few of them. Demonbane is right, for your purposes now mod_userdir is probably the best way to go.
Okay I tried modifying the Apache config, however I cannot seem to access my server from my Windows XP machine, the IP is http://10.0.0.10 but I cannot load http://10.0.0.10/~lindsay, can you tell me why? Although when I use Lynx and goto http://10.0.0.10/~lindsay I get the following error
Forbidden
You don't have permission to access /~lindsay/ on this server.
_________________________________________________________________
Did you put any index files(index.htm etc) in public_html? I think the default Apache installation in most distro disallows directory browsing unless you specify otherwise.
I just rebooted the box, now i've got another problem *sigh*
Failed to start apache : Apache does not appear to be running :
[Sat Dec 4 05:15:26 2004] [warn] NameVirtualHost 10.0.0.10:80 has no VirtualHosts
/usr/sbin/apachectl start: httpd started
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.