DA update caused problems with NameVirtualHost directive

baraana

New member
Joined
May 11, 2012
Messages
7
Hi, the 10th of May Direct Admin update caused problems with NameVirtualHost directive.

When I try to start httpd I get the following message:

Code:
[root@PPQW003 ~]# /etc/init.d/httpd start
Starting httpd: [Sat May 12 03:22:56 2012] [warn] VirtualHost 94.75.221.83:80 overlaps with VirtualHost 94.75.221.83:80, the first has precedence, perhaps you need a NameVirtualHost directive
[Sat May 12 03:22:56 2012] [warn] VirtualHost 94.75.221.83:443 overlaps with VirtualHost 94.75.221.83:443, the first has precedence, perhaps you need a NameVirtualHost directive
[Sat May 12 03:22:56 2012] [warn] VirtualHost 94.75.221.83:80 overlaps with VirtualHost 94.75.221.83:80, the first has precedence, perhaps you need a NameVirtualHost directive
[Sat May 12 03:22:56 2012] [warn] VirtualHost 94.75.221.83:443 overlaps with VirtualHost 94.75.221.83:443, the first has precedence, perhaps you need a NameVirtualHost directive
[Sat May 12 03:22:56 2012] [warn] VirtualHost 94.75.221.83:80 overlaps with VirtualHost 94.75.221.83:80, the first has precedence, perhaps you need a NameVirtualHost directive

When navigating to the domain www.pixhack.com
I get the following message:
Code:
Apache is functioning normally

I do have:
CentOS 6.0 64-Bit
DA v. 1.40.3

I have tried to follow the guide here on DA for how to solve this isuse but still I got the same problem even though I followed the guide exactly.

Please someone here, perhaps admins, help me with this issue.

Regards

Note: I do have leaseweb but they don't seem to help me with this issue.
 
check your ips.conf

path normal : /etc/httpd/conf/ips.conf

add NameVirtualHost
 
check your ips.conf

path normal : /etc/httpd/conf/ips.conf

add NameVirtualHost

Hi,
and thanks for a quick reply,
My ips.conf file looks like this:
Code:
# Auto generated apache config file by DirectAdmin version 1.40.3
# Modifying this file is not recommended as any changes you make will be
# overwritten when you add/remove ip's through DirectAdmin.

LogFormat "%O \"%r\"" homedir

I tried to make it like:
Code:
# Auto generated apache config file by DirectAdmin version 1.40.3
# Modifying this file is not recommended as any changes you make will be
# overwritten when you add/remove ip's through DirectAdmin.

LogFormat "%O \"%r\"" homedir
NameVirtualHost 94.75.221.83:80
NameVirtualHost 94.75.221.83:443

But it seems like I don't have right permissions to do it even though I am logged in as root.

regards
 
you can try login as user apache and change


How do I login as user apache?
I don't even have the password for it.

Anyway the owner of the file isp.conf looks like to be root:
Code:
[root@PPQW003 conf]# ls -al /etc/httpd/conf/ips.conf 
-rw-r--r--. 1 root root 230 May 11 22:48 /etc/httpd/conf/ips.conf
 
login as apache

su apache

after that you type command

i don't know. normal user root can change and save anything. but you can do it.

or you can add NameVirtualHost to /etc/httpd/conf/httpd.conf
 
login as apache

su apache

after that you type command

i don't know. normal user root can change and save anything. but you can do it.

or you can add NameVirtualHost to /etc/httpd/conf/httpd.conf

It should not be necessary to do that everytime I add a user.
I have located the problem,
Direct Admin, not even root is permitted to change the file ips.conf.
When I try to add an IP through DA-panel I get the following message:

Code:
Unable to open /etc/httpd/conf/ips.conf for writing
 
Hello,

Many admins are locking some of the apache files with chattr.
To unlock a file (if it's locked), type:
Code:
chattr -i /etc/httpd/conf/ips.conf
and then use +i to lock it again.

John
 
Solution for the problem

Hello,

Many admins are locking some of the apache files with chattr.
To unlock a file (if it's locked), type:
Code:
chattr -i /etc/httpd/conf/ips.conf
and then use +i to lock it again.

John

This solved the problem.
THank you soo much John.
regards
 
This solved the problem.
THank you soo much John.
regards

This time when I restart httpd I get the following warning instead, but the domains work now:
Code:
[root@PPQW003 ~]# /etc/init.d/httpd restart
Stopping httpd:                                            [  OK  ]
Starting httpd: [Sat May 12 11:48:59 2012] [warn] NameVirtualHost 94.75.221.83:2222 has no VirtualHosts

What could cause this problem?

How should the ips.conf look like+
 
I see suggestions with
Code:
chattr +i
. Don't! This makes no sense.
The described problem is caused by a wrong value in

Code:
/usr/local/directadmin/custombuild/options.conf
.

Make sure the
Code:
apache_ver

value matches your current installed Apache. Because when You're running
Apache 2.2 and

Code:
options.conf

contains

Code:
2.4

this will cause DA to remove the

Code:
NameVirtualHost


directives from

Code:
/etc/httpd/conf/ips.conf


Fixing this problem (assuming you're running Apache 2.2):


Code:
cd /usr/local/directadmin/custombuild/

# now check if there's a wrong Apache version:
./build options 

# Fix the version
./build set apache_ver 2.2


Now open your DA panel, login as admin and add any IP (like 1.2.3.4)
via `IP Management` (/CMD_IP_MANAGER) and right after that
remove this IP. This will fix your `ips.conf` file.


I hope this helps.



I've described this problem few months ago here https://forum.directadmin.com/showthread.php?t=52032&highlight= but today the same happened on on of my DA servers (All ruinning v. 1.5) so still not fixed.
 
Back
Top