User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the Linux Servers and Apache section within the Tech Talk category of DaniWeb, a massive community of 397,589 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,984 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our Linux Servers and Apache advertiser:
Views: 6729 | Replies: 7
Reply
Join Date: Feb 2004
Location: Phoenix Arizona
Posts: 23
Reputation: izick is an unknown quantity at this point 
Rep Power: 5
Solved Threads: 0
izick's Avatar
izick izick is offline Offline
Newbie Poster

Help Virtual Hosting Multiple Websites

  #1  
Mar 20th, 2004
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.
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Feb 2002
Location: Lawn Guylen, NY
Posts: 10,880
Reputation: cscgal is just really nice cscgal is just really nice cscgal is just really nice cscgal is just really nice cscgal is just really nice 
Rep Power: 32
Solved Threads: 108
Admin
Staff Writer
cscgal's Avatar
cscgal cscgal is offline Offline
The Queen of DaniWeb

Re: Virtual Hosting Multiple Websites

  #2  
Mar 20th, 2004
Can you show us your httpd.conf file?
Reply With Quote  
Join Date: Feb 2004
Location: Phoenix Arizona
Posts: 23
Reputation: izick is an unknown quantity at this point 
Rep Power: 5
Solved Threads: 0
izick's Avatar
izick izick is offline Offline
Newbie Poster

Re: Virtual Hosting Multiple Websites

  #3  
Mar 20th, 2004
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, 31 views)
Reply With Quote  
Join Date: Aug 2003
Location: Jersey - You gotta problem wit dat?
Posts: 332
Reputation: TheOgre has a spectacular aura about TheOgre has a spectacular aura about TheOgre has a spectacular aura about 
Rep Power: 8
Solved Threads: 5
TheOgre's Avatar
TheOgre TheOgre is offline Offline
Posting Whiz

Re: Virtual Hosting Multiple Websites

  #4  
Mar 21st, 2004
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 :)
If you spend more on coffee than on IT security, you will be hacked.
What's more, you deserve to be hacked.
-- former White House cybersecurity czar Richard Clarke
Reply With Quote  
Join Date: Feb 2004
Location: Phoenix Arizona
Posts: 23
Reputation: izick is an unknown quantity at this point 
Rep Power: 5
Solved Threads: 0
izick's Avatar
izick izick is offline Offline
Newbie Poster

Re: Virtual Hosting Multiple Websites

  #5  
Mar 23rd, 2004
Thanks for your help again..
Reply With Quote  
Join Date: Aug 2003
Location: Jersey - You gotta problem wit dat?
Posts: 332
Reputation: TheOgre has a spectacular aura about TheOgre has a spectacular aura about TheOgre has a spectacular aura about 
Rep Power: 8
Solved Threads: 5
TheOgre's Avatar
TheOgre TheOgre is offline Offline
Posting Whiz

Re: Virtual Hosting Multiple Websites

  #6  
Mar 23rd, 2004
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.
If you spend more on coffee than on IT security, you will be hacked.
What's more, you deserve to be hacked.
-- former White House cybersecurity czar Richard Clarke
Reply With Quote  
Join Date: Feb 2004
Location: Phoenix Arizona
Posts: 23
Reputation: izick is an unknown quantity at this point 
Rep Power: 5
Solved Threads: 0
izick's Avatar
izick izick is offline Offline
Newbie Poster

Re: Virtual Hosting Multiple Websites

  #7  
Apr 9th, 2004
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.
Reply With Quote  
Join Date: Jun 2003
Posts: 5
Reputation: vrecan is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
vrecan vrecan is offline Offline
Newbie Poster

Re: Virtual Hosting Multiple Websites

  #8  
Apr 27th, 2004
thanks TheOgre, those links seem good. They will come in handy for me aswell.
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

DaniWeb Linux Servers and Apache Marketplace
Thread Tools Display Modes

Other Threads in the Linux Servers and Apache Forum

All times are GMT -4. The time now is 5:52 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC