upgraded from ubuntu 12.04 to 14.04 -- apache question

So I am wondering in addition to the instructions given: https://virtualmin.com/documentation/system/os/ubuntu-precise-to-trusty

do i also need to adjust the way NamedVirtualHost is configured

currently its:

NameVirtualHost 108.61.213.138:80 NameVirtualHost 108.61.213.225:80

and then a snipet from sites-enabled: root@caesium:/etc/apache2/sites-enabled# cat qtrust.com.au.conf SuexecUserGroup "#1006" "#1006" ServerName qtrust.com.au ServerAlias www.qtrust.com.au ServerAlias webmail.qtrust.com.au ServerAlias admin.qtrust.com.au DocumentRoot /home/qtrust/public_html ErrorLog /var/log/virtualmin/qtrust.com.au_error_log CustomLog /var/log/virtualmin/qtrust.com.au_access_log combined ScriptAlias /cgi-bin/ /home/qtrust/cgi-bin/ ScriptAlias /awstats/ /home/qtrust/cgi-bin/ DirectoryIndex index.html index.htm index.php index.php4 index.php5 Options -Indexes +IncludesNOEXEC +SymLinksIfOwnerMatch +ExecCGI allow from all AllowOverride All Options=ExecCGI,Includes,IncludesNOEXEC,Indexes,MultiViews,SymLinksIfOwnerMatch AddHandler fcgid-script .php AddHandler fcgid-script .php5 FCGIWrapper /home/qtrust/fcgi-bin/php5.fcgi .php

my question is should i replace all instances of ip.ip.ip.ip:port to *:port

?

Regards

Angus

Status: 
Closed (fixed)

Comments

Howdy -- you shouldn't need to change that.

In fact, I'd suggest keeping it as-is.

Are you experiencing a problem of some sort though?

I wouldnt say a problem, just a this feature is about to be deprecated :)

see below: AH00548: NameVirtualHost has no effect and will be removed in the next release /etc/apache2/apache2.conf:240

Ah, yeah the "NameVirtualHost" lines themselves are no longer necessary.

The line in your "qtrust.com.au.conf" file is still correct, and it should continue to have the IP address that it has now.

What's changed is that you no longer need to specify "NameVirtualHost x.x.x.x:80" in the Apache config.

Beginning with Apache 2.4, Apache will assume that it's a Name-based VirtualHost if the IP address shows up for more than one domain. It's no longer necessary to explicitly state that.

Excellent :)

next question is when i create a new site its now wanting to use *:port as the NameVirtualHost in the config file for the domain in /etc/apache2/sites-enabled (sites-available)

is there something i need to change or adjust? Ive only noticed this happening since going to 14.04, but that said it may of been happening prior with 12.04 and virtulmin 4.09/08

Regards

Gus

Are there any files in /etc/apache2/sites-enabled that contain that "*:80" in them? That could cause Virtualmin to use that syntax for new domains.

You could try running this command to determine that:

grep -i '<virtualhost ' /etc/apache2/sites-enabled/*.conf

thanks :)

there is one entry! root@caesium:~# grep -i '<virtualhost ' /etc/apache2/sites-enabled/*.conf ................/etc/apache2/sites-enabled/000-default.conf:

should i adjust the default? :)

Cheers

Gus

Yeah you don't actually need that 000-default.conf file, you're welcome to disable that and then restart Apache.

thank you :)

G'day Andy

so i just created a new host, and had to manually change the /etc/apache/sites-availabe (enabled) top line from

<VirtualHost *:80>
SuexecUserGroup "#1009" "#1009"
ServerName reeltimepeople.com.au
ServerAlias www.reeltimepeople.com.au
ServerAlias webmail.reeltimepeople.com.au

to

<VirtualHost 108.61.213.138:80>
SuexecUserGroup "#1009" "#1009"
ServerName reeltimepeople.com.au
ServerAlias www.reeltimepeople.com.au
ServerAlias webmail.reeltimepeople.com.au

is there something i should be adjusting? of note: this only happened since the 14.04 LTS update.

Hmm, I'm not sure I see what changed between the "before" and "after", what update was it you needed to make to that domain?

And was that domain added before or after you upgraded to Ubuntu 14.04?

Sorry so what i had to change was:

VirtualHost *:80 to VirtualHost 108.61.213.138:80

and this site was added after the update to 14.04 LTS.

Aha, I understand now! Is there by chance a new file named 000-default in your /etc/apache2/sites-enabled directory? If so, can you check if it's using "*:80"?

If it's not, I suspect some other file is -- but chances are that a 000-default file was created by Apache during the upgrade process.

it was in there, however i removed it! :)

and from sites-available

of note is the screen shot, not sure where its getting that config from..

Just to clarify, are you saying that even after removing that, Virtualmin is still adding Virtual Host entries using the *:80 format?

root@caesium:/etc/apache2# grep -ir "VirtualHost" . ./apache2.conf.dpkg-old:# If you do not specify an ErrorLog directive within a ./apache2.conf.dpkg-old:# logged here. If you do define an error logfile for a ./apache2.conf.dpkg-old:NameVirtualHost 108.61.213.138:80 ./apache2.conf.dpkg-old:NameVirtualHost 108.61.213.225:80 ./conf-available/localized-error-pages.conf:# even on a per-VirtualHost basis. If you include the Alias in the global server ./conf-available/other-vhosts-access-log.conf:# Define an access log for VirtualHosts that don't define their own logfile ./sites-available/fitnessbythebay.com.au.conf: ./sites-available/fitnessbythebay.com.au.conf: ./sites-available/reeltimeproductions.com.au.conf: ./sites-available/reeltimeproductions.com.au.conf: ./sites-available/gciaustralia.com.au.conf: ./sites-available/gciaustralia.com.au.conf: ./sites-available/remogreco.com.conf: ./sites-available/remogreco.com.conf: ./sites-available/default.disabled: ./sites-available/default.disabled: ./sites-available/owncloud.gusswendson.com.conf: ./sites-available/owncloud.gusswendson.com.conf: ./sites-available/stevencollette.com.conf: ./sites-available/stevencollette.com.conf: ./sites-available/reeltimepeople.com.au.conf: ./sites-available/reeltimepeople.com.au.conf: ./sites-available/qtrust.com.au.conf: ./sites-available/qtrust.com.au.conf: ./apache2.conf:# If you do not specify an ErrorLog directive within a ./apache2.conf:# logged here. If you do define an error logfile for a ./apache2.conf:NameVirtualHost 108.61.213.138:80 ./apache2.conf:NameVirtualHost 108.61.213.225:80 ./apache2.conf.old:# If you do not specify an ErrorLog directive within a ./apache2.conf.old:# logged here. If you do define an error logfile for a root@caesium:/etc/apache2#

So i cant really see anything out of place there...

attached is the proper grep output!

cheers

ps: thanks for your quick response. this isnt urgent by any strech :)

Jamie, when using Apache 2.4 (which no longer uses a "NameVirtualHost" line), how does Virtualmin determine how to format the "VirtualHost" line for each domain's Apache config?

In this case here, it seems to be adding that using "VirtualHost *:80", but so far as we can see, all the existing entries use "x.x.x.x:80", and there is no NameVirtualHost line.

In this case the goal is to get it to add that using "VirtualHost x.x.x.x:80".

So for Apache 2.4, Virtualmin will use *:80 for IPs that are shared, and x.x.x.x:80 for private IPs.

"So for Apache 2.4, Virtualmin will use *:80 for IPs that are shared, and x.x.x.x:80 for private IPs."

Mate, is there a way to get it to use x.x.x.x:80 for shared and private ip's? :)

its a non issue but yeah It would be handy.

Currently, no. But I am starting to suspect that using x.x.x.x:80 in the case where no existing VirtualHost is using *:80 would make sense.

agreed :)

thanks... sounds like 4.10 will include this!! ;-)

Gus

I'll look into this and see what improvements make sense - certainly the currrent logic could be massively cleaned up, especially now that Apache 2.4 has simplified the way virtual hosts work.

FYI, the 4.12 Virtualmin release will use IPs instead of * in the VirtualHost directive.

Automatically closed -- issue fixed for 2 weeks with no activity.