Web Hosting Talk







View Full Version : Help with HTTPD...Very Easy!


SteRaL
02-12-2004, 01:05 PM
O.k! I want to host 2 website from my home server. The only problem is ..this is the error I recieve when I restart apache:


(EAI 2)Name or service not known: Cannot resolve host name www.blahblah.com --- ignoring!


Now this is the Virtual Host entries I have in my httpd.conf:



# You may use the command line option '-S' to verify your virtual host
# configuration.
#

<VirtualHost www.mydomain.com>
ServerName mail.mydomain.com
ServerAlias mail.*
ServerAdmin admin@mydomain.com
DocumentRoot /home/sisco/public_html/webmail
</VirtualHost>

#
# Use name-based virtual hosting.
#

NameVirtualHost 24.195.240.184:80

#
# VirtualHost example:
# Almost any Apache directive may go into a VirtualHost container.
# The first VirtualHost section is used for requests without a known
# server name.
#
<VirtualHost www.mydomain.com>
ServerAlias www.mydomain.com mydomain.com
ServerAdmin mydomain@hotmail.com
DocumentRoot /home/sisco/public_html
ServerName www.mydomain.com
ScriptAlias /cgi-bin/ /home/sisco/public_html/cgi-bin/
</VirtualHost>

<VirtualHost www.blahblah.com>
ServerAlias www.blahblah.com blahblah.com
ServerAdmin admin@siscohosting.com
DocumentRoot /home/wahid/public_html
ServerName www.blahblah.com
ScriptAlias /cgi-bin/ /home/wahid/public_html/cgi-bin/
</VirtualHost>


Please let me know what I'm doing wrong...Someone mentioned Name Based Hosting because I only have 1 IP address?..Is that what I'm doing? I dunno ..Help!

FYI...I'm on RH9, PHP, MySQL, Qmail so on and so forth..and of coarse I changed the real domain names to something fake ;)

Thankz!

cubision
02-12-2004, 01:12 PM
OK, you're doing a few things incorrectly.

You don't declare the domain name in the virtual host directive:

WRONG: <VirtualHost www.blahblah.com>

RIGHT: <VirtualHost *>
RIGHT: <VirtualHost 12.34.56.78>

That should be the cause of your problem. Other than that, you don't need to put the server name again in the alias -- that might produce weird results.

EDIT: Please refer to http://httpd.apache.org/docs/vhosts/ for any more questions about virtual hosts.

SteRaL
02-12-2004, 01:29 PM
Ok..I changed what you said to my IP..but the one with www.blahblah.com ..it doesn't work?? Domain has been propogated and everything has been checked..Is there something else I need to do..directories and everything are set and so are permissions and IP addresses..I'm using zoneedit for DNS...Thankz in advance!


IT says Page cannot be found and at the top top it says

Cannot Find Server

cubision
02-12-2004, 01:36 PM
I assume you restarted apache?

xp101
02-20-2004, 10:44 AM
Originally posted by cubision
Other than that, you don't need to put the server name again in the alias -- that might produce weird results.


What would you put in the server alias? or just opmit that line?

Uncle Mad
02-21-2004, 11:13 PM
Hi

This is alsomy very 2nd try doing it, with my first accompanied by help from a long lost friend.

What permissions do i have to set? I can't recall them since it's very long ago i suppose, but i do recall some have to be done from root, some from the user account, so someone please kindly help. I have done the httpd.conf as adviced above, TIA.

Wullie
02-22-2004, 03:40 AM
Try adding the following to each virtualhost:

UseCanonicalName off

For the ServerAlias directive, you should put any variations of the domain name that you want that virtualhost to answer to. So if you wanted www.domain.com and domain.com then you would put the following:

ServerName domain.com
ServerAlias www.domain.com

Hope this helps

dsoft@cal2
02-22-2004, 06:59 AM
<IfModule mod_userdir.c>
#
# UserDir is disabled by default since it can confirm the presence
# of a username on the system (depending on home directory
# permissions).
#
#UserDir disable

#
# To enable requests to /~user/ to serve the user's public_html
# directory, remove the "UserDir disable" line above, and uncomment
# the following line instead:
#
UserDir public_html

</IfModule>


You might have UserDir disable. If it is so comment that and uncomment UserDir public_html

With other things this is a must