•
•
•
•
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
![]() |
•
•
Join Date: Feb 2004
Location: Phoenix Arizona
Posts: 23
Reputation:
Rep Power: 5
Solved Threads: 0
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.
Any help would be great.
•
•
Join Date: Feb 2002
Location: Lawn Guylen, NY
Posts: 10,880
Reputation:
Rep Power: 32
Solved Threads: 108
Can you show us your httpd.conf file?
Dani the Computer Science Gal
Do you run a computer-related website? Feature it in our niche link directory!
Do you run a computer-related website? Feature it in our niche link directory!
•
•
Join Date: Feb 2004
Location: Phoenix Arizona
Posts: 23
Reputation:
Rep Power: 5
Solved Threads: 0
•
•
Join Date: Aug 2003
Location: Jersey - You gotta problem wit dat?
Posts: 332
Reputation:
Rep Power: 8
Solved Threads: 5
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
What's more, you deserve to be hacked.
-- former White House cybersecurity czar Richard Clarke
•
•
Join Date: Feb 2004
Location: Phoenix Arizona
Posts: 23
Reputation:
Rep Power: 5
Solved Threads: 0
•
•
Join Date: Aug 2003
Location: Jersey - You gotta problem wit dat?
Posts: 332
Reputation:
Rep Power: 8
Solved Threads: 5
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.
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
What's more, you deserve to be hacked.
-- former White House cybersecurity czar Richard Clarke
•
•
Join Date: Feb 2004
Location: Phoenix Arizona
Posts: 23
Reputation:
Rep Power: 5
Solved Threads: 0
![]() |
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
•
•
•
•
•
•
•
•
DaniWeb Linux Servers and Apache Marketplace
•
•
•
•
apple bbc cd cellphone computer core crossover debian dell desktop development enterprise fedora games garnet gentoo gpl hardware ibm install kernel laptop law linux livecd microsoft mobile news novell office open open source openbsd openoffice operating os palm palmos red hat security server source sun survey system ubuntu unix vista web windows
- Previous Thread: Apache Alias Directive... mod_alias question
- Next Thread: mod_rewrite



Linear Mode