Beta
×

Welcome to the Slashdot Beta site -- learn more here. Use the link in the footer or click here to return to the Classic version of Slashdot.

Thank you!

Before you choose to head back to the Classic look of the site, we'd appreciate it if you share your thoughts on the Beta; your feedback is what drives our ongoing development.

Beta is different and we value you taking the time to try it out. Please take a look at the changes we've made in Beta and  learn more about it. Thanks for reading, and for making the site better!

Apache Question

FortKnox (169099) writes | more than 9 years ago

The Internet 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, justWhy 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.

cancel ×

14 comments

Sorry! There are no comments related to the filter you selected.

vhosts (1)

tomhudson (43916) | more than 9 years ago | (#13162445)

set up different vhosts for each one, and do an "apachectl2 restart".

vhosts to the rescue (1)

kormoc (122955) | more than 9 years ago | (#13162480)

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

AOL Reply (1)

gmhowell (26755) | more than 9 years ago | (#13162754)

Me too!

Just don't lie and pretend you are working on unread. It cheapens us all.

Re:vhosts to the rescue (1)

nocomment (239368) | more than 9 years ago | (#13163266)

Yup! what he said

VHost (1)

OverlordQ (264228) | more than 9 years ago | (#13162535)

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

What they said (1)

trmj (579410) | more than 9 years ago | (#13162542)

[n/t]

Yep yep yep (1)

Scott Lockwood (218839) | more than 9 years ago | (#13162609)

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.

Re:Yep yep yep (0)

Anonymous Coward | more than 9 years ago | (#13179865)

*fart*

Vlad Farted. (1)

Kiaser Wilhelm II (902309) | more than 9 years ago | (#13183252)

Would anyone seriously trust a loser with a website as shitty looking as yours for advice?

I know I wouldn't.

Re:Vlad Farted. (1)

Scott Lockwood (218839) | more than 9 years ago | (#13187071)

Aaah yes - another reason why my JE's are all friends and thier friends only...

Re:Vlad Farted. (1)

Kiaser Wilhelm II (902309) | more than 9 years ago | (#13187354)

You have friends?

vhosting (1)

Alioth (221270) | more than 9 years ago | (#13163243)

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.

Re:vhosting (1)

loucura! (247834) | more than 9 years ago | (#13164202)

Unless you're using HTTPS.. HTTPS has to be done with IP based virtual hosting.

You can cheat too (1)

nizo (81281) | more than 9 years ago | (#13164068)

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.
Check for New Comments
Slashdot Login

Need an Account?

Forgot your password?

Submission Text Formatting Tips

We support a small subset of HTML, namely these tags:

  • b
  • i
  • p
  • br
  • a
  • ol
  • ul
  • li
  • dl
  • dt
  • dd
  • em
  • strong
  • tt
  • blockquote
  • div
  • quote
  • ecode

"ecode" can be used for code snippets, for example:

<ecode>    while(1) { do_something(); } </ecode>