You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Alejandro Decchi <ad...@gmail.com> on 2007/04/26 21:34:36 UTC

[users@httpd] Virtual Host

Someone can send a file of configuration of a virtual host where several
authorities or web pages are hosting.
I have apache2 and in this services i had two web pages

Thz

Re: [users@httpd] Virtual Host

Posted by Krist van Besien <kr...@gmail.com>.
On 4/27/07, Alejandro Decchi <ad...@gmail.com> wrote:

> Here in this file i include the configuration like :
>
> <VirtualHost *:80>
>     ServerAdmin admin@juan.com
>     DocumentRoot /etc/apache2/htdocs/
>     ServerName www.juan.com
>     ServerAlias juan .com
>     ErrorLog /etc/apache2/logs/error_log
>     CustomLog /etc/apache2/logs/error_log common
> </VirtualHost>
>
>
> <VirtualHost *:80>
>     ServerAdmin admin@juan.com
>     DocumentRoot /etc/apache2/htdocs/
>     ServerName www.juantere.com
>     ServerAlias juantere .com
>     ErrorLog /etc/apache2/logs/error_log
>     CustomLog /etc/apache2/logs/error_log common
> </VirtualHost>
>
>
>
> then i try to enter to my differen site that are alocated in my server and
> allways my server open the some webpage for old
>
> The i put diferen virtual host for each domain in site-enable and i contunue
> with the some trouble
>
> Someone can Help me ??

You forgot "nameVirtualHost *:80". Remember that the argument to
nameVirtualHost must be identical to what you use in the <Virtualhost
> blocks.

Another thing: I Also have a debian setup. The way I do it, is to not
add things to 000-default, but to create my own file, in
sites-available, and to enable it by linking it to sites-enabled.

Krist

-- 
krist.vanbesien@gmail.com
Bremgarten b. Bern, Switzerland
--
A: It reverses the normal flow of conversation.
Q: What's wrong with top-posting?
A: Top-posting.
Q: What's the biggest scourge on plain text email discussions?

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Virtual Host

Posted by Victor Trac <vi...@gmail.com>.
If juan.com and juantere.com are serving the same docroot, just
collapse them into a single VirtualHost directive.  /etc is also not a
good storage location for your htdocs.  Also, why is there a space
between juan and .com in your ServerAlias?

I suggest the following:

<VirtualHost *:80>
    ServerAdmin admin@juan.com
    DocumentRoot /var/www/juan.com  ## don't put your htdocs in your /etc
    ServerName juan.com
    ServerAlias www.juan.com
    ServerAlias juantere.com
    ServerAlias www.juantere.com
    ErrorLog /etc/apache2/logs/error_log
    CustomLog /etc/apache2/logs/error_log common
</VirtualHost>

Hope that helps.

--Victor

On 5/1/07, j k <jo...@gmail.com> wrote:
> Maybe you need a different doc root for each site else it will end serving
> from the same doc root for all sites
>
> On 4/27/07, Alejandro Decchi < adecchi@gmail.com> wrote:
> >
> >
> > <snip/>
> > Here in this file i include the configuration like :
> >
> > <VirtualHost *:80>
> >     ServerAdmin admin@juan.com
> >     DocumentRoot /etc/apache2/htdocs/     <==========here
> >     ServerName www.juan.com
> >     ServerAlias juan .com
> >     ErrorLog /etc/apache2/logs/error_log
> >     CustomLog /etc/apache2/logs/error_log common
> > </VirtualHost>
> >
> >
> > <VirtualHost *:80>
> >     ServerAdmin admin@juan.com
> >     DocumentRoot /etc/apache2/htdocs/    <=========== and here
> >     ServerName www.juantere.com
> >     ServerAlias juantere .com
> >     ErrorLog /etc/apache2/logs/error_log
> >     CustomLog /etc/apache2/logs/error_log common
> > </VirtualHost>
> >
> >
> >
> > then i try to enter to my differen site that are alocated in my server and
> allways my server open the some webpage for old
> >
> > The i put diferen virtual host for each domain in site-enable and i
> contunue with the some trouble
> >
> > Someone can Help me ??
> >
> >
>
>


-- 
http://www.victortrac.com

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Virtual Host

Posted by j k <jo...@gmail.com>.
Maybe you need a different doc root for each site else it will end serving
from the same doc root for all sites

On 4/27/07, Alejandro Decchi <ad...@gmail.com> wrote:
>
>
> <snip/>
> Here in this file i include the configuration like :
>
> <VirtualHost *:80>
>     ServerAdmin admin@juan.com
>     DocumentRoot /etc/apache2/htdocs/     <==========here
>     ServerName www.juan.com
>     ServerAlias juan .com <http://domain.com/>
>     ErrorLog /etc/apache2/logs/error_log
>     CustomLog /etc/apache2/logs/error_log common
> </VirtualHost>
>
>  <VirtualHost *:80>
>     ServerAdmin admin@juan.com
>     DocumentRoot /etc/apache2/htdocs/    <=========== and here
>     ServerName www.juantere.com
>     ServerAlias juantere .com <http://domain.com/>
>     ErrorLog /etc/apache2/logs/error_log
>     CustomLog /etc/apache2/logs/error_log common
> </VirtualHost>
>
>
>
> then i try to enter to my differen site that are alocated in my server and
> allways my server open the some webpage for old
>
> The i put diferen virtual host for each domain in site-enable and i
> contunue with the some trouble
>
> Someone can Help me ??
>
>
>

Re: [users@httpd] Virtual Host

Posted by Alejandro Decchi <ad...@gmail.com>.
Thz for the configuration file.
I have debian and apache2. I have a line in apache2.conf that said something
like:

# Include the virtual host configurations:
Include /etc/apache2/sites-enabled/

There in  /etc/apache2/sites-enabled/  I have a file called 000-default that
said


NameVirtualHost *
<VirtualHost *>
        ServerAdmin webmaster@localhost

        DocumentRoot /var/www/
        <Directory />
                Options FollowSymLinks
                AllowOverride None
        </Directory>
        <Directory /var/www/>
                Options Indexes FollowSymLinks MultiViews
                AllowOverride None
                Order allow,deny
                allow from all
                # This directive allows us to have apache2's default start
page
                # in /apache2-default/, but still have / go to the right
place
                #RedirectMatch ^/$ /apache2-default/
        </Directory>

        ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
        <Directory "/usr/lib/cgi-bin">
                AllowOverride None

 Options ExecCGI -MultiViews +SymLinksIfOwnerMatch
                Order allow,deny
                Allow from all
        </Directory>

        ErrorLog /var/log/apache2/error.log

        # Possible values include: debug, info, notice, warn, error, crit,
        # alert, emerg.
        LogLevel warn

        CustomLog /var/log/apache2/access.log combined
        ServerSignature On

    Alias /doc/ "/usr/share/doc/"
    <Directory "/usr/share/doc/">
        Options Indexes MultiViews FollowSymLinks
        AllowOverride None
        Order deny,allow
        Deny from all
        Allow from 127.0.0.0/255.0.0.0 ::1/128
    </Directory>
</VirtualHost>

Here in this file i include the configuration like :

<VirtualHost *:80>
    ServerAdmin admin@juan.com
    DocumentRoot /etc/apache2/htdocs/
    ServerName www.juan.com
    ServerAlias juan.com <http://domain.com/>
    ErrorLog /etc/apache2/logs/error_log
    CustomLog /etc/apache2/logs/error_log common
</VirtualHost>

 <VirtualHost *:80>
    ServerAdmin admin@juan.com
    DocumentRoot /etc/apache2/htdocs/
    ServerName www.juantere.com
    ServerAlias juantere.com <http://domain.com/>
    ErrorLog /etc/apache2/logs/error_log
    CustomLog /etc/apache2/logs/error_log common
</VirtualHost>



then i try to enter to my differen site that are alocated in my server and
allways my server open the some webpage for old

The i put diferen virtual host for each domain in site-enable and i contunue
with the some trouble

Someone can Help me ??


On 4/26/07, Piyush Jamkhandi <pi...@gmail.com> wrote:
>
> Alejandro,
>  The following is my setup for vhosts in apache2. There is a file under
> apache2/conf/extra/httpd-vhosts.conf where I put this file.
>
> <VirtualHost *:80>
>     ServerAdmin admin@domain.com
>     DocumentRoot /etc/apache2/htdocs/
>     ServerName www.domain.com
>     ServerAlias domain.com
>     ErrorLog /etc/apache2/logs/error_log
>     CustomLog /etc/apache2/logs/error_log common
> </VirtualHost>
>
> <VirtualHost *:80>
>     ServerAdmin admin@domain.com
>     DocumentRoot /etc/apache2/htdocs/blog/
>     ServerName www.blog.domain.com
>     ServerAlias blog.domain.com
>     ErrorLog /etc/apache2/logs/error_log
>     CustomLog /etc/apache2/logs/access_error_log common
> </VirtualHost>
>
> <VirtualHost *:80>
>     ServerAdmin admin@domain.com
>     DocumentRoot /etc/apache2/htdocs/teampage/
>     ServerName www.teampage.domain.com
>     ServerAlias teampage.domain.com
>     ErrorLog /etc/apache2/logserror_log
>     CustomLog /etc/apache2/logs/error_log common
> </VirtualHost>
>
> --Piyush
>
>
> On 4/26/07, Alejandro Decchi <ad...@gmail.com> wrote:
> >
> >
> > Someone can send a file of configuration of a virtual host where several
> > authorities or web pages are hosting.
> > I have apache2 and in this services i had two web pages
> >
> > Thz
> >
>
>
>
> --
> -----------------------------------------------------------------------
> Ask yourself how you can change to help your future.
> http://www.vibudh.com
> http://blog.vibudh.com
> -----------------------------------------------------------------------

Re: [users@httpd] Virtual Host

Posted by Piyush Jamkhandi <pi...@gmail.com>.
Alejandro,
 The following is my setup for vhosts in apache2. There is a file under
apache2/conf/extra/httpd-vhosts.conf where I put this file.

<VirtualHost *:80>
    ServerAdmin admin@domain.com
    DocumentRoot /etc/apache2/htdocs/
    ServerName www.domain.com
    ServerAlias domain.com
    ErrorLog /etc/apache2/logs/error_log
    CustomLog /etc/apache2/logs/error_log common
</VirtualHost>

<VirtualHost *:80>
    ServerAdmin admin@domain.com
    DocumentRoot /etc/apache2/htdocs/blog/
    ServerName www.blog.domain.com
    ServerAlias blog.domain.com
    ErrorLog /etc/apache2/logs/error_log
    CustomLog /etc/apache2/logs/access_error_log common
</VirtualHost>

<VirtualHost *:80>
    ServerAdmin admin@domain.com
    DocumentRoot /etc/apache2/htdocs/teampage/
    ServerName www.teampage.domain.com
    ServerAlias teampage.domain.com
    ErrorLog /etc/apache2/logserror_log
    CustomLog /etc/apache2/logs/error_log common
</VirtualHost>

--Piyush


On 4/26/07, Alejandro Decchi <ad...@gmail.com> wrote:
>
>
> Someone can send a file of configuration of a virtual host where several
> authorities or web pages are hosting.
> I have apache2 and in this services i had two web pages
>
> Thz
>



-- 
-----------------------------------------------------------------------
Ask yourself how you can change to help your future.
http://www.vibudh.com
http://blog.vibudh.com
-----------------------------------------------------------------------