Catch up on stories from the past week (and beyond) at the Slashdot story archive

 



Forgot your password?
typodupeerror
Check out the new SourceForge HTML5 internet speed test! No Flash necessary and runs on all devices. ×
The Internet

Journal FortKnox's Journal: Apache Question 14

Why can't journal users use the 'apache' topic?

Real question:
If I have multiple domains hitting the same server (a la, marotti.com and unread.org hitting my server) is there a way in apache to say "if they are trying to go to marotti.com, use /srv/www/marotti.com/htdocs/, otherwise use this /srv/www/undread.org/htdocs/ (actually that will change to differ to tomcat eventually, but you get the point)?
I'm sure there is a way of doing it, just don't know how. Didn't do much looking, though, so feel free to tell me to RTFM (though a topic to search for would be helpful).
Thanks ahead of time.
This discussion has been archived. No new comments can be posted.

Apache Question

Comments Filter:
  • set up different vhosts for each one, and do an "apachectl2 restart".
  • Here's a example vhost file for my box

    <VirtualHost *:80>
    ServerName kormoc.homelinux.org
    ServerPath /kormoc.homelinux.org
    DocumentRoot /home/kormoc/public_html
    </VirtualHost>

    <Direc tory /home/kormoc/public_html>
    AllowOverride Options FileInfo
    </Directory>

    <Directory /home/kormoc/public_html>
    Options ExecCGI
    </Directory>

    Just do that for each one, and restart apache and your good to go

    The Directory ones are optional, but useful if you need them

  • Have the server defaults set to the undread.org paths/etc then setup a vhost for marotti.

    (IIRC) All domains pointing to the box (except for marotti) should (i think) default to the undread
  • [n/t]
  • Vhosting is the way to go. Depending on what you want to do, Apache1 or Apache2 may be more appropriate. If at all possible, use Apachw2.
  • As the others say. But make sure you are using _name based_ virtual hosting if you have only one IP address (it's a good idea anyway not to waste IP addresses).

    There's usually an example in the httpd.conf file, but it's tidier to put it in an included conf file.
  • You won't need to cheat if you have access to the apache config files, but at one point I was using a web service where I didn't have access to the apache config files. I was able to get my own virtual hosting by pointing a variety of DNS records to the one IP I was given and using a php script as the index page that would check the virtual host you were connecting to and then redirect you to the appropriate sub directory. If anyone is interested I can dig up and post the snippets of code.

The opossum is a very sophisticated animal. It doesn't even get up until 5 or 6 PM.

Working...