Slashdot is powered by your submissions, so send in your scoop


Forgot your password?
DEAL: For $25 - Add A Second Phone Number To Your Smartphone for life! Use promo code SLASHDOT25. Also, Slashdot's Facebook page has a chat bot now. Message it for stories and more. Check out the new SourceForge HTML5 Internet speed test! ×
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, and hitting my server) is there a way in apache to say "if they are trying to go to, use /srv/www/, otherwise use this /srv/www/ (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>
    ServerPath /
    DocumentRoot /home/kormoc/public_html

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

    <Directory /home/kormoc/public_html>
    Options ExecCGI

    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 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.

When the bosses talk about improving productivity, they are never talking about themselves.