Multiple url on a apache http server

Alles, was den Apache betrifft, kann hier besprochen werden.

Multiple url on a apache http server

Postby massimo1957 » 02. November 2007 12:11

Hi!
I am a beginner and I've just intalled the apache server for the first time. Sorry if my question is silly, but I have to solve a problem and have few time (google search was too complicate, because I don't know exactly what to look for).
Apache works fine. Now I have two host_addresses, e.g. url_1.com and url_2.com, which point to the same IP address, that of my apache web server.
I would like to assign the first link (url_1.com) a default path and to the second link (url_2.com) another default path, so I can have two websites and only one web server.
I suppose it can be done editing then httpd.conf file, but I don't know how and where. Can anyone help me?
Sorry again for my ignorance
THANKS to all
Massimo ENDRIZZI
massimo1957
 
Posts: 3
Joined: 02. November 2007 11:57

Resolved.

Postby massimo1957 » 02. November 2007 13:44

...
Massimo ENDRIZZI
massimo1957
 
Posts: 3
Joined: 02. November 2007 11:57

Postby Scory » 02. November 2007 14:33

From xampp installation (httpd-vhosts.conf):

#
# Virtual Hosts
#
# If you want to maintain multiple domains/hostnames on your
# machine you can setup VirtualHost containers for them. Most configurations
# use only name-based virtual hosts so the server doesn't need to worry about
# IP addresses. This is indicated by the asterisks in the directives below.
#
# Please see the documentation at
# <URL:http://httpd.apache.org/docs/2.2/vhosts/>
# for further details before you try to setup virtual hosts.
#
# You may use the command line option '-S' to verify your virtual host
# configuration.

#
# 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 all requests that do not
# match a ServerName or ServerAlias in any <VirtualHost> block.
#
##<VirtualHost *:80>
## ServerAdmin webmaster@dummy-host.example.com
## DocumentRoot /www/docs/dummy-host.example.com
## ServerName dummy-host.example.com
## ServerAlias www.dummy-host.example.com
## ErrorLog @rel_logfiledir@/dummy-host.example.com-error_log
## CustomLog @rel_logfiledir@/dummy-host.example.com-access_log common
##</VirtualHost>

##<VirtualHost *:80>
## ServerAdmin webmaster@dummy-host2.example.com
## DocumentRoot /www/docs/dummy-host2.example.com
## ServerName dummy-host2.example.com
## ErrorLog @rel_logfiledir@/dummy-host2.example.com-error_log
## CustomLog @rel_logfiledir@/dummy-host2.example.com-access_log common
##</VirtualHost>
Scory
 

Thanks!

Postby massimo1957 » 02. November 2007 16:05

Thanks, it works!

I was forgetting to uncomment <NameVirtualHost *:80>

greetings from Vienna
Massimo ENDRIZZI
massimo1957
 
Posts: 3
Joined: 02. November 2007 11:57


Return to Apache

Who is online

Users browsing this forum: No registered users and 2 guests