Have more than one sites on the same server.
Moderator: General Moderators
- 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.
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/
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
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>-
kettle_drum
- DevNet Resident
- Posts: 1150
- Joined: Sun Jul 20, 2003 9:25 pm
- Location: West Yorkshire, England
- feyd
- Neighborhood Spidermoddy
- Posts: 31559
- Joined: Mon Mar 29, 2004 3:24 pm
- Location: Bothell, Washington, USA
This may help: http://httpd.apache.org/docs/vhosts/name-based.html
- genetix
- Forum Contributor
- Posts: 115
- Joined: Fri Aug 01, 2003 7:40 pm
- Location: Sask, Regina
- Contact:
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?
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?
- genetix
- Forum Contributor
- Posts: 115
- Joined: Fri Aug 01, 2003 7:40 pm
- Location: Sask, Regina
- Contact:
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>- genetix
- Forum Contributor
- Posts: 115
- Joined: Fri Aug 01, 2003 7:40 pm
- Location: Sask, Regina
- Contact:
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.
- John Cartwright
- Site Admin
- Posts: 11470
- Joined: Tue Dec 23, 2003 2:10 am
- Location: Toronto
- Contact:
- genetix
- Forum Contributor
- Posts: 115
- Joined: Fri Aug 01, 2003 7:40 pm
- Location: Sask, Regina
- Contact:
I didn't change the name servers. I changed the virtual hosts in httpd.conf. my dns hosts are from http://www.afraid.org
- feyd
- Neighborhood Spidermoddy
- Posts: 31559
- Joined: Mon Mar 29, 2004 3:24 pm
- Location: Bothell, Washington, USA
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.