bongobongo Posted July 12, 2007 Share Posted July 12, 2007 Let say I have a subdir in webserver root called: test And I then create a virtualHost with : ... ... DocumentRoot c:/www/htdocs/test ServerName local.test.com .. ... Now, is it possible to prevent anything being served using this address: http://localhost/test I only want the site beeing accessible using: local.test.com How do I do that? Quote Link to comment Share on other sites More sharing options...
trq Posted July 15, 2007 Share Posted July 15, 2007 I only want the site beeing accessible using: local.test.com How do I do that? Don't put the site within the server root. Quote Link to comment Share on other sites More sharing options...
keeB Posted July 15, 2007 Share Posted July 15, 2007 You're thinking of the virtualhost tags. On linux, this would be defined in: /etc/apache2 (or /usr/local/apache2) /conf/extra/virtualdomains I assume on windows it would be something like c:\apache\conf\extra\virtualdomains. These virtualhost tags help define subdomains/locations. Good luck. Quote Link to comment Share on other sites More sharing options...
trq Posted July 15, 2007 Share Posted July 15, 2007 On linux, this would be defined in: /etc/apache2 (or /usr/local/apache2) /conf/extra/virtualdomains This looks like some distro specifc config. Ive never seen it in any of the Linux distro's Ive used. Quote Link to comment Share on other sites More sharing options...
keeB Posted July 15, 2007 Share Posted July 15, 2007 Oh really? Hmm, I suppost most of my apache experience is on Debian boxes. Also, you can install apps where ever you want, just like on windows. Those are the *most common* (at least I thought so!!!) Quote Link to comment Share on other sites More sharing options...
trq Posted July 15, 2007 Share Posted July 15, 2007 Those are the *most common* (at least I thought so!!!) Nah.. for instance, on Gentoo (my fav OS) virual hosts are placed within /etc/apache2/vhosts.d While other systems Ive used use the upstream default apache config where your vhosts are actually specified within the global httpd.conf file. Lots of distro's have lots of ways of going about different configs. Quote Link to comment Share on other sites More sharing options...
keeB Posted July 16, 2007 Share Posted July 16, 2007 Fascinating! I figured once the default structure of the apache package was installed, it installed as any other app. I do understand that the httpd.conf can link to many other files, but I thought it distributed equally on all platforms. Gentoo is a great OS btw Quote Link to comment Share on other sites More sharing options...
steviewdr Posted July 17, 2007 Share Posted July 17, 2007 Debian and Ubuntu store apache under the following paths: Only configs are placed inside: /etc/apache2/ Configs for vhosts are stored in: /etc/apache2/sites-available/virtualsite1.com a2ensite symlinks the above into: /etc/apache2/sites-enabled/virtualsite1.com The webroot is by default in /var/www/ If you want multiple websites etc. I recommend making a /srv/www/ folder to hold the webroot for subdomains. e.g. /srv/www/host1 /srv/www/host2 etc. This seperates out the config files from the content files. Debian setup & config of apache: http://wiki.kartbuilding.net/index.php/Apache_2_%26_SSL_-_PHP4_-_MySQL_4.1 -steve Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.