Page 1 of 2

Have more than one sites on the same server.

Posted: Sat Jul 17, 2004 10:59 pm
by genetix
I cant seem to get this to work. heres the setup:

http://www.webdummy.net > http://24.72.3.251/webdummy/
http://www.generation-x.ca > http://24.72.3.251/generation-x/

I will also be adding a lot more sites in about a month(I'm hosting local business websites).

The domains are registered and everything and I'm using http://www.afraid.org for my dns servers. When I click on the domain link on afraid.org and try to set the address for http://www.webdummy.net to http://24.72.3.251/webdummy/ it says its not an IP address. Is there anyway I can turn the folder webdummy into a port or something? Or send the port traffic to that folder?

EDIT:
Also I want to have an actual domain not just a forward. So I can go like http://www.webdummy.net/admin/

Posted: Sun Jul 18, 2004 4:45 am
by kettle_drum

Code: Select all

#
# 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>

<VirtualHost *>
    ServerAdmin webmaster@site1
    DocumentRoot S:\location\of\site\numbe\one
    ServerName site1
    ErrorLog logs/site1.com-error_log
    CustomLog logs/site1-access_log common
</VirtualHost>

<VirtualHost *>
    ServerAdmin webmaster@site2
    DocumentRoot S:\location\of\site\numbe\two
    ServerName site2
    ErrorLog logs/site2.com-error_log
    CustomLog logs/site2-access_log common
</VirtualHost>

Posted: Sun Jul 18, 2004 12:47 pm
by genetix
I'm a n00b at all of this. I understand how to fill out that stuff but what file should I put it in?

Posted: Sun Jul 18, 2004 1:02 pm
by kettle_drum
in httpd.conf if your using apache. If not check the manual of whatever server your using.

Posted: Sun Jul 18, 2004 10:58 pm
by genetix
I have that set but how do I dirrect my ip or hostname to that virtual host? Does apache automatically assign a unique port to each virtual host?

Posted: Sun Jul 18, 2004 11:02 pm
by feyd

Posted: Mon Jul 19, 2004 6:28 pm
by genetix
I already looked through there and couldn't understand it. I'm a n00b to this whole server thing. Before a week ago I didn't know anything about apache. I was only a php,mysql, and html programmer.

I have added the virtual host information to my apache file as stated in the first reply. Now that I have that is it possible to just link to that virtual host with a ip address or hostname?

Posted: Mon Jul 19, 2004 6:54 pm
by feyd
alter ServerName in kettle_drum's examples to the DNS resolved names of the domains, alter the DocumentRoots to their respective roots, and set the *Log directives, if you like. Restart Apache, and I believe it should work.

Posted: Mon Jul 19, 2004 8:26 pm
by genetix
I must have filled in the information wrong. I dont really know how I'm suppose to fill it in even when following two examples which makes me look really stupid.

Code: Select all

#
# 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>

<VirtualHost *> 
    ServerAdmin lshaheen@accesscomm.ca 
    DocumentRoot /www/webdummy/ 
    ServerName webdummy.net
    ErrorLog logs/webdummy.net-error_log 
    CustomLog logs/webdummy.net-access_log common 
</VirtualHost> 

<VirtualHost *> 
    ServerAdmin lshaheen@accesscomm.ca 
    DocumentRoot /www/generation-x/ 
    ServerName generation-x.ca 
    ErrorLog logs/generation-x.ca-error_log 
    CustomLog logs/generation-x.ca-access_log common 
</VirtualHost>

Posted: Mon Jul 19, 2004 10:08 pm
by feyd
does the DNS server resolve to your server's IP yet?

Posted: Mon Jul 19, 2004 10:32 pm
by genetix
Now nothing is working. not even localhost will load(when on the server). I tried it on my normal computer and http://www.webdummy.net doesn't work either.

Posted: Mon Jul 19, 2004 10:37 pm
by John Cartwright
changing name servers can take up to 48 hours

Posted: Mon Jul 19, 2004 10:39 pm
by genetix
I didn't change the name servers. I changed the virtual hosts in httpd.conf. my dns hosts are from http://www.afraid.org

Posted: Mon Jul 19, 2004 10:40 pm
by feyd
NameVirtualHost directive wrote:The NameVirtualHost directive is a required directive if you want to configure name-based virtual hosts.
VirtualHost directive wrote: The special name _default_ can be specified in which case this virtual host will match any IP address that is not explicitly listed in another virtual host. In the absence of any _default_ virtual host the "main" server config, consisting of all those definitions outside any VirtualHost section, is used when no match occurs.

You can specify a :port to change the port that is matched. If unspecified then it defaults to the same port as the most recent Port statement of the main server. You may also specify :* to match all ports on that address. (This is recommended when used with _default_.)

SECURITY: See the security tips document for details on why your security could be compromised if the directory where logfiles are stored is writable by anyone other than the user that starts the server.

NOTE: The use of <VirtualHost> does not affect what addresses Apache listens on. You may need to ensure that Apache is listening on the correct addresses using either BindAddress or Listen.

Posted: Tue Jul 20, 2004 10:03 am
by liljester
if nothing is working (nothing in the browser on localhost) you may have a config problem in your httpd.conf. is apache running? are you running unix, linux, or windows?