Have more than one sites on the same server.

Need help installing PHP, configuring a script, or configuring a server? Then come on in and post your questions! We'll try to help the best we can!

Moderator: General Moderators

User avatar
genetix
Forum Contributor
Posts: 115
Joined: Fri Aug 01, 2003 7:40 pm
Location: Sask, Regina
Contact:

Have more than one sites on the same server.

Post 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/
kettle_drum
DevNet Resident
Posts: 1150
Joined: Sun Jul 20, 2003 9:25 pm
Location: West Yorkshire, England

Post 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>
User avatar
genetix
Forum Contributor
Posts: 115
Joined: Fri Aug 01, 2003 7:40 pm
Location: Sask, Regina
Contact:

Post 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?
kettle_drum
DevNet Resident
Posts: 1150
Joined: Sun Jul 20, 2003 9:25 pm
Location: West Yorkshire, England

Post by kettle_drum »

in httpd.conf if your using apache. If not check the manual of whatever server your using.
User avatar
genetix
Forum Contributor
Posts: 115
Joined: Fri Aug 01, 2003 7:40 pm
Location: Sask, Regina
Contact:

Post 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?
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

User avatar
genetix
Forum Contributor
Posts: 115
Joined: Fri Aug 01, 2003 7:40 pm
Location: Sask, Regina
Contact:

Post 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?
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post 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.
User avatar
genetix
Forum Contributor
Posts: 115
Joined: Fri Aug 01, 2003 7:40 pm
Location: Sask, Regina
Contact:

Post 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>
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

does the DNS server resolve to your server's IP yet?
User avatar
genetix
Forum Contributor
Posts: 115
Joined: Fri Aug 01, 2003 7:40 pm
Location: Sask, Regina
Contact:

Post 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.
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Post by John Cartwright »

changing name servers can take up to 48 hours
User avatar
genetix
Forum Contributor
Posts: 115
Joined: Fri Aug 01, 2003 7:40 pm
Location: Sask, Regina
Contact:

Post 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
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post 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.
User avatar
liljester
Forum Contributor
Posts: 400
Joined: Tue May 20, 2003 4:49 pm

Post 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?
Post Reply