You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Peter Biggerstaff <pe...@biggerstaff.co.nz> on 2014/05/20 03:39:39 UTC

[users@httpd] Virtual Hosts not working

Hi All,

I am tearing my hair out trying to get virtual hosts to work, but apache 
seems to be ignoring the /etc/apache2/sites-enabled config files.

I have been trying all morning to get it to work, and here is the 
current state:

IncludeOptional sites-enabled/*.conf is in the /etc/apache2/apache2.conf

in /etc/init.d/sites-available I have a file called virtualhosts with 
the following config:

# Ensure that Apache listens on port 80
Listen 80
<VirtualHost *:80>
     DocumentRoot /var/www/html
     ServerName biggerstaff.co.nz
</VirtualHost>

<VirtualHost *:80>
     DocumentRoot /var/www/html/mail/
     ServerName mail.biggerstaff.co.nz
</VirtualHost>

only mail.biggerstaff.co.nz has a DNS entry set up at this stage, so in 
theory if I go to http://mail.biggerstaff.co.nz I should go though to 
/var/www/html/mail/ right?

I have a symbolic link in /etc/init.d/sites-enabled/virtualhosts --> 
/etc/init.d/sites-available/virtualhosts

when I navigate to http://mail.biggerstaff.co.nz I end up at the file 
list in /var/www

There are no error logs etc.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Virtual Hosts not working

Posted by "Mackey, Harold A." <ma...@musc.edu>.
Is this in the .conf?

NameVirtualHost *:80

Harold Mackey
Digestive Disease Center
MUSC
843-876-5926

http://www.ddc.musc.edu


Email Disclaimer:  If you have received this communication in error, please notify the sender immediately. The documents accompanying this facsimile/electronic transmission contain confidential information intended only for the use of the individual or entity to which it is addressed and may contain information that is privileged, confidential, and exempt from disclosure. If the reader of this message is not the intended recipient, or an employee responsible for delivering the message to the intended recipient, you are hereby notified that any disclosure, dissemination, distribution, or copying of this communication is strictly prohibited.

From: Curtis Maurand <cu...@maurand.com>>
Reply-To: "users@httpd.apache.org<ma...@httpd.apache.org>" <us...@httpd.apache.org>>
Date: Monday, May 19, 2014 at 11:51 PM
To: "users@httpd.apache.org<ma...@httpd.apache.org>" <us...@httpd.apache.org>>
Subject: Re: [users@httpd] Virtual Hosts not working

Check ypur ports.conf for the NameVirtualHost directive.

On May 19, 2014 9:39:39 PM EDT, Peter Biggerstaff <pe...@biggerstaff.co.nz>> wrote:

Hi All,

I am tearing my hair out trying to get virtual hosts to work, but apache
seems to be ignoring the /etc/apache2/sites-enabled config files.

I have been trying all morning to get it to work, and here is the
current state:

IncludeOptional sites-enabled/*.conf is in the /etc/apache2/apache2.conf

in /etc/init.d/sites-available I have a file called virtualhosts with
the following config:

# Ensure that Apache listens on port 80
Listen 80
<VirtualHost *:80>
     DocumentRoot /var/www/html
     ServerName biggerstaff.co.nz<http://biggerstaff.co.nz>
</VirtualHost>

<VirtualHost *:80>
     DocumentRoot /var/www/html/mail/
     ServerName mail.biggerstaff.co.nz<http://mail.biggerstaff.co.nz>
</VirtualHost>

only mail.biggerstaff.co.nz<http://mail.biggerstaff.co.nz> h!
 as a DNS
entry set up at this stage, so in
theory if I go to http://mail.biggerstaff.co.nz I should go though to
/var/www/html/mail/ right?

I have a symbolic link in /etc/init.d/sites-enabled/virtualhosts -->
/etc/init.d/sites-available/virtualhosts

when I navigate to http://mail.biggerstaff.co.nz I end up at the file
list in /var/www

There are no error logs etc.

________________________________

To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org<ma...@httpd.apache.org>
For additional commands, e-mail: users-help@httpd.apache.org<ma...@httpd.apache.org>


--
Sent from my Android phone with K-9 Mail. Please excuse my brevity.

Re: [users@httpd] Virtual Hosts not working

Posted by Curtis Maurand <cu...@maurand.com>.
Check ypur ports.conf for the NameVirtualHost directive.

On May 19, 2014 9:39:39 PM EDT, Peter Biggerstaff <pe...@biggerstaff.co.nz> wrote:
>Hi All,
>
>I am tearing my hair out trying to get virtual hosts to work, but
>apache 
>seems to be ignoring the /etc/apache2/sites-enabled config files.
>
>I have been trying all morning to get it to work, and here is the 
>current state:
>
>IncludeOptional sites-enabled/*.conf is in the
>/etc/apache2/apache2.conf
>
>in /etc/init.d/sites-available I have a file called virtualhosts with 
>the following config:
>
># Ensure that Apache listens on port 80
>Listen 80
><VirtualHost *:80>
>     DocumentRoot /var/www/html
>     ServerName biggerstaff.co.nz
></VirtualHost>
>
><VirtualHost *:80>
>     DocumentRoot /var/www/html/mail/
>     ServerName mail.biggerstaff.co.nz
></VirtualHost>
>
>only mail.biggerstaff.co.nz has a DNS entry set up at this stage, so in
>
>theory if I go to http://mail.biggerstaff.co.nz I should go though to 
>/var/www/html/mail/ right?
>
>I have a symbolic link in /etc/init.d/sites-enabled/virtualhosts --> 
>/etc/init.d/sites-available/virtualhosts
>
>when I navigate to http://mail.biggerstaff.co.nz I end up at the file 
>list in /var/www
>
>There are no error logs etc.
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>For additional commands, e-mail: users-help@httpd.apache.org

-- 
Sent from my Android phone with K-9 Mail. Please excuse my brevity.

Re: [users@httpd] Virtual Hosts not working

Posted by "Greg Rundlett (freephile)" <gr...@freephile.com>.
Actually, you could have named it ANYTHING.conf  Apache is only "seeing"
files that end in .conf as per your include directive:

IncludeOptional sites-enabled/*.conf

So, if you want to disable a site config called example.conf, you can do so
by renaming it example.conf.disabled and reloading Apache.
Also, if you make a backup of example.conf as example.conf.bak, then Apache
won't load the (redundant) backup configuration.

Greg Rundlett
http://eQuality-Tech.com
http://freephile.org


On Mon, May 19, 2014 at 10:21 PM, Peter Biggerstaff <peter@biggerstaff.co.nz
> wrote:

> Every time you spend a whole morning on something, then give up and mail
> someone, you find the solution right after!
>
> Had to rename the file to 000-default.conf which was missing!
>
>
> On 2014-05-20 13:39, Peter Biggerstaff wrote:
>
>> Hi All,
>>
>> I am tearing my hair out trying to get virtual hosts to work, but
>> apache seems to be ignoring the /etc/apache2/sites-enabled config
>> files.
>>
>> I have been trying all morning to get it to work, and here is the current
>> state:
>>
>> IncludeOptional sites-enabled/*.conf is in the /etc/apache2/apache2.conf
>>
>> in /etc/init.d/sites-available I have a file called virtualhosts with
>> the following config:
>>
>> # Ensure that Apache listens on port 80
>> Listen 80
>> <VirtualHost *:80>
>>     DocumentRoot /var/www/html
>>     ServerName biggerstaff.co.nz
>> </VirtualHost>
>>
>> <VirtualHost *:80>
>>     DocumentRoot /var/www/html/mail/
>>     ServerName mail.biggerstaff.co.nz
>> </VirtualHost>
>>
>> only mail.biggerstaff.co.nz has a DNS entry set up at this stage, so
>> in theory if I go to http://mail.biggerstaff.co.nz I should go though
>> to /var/www/html/mail/ right?
>>
>> I have a symbolic link in /etc/init.d/sites-enabled/virtualhosts -->
>> /etc/init.d/sites-available/virtualhosts
>>
>> when I navigate to http://mail.biggerstaff.co.nz I end up at the file
>> list in /var/www
>>
>> There are no error logs etc.
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>> For additional commands, e-mail: users-help@httpd.apache.org
>>
>
> --
> Regards,
>
> Peter Biggerstaff
> CAT,CAE,FCNSA,WiSE, MCP
>
> Biggerstaff Hosting
>
> http://biggerstaff.co.nz
> peter@biggerstaff.co.nz
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>
>

Re: [users@httpd] Virtual Hosts not working

Posted by Peter Biggerstaff <pe...@biggerstaff.co.nz>.
Every time you spend a whole morning on something, then give up and mail 
someone, you find the solution right after!

Had to rename the file to 000-default.conf which was missing!

On 2014-05-20 13:39, Peter Biggerstaff wrote:
> Hi All,
> 
> I am tearing my hair out trying to get virtual hosts to work, but
> apache seems to be ignoring the /etc/apache2/sites-enabled config
> files.
> 
> I have been trying all morning to get it to work, and here is the 
> current state:
> 
> IncludeOptional sites-enabled/*.conf is in the 
> /etc/apache2/apache2.conf
> 
> in /etc/init.d/sites-available I have a file called virtualhosts with
> the following config:
> 
> # Ensure that Apache listens on port 80
> Listen 80
> <VirtualHost *:80>
>     DocumentRoot /var/www/html
>     ServerName biggerstaff.co.nz
> </VirtualHost>
> 
> <VirtualHost *:80>
>     DocumentRoot /var/www/html/mail/
>     ServerName mail.biggerstaff.co.nz
> </VirtualHost>
> 
> only mail.biggerstaff.co.nz has a DNS entry set up at this stage, so
> in theory if I go to http://mail.biggerstaff.co.nz I should go though
> to /var/www/html/mail/ right?
> 
> I have a symbolic link in /etc/init.d/sites-enabled/virtualhosts -->
> /etc/init.d/sites-available/virtualhosts
> 
> when I navigate to http://mail.biggerstaff.co.nz I end up at the file
> list in /var/www
> 
> There are no error logs etc.
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org

-- 
Regards,

Peter Biggerstaff
CAT,CAE,FCNSA,WiSE, MCP

Biggerstaff Hosting

http://biggerstaff.co.nz
peter@biggerstaff.co.nz

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org