Config file for Apache name-based virtual hosting
I am trying to configure the config file to host more than one website using name-based virtual hosting.
i am using Apache/2.0.54 (Linux/SUSE) and followed the directions at: http://httpd.apache.org/docs/2.0/vhosts/name-based.html NameVirtualHost *:80 <VirtualHost *:80> ServerName www.domain.tld ServerAlias domain.tld *.domain.tld DocumentRoot /www/domain </VirtualHost> <VirtualHost *:80> ServerName www.otherdomain.tld DocumentRoot /www/otherdomain </VirtualHost> This is all that I have done on the config file, of course I changed the domain names :) I am wondering if there is more than just doing that? thanks Mike |
What is wrong with this configuration or what does not work as expected ?
|
ya it doesn`t work, it just works only if I have two IPs (which it is setup on now, so I am running two webservers and would like to run just one and contain the websites on one system
I am wondering if I need to modify the file anymore than I have already. |
What is the configuration of your default server in httpd.conf ? Can you access it from http://localhost or http://127.0.0.1 or http://yourIP ?
Did you bind apache to the correct ip (the one that corresponds to the dns entry for the domains - look at the 'listen' directive) ? |
Quote:
when i set up apache on linux it was simple and all i did was copy an index page and related files into the /srv/www/htdocs and it worked. I didnt have to even touch the config file. using apache on windows was a little more of a setup and different directory structure. I am going to try and modify the config file and it will more than likely work. I will post a repsonse and let you know if it works, thanks for your help mike |
geez i just cant seem to get the dam thing to work...can someone help with this?
I made the changes as per named host and still nothing.... I am just wondering as when I setup apache some info was input into the config file such as email and domain name. so by default the first domain shows up, so do i need to comment those entries out then try the domains with the config file? Or do I just add the secondary domain to the virtual host and call it good? thanks for any help or insight! mike here is the section I got off the net and input it into the config file, the lines are unchanged so far and are commented out. # Use name-based virtual hosting. # #NameVirtualHost *: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 *:80> # ServerAdmin webmaster@dummy-host.example.com # DocumentRoot /www/docs/dummy-host.example.com # ServerName dummy-host.example.com # ErrorLog logs/dummy-host.example.com-error_log # CustomLog logs/dummy-host.example.com-access_log common #</VirtualHost> |
All times are GMT -5. The time now is 11:25 AM. |