943,467 Members | Top Members by Rank

Mar 20th, 2004
0

Virtual Hosting Multiple Websites

Expand Post »
I am trying to host multiple websites from my linux box. I have been from one end of google to the other and tried about every suggestion I could read. I have also tried setting up webmin and have edited and re-edited my httpd.conf to death. I have one web site running now in the /var/www/ directory. I would like to host a few more in other directory's either by /home/user/public or /var/www/user/ I dont care. I have been able to get it half way working however I cannot seem to get rid of the default redhat index page. And usually the default website in the var/www/ starts pointing at the default redhat index page instead of my /var/www/html/index.html page.

Any help would be great.
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
izick is offline Offline
23 posts
since Feb 2004
Mar 20th, 2004
0

Re: Virtual Hosting Multiple Websites

Can you show us your httpd.conf file?
Administrator
Staff Writer
Reputation Points: 1422
Solved Threads: 162
The Queen of DaniWeb
cscgal is offline Offline
13,645 posts
since Feb 2002
Mar 20th, 2004
0

Re: Virtual Hosting Multiple Websites

Thank you for responding. I wasnt sure if I should put the whole thing as a message so I am attaching txt file..
Attached Files
File Type: txt conf.txt (30.7 KB, 172 views)
Reputation Points: 10
Solved Threads: 0
Newbie Poster
izick is offline Offline
23 posts
since Feb 2004
Mar 21st, 2004
0

Re: Virtual Hosting Multiple Websites

I'll take a look at it and get back to you later tonight. I already know the answer to one problem, but I want to verify this by checking your .conf file. As far as hosting multiple domains, again, I'll look at your current config and let you know what was wrong. If I'm in a good mood, I'll even edit for you and repost it to save you some trouble :)
Reputation Points: 128
Solved Threads: 8
Posting Whiz
TheOgre is offline Offline
390 posts
since Aug 2003
Mar 23rd, 2004
0

Re: Virtual Hosting Multiple Websites

Thanks for your help again..
Reputation Points: 10
Solved Threads: 0
Newbie Poster
izick is offline Offline
23 posts
since Feb 2004
Mar 23rd, 2004
1

Re: Virtual Hosting Multiple Websites

Sorry I haven't replied yet, but I did take a look through your conf file, and it appears there's a number of things that are misconfigured, which would explain why you're having trouble with vhosts (multiple domains), among other things...

I would suggest taking a look at the online Apache documentation to get a better understanding on how virtual domain hosting works, which will help you understand how Apache handles it. Rather than just fixing your .conf file to make it "work" like you want, if you don't understand what you're doing, you won't know how to fix/make changes to it when you need to.

Here's the URLs for the docs you need, which should already be included in the "Manual" section included with Apache:

Configuration Sections:
http://httpd.apache.org/docs-2.0/sections.html

Virtual Host Documentation:
http://httpd.apache.org/docs-2.0/vhosts/

Apache 2.0 Root Documentation:
http://httpd.apache.org/docs-2.0/


In order to get rid of the default RedHat page like you want, you have to reconfigure your httpd.conf without any extras FIRST to make sure the basics work, then move on one step at a time and add features. I highly recommend trashing your existing config file and starting with a fresh copy (# cp httpd.conf.sample httpd.conf) which will contain an alias to the /docs ("Manual") directory.

Also, an error I see a lot is the ServerName variable entry. If you set that as "localhost", you'll have to access it by entering http://localhost as the URL. If you want outside access to your server, use www.mydomain.com as the ServerName:

ServerName www.mydomain.com

Another variable is the Listen variable. If you want Apache to listen for requests on port 80, then just enter 80 for the variable:

Listen 80

I'm not trying to shrug off your request for help, but it's important that you understand what you're doing when configuring any type of server. A misconfigured web server can lead to a compromised system, and create a ton of other problems from there (using your box as a platform to launch DDoS attacks, etc.)

Read the docs, and test it out. You should have it up and running in no time at all - certainly within 15 to 30 minutes or so. It's not very difficult, but if you still have problems, let me know.
Reputation Points: 128
Solved Threads: 8
Posting Whiz
TheOgre is offline Offline
390 posts
since Aug 2003
Apr 9th, 2004
0

Re: Virtual Hosting Multiple Websites

Thank you for your help. I have taken a look at the apache links. I will scrap the old conf file and build using the information contained. I am sure I will be posting for more help. I really appreciate the assistance.
Reputation Points: 10
Solved Threads: 0
Newbie Poster
izick is offline Offline
23 posts
since Feb 2004
Apr 27th, 2004
0

Re: Virtual Hosting Multiple Websites

thanks TheOgre, those links seem good. They will come in handy for me aswell.
Reputation Points: 10
Solved Threads: 0
Newbie Poster
vrecan is offline Offline
5 posts
since Jun 2003

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Linux Servers and Apache Forum Timeline: Apache Alias Directive... mod_alias question
Next Thread in Linux Servers and Apache Forum Timeline: mod_rewrite





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC