Jump to content

[Apache] Several domains on 1 IP


superyupkent
 Share

Recommended Posts

Hello everyone,

 

I have been reading on the apache website, but i'm getting a bit confused of all the terms and possibilities there. I have 4 domains that I would like to serve, the problem is that I have only received one IP from my ISP.

 

What I understand from apache site is that namevirtualhosting is a possibility but what is the command then?

 

can I simply do something like:

 

NameVirtualHost *

 

<VirtualHost _default_>

ServerName www.domain1.org

DocumentRoot /var/www/domain1

#ErrorLog /dev/null

#TransferLog /dev/null

</VirtualHost>

 

<VirtualHost *>

ServerName mail.domain2.org

DocumentRoot /var/www/domain2

</VirtualHost>

Link to comment
Share on other sites

  • 4 weeks later...

mine looks more like this:

 

*****************************************

NameVirtualHost *:80

 

<VirtualHost *:80>

ServerName www.domain1.org

DocumentRoot /var/www/domain1

#ErrorLog /dev/null

#TransferLog /dev/null

</VirtualHost>

 

<VirtualHost *:80>

ServerName mail.domain2.org

DocumentRoot /var/www/domain2

</VirtualHost>

 

<Directory /var/www/domain2>

order allow,deny

allow from all

</Directory>

*****************************************

 

the first is the default host in my configuration, it has the same server name as the system server name in apache2.conf, but i don't specify it as _default_. Whether you will need the directory directives will depend on where your virtual servers document roots are.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...