LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Http Server help (https://www.linuxquestions.org/questions/linux-newbie-8/http-server-help-298158/)

eckertc1 03-05-2005 09:48 PM

Http Server help
 
what i have:

I'm running Red Hat 9 with apache 2 and i have a web server set up to host my own site, www.mysite1.com, internally (don't like paying for hosting). everything works perfectly the way i have it set up at the moment.

what i want:

recently i decided to put up a second and possibly a third site, www.mysite2.com & www.mysite3.com, but i have had no success in getting this set up on my server.

I guess what I'm asking for here is, what exactly do i need in order to make virtual hosts work. i have done LOTS of reading on setting up the virtual hosts themselves inside of apache, but they still don't seem to work. would i need to set up my own DNS, or maybe set up some port forwarding in my router that I'm missing, or what.

i think I'm missing something very fundamental here and its preventing my virtual hosts from working. or maybe what I'm trying to do is not even possible on my current set up with only one IP address, i just don't know.

any advice would be great.

sincerely, newb in need

Matir 03-05-2005 09:52 PM

One IP is no problem: that's the idea behind virtual hosts. What does your httpd.conf look like? And what errors are you getting, if any?

eckertc1 03-05-2005 09:55 PM

I dont currently have one set up. everything i did failed so i just finished formating and reinstalling red hat from step 1. now i have my original server set up again in the default settings apache uses for directories and such.

the reason i posted was so i could get an idea of what i need to do before i try to do it this time lol. dont want to start from scrach again if possible.

the main problem i was having when i set it up the first time was that either site i tried to visit would bring up the first site in the Virtual host list. if that helps any

Matir 03-05-2005 11:21 PM

Using apache 1.3, the following documentation applies: http://httpd.apache.org/docs/vhosts/
Using apache 2.0, the following documentation applies: http://httpd.apache.org/docs-2.0/vhosts/

If you have questions or would like me to look over your configuration, I'd be glad to help you.

eckertc1 03-05-2005 11:47 PM

using the documentation you gave me for apache 2.0 i found this sentence:

"You must first have your DNS server properly configured to map those names to an IP address associated with your server.
"

does this mean i need to run my own DNS and if so how do i go about setting this up.

eckertc1 03-06-2005 12:08 AM

heres the Vhosts section from my httpd.conf. maybe this will help shed some light.

### Section 3: Virtual Hosts

NameVirtualHost *:80

<VirtualHost *:80>
DocumentRoot /var/www/mysite1/
ServerName www.mysite1.com
ServerAlias mysite1.com *.mysite1.com
</VirtualHost>

<VirtualHost *:80>
DocumentRoot /var/www/mysite2/
ServerName www.mysite2.com
ServerAlias mysite2.com *.mysite2.com
</VirtualHost>

right now if i try to browse to either site i am getting an Error 404

eckertc1 03-06-2005 01:22 AM

well i found part of my problem. i had a simple mistake in the directory for document root. fixing that solved my 404 error but i still cant get it to resolve to the correct page. im getting the apache test page for both virtual hosts. so i think this is an issue with setting DNS up correctly.

can anyone help me out with that?? what do i need to do. can i set that up through Godaddy where i have my domains parked or do i need to set up my own DNS.

and if i need to set up my own DNS what kind of DNS exactly do i need.

eckertc1 03-06-2005 02:13 AM

one last bit of information that may help. in my /httpd/error_log i find this entry every time i try to access the page.

Permission denied: access to /index.html denied, referer: http://www.mydomain.com/

eckertc1 03-06-2005 02:23 AM

Problem solved, im an idiot, ill stop spaming the forum with stupid questions now.

solution was in the file permissions


All times are GMT -5. The time now is 01:32 AM.