User cannot occur within <VirtualHost> section

m4ri00sh

Verified User
Joined
May 20, 2007
Messages
206
new OS and DA ionstall:
Added my 5 extra IPs first....
then I added my main domain...
first IP has server...
second IP I assigned to a"admin" and is shared..... and I get the error ....

"User cannot occur within <VirtualHost> section"


Apache2 does not start.....
 
Last edited:
Try:
Code:
cd /usr/local/directadmin/custombuild
./build rewrite_confs
 
It is complaining about this.....
What is the ./rewrite_confs going to do .... except that is going to rewrite configs :)

# Auto generated apache config file by DirectAdmin version 1.30.1
# Modifying this file is not recommended as any changes you make will be
# overwritten when you add/remove ip's through DirectAdmin.

LogFormat "%b \"%r\"" homedir
NameVirtualHost 67.159.55.148:80
NameVirtualHost 67.159.55.148:443
NameVirtualHost 67.159.77.202:80
NameVirtualHost 67.159.77.202:443
<VirtualHost 67.159.77.202:80>
ServerName shared.domain
ScriptAliasMatch ^/~([^/]+)/+cgi-bin/+(.*) /home/$1/public_html/cgi-bin/$2
AliasMatch ^/~([^/]+)(/.*)* /home/$1/public_html$2
DocumentRoot /home/admin/domains/sharedip

User admin
Group admin

CustomLog /var/log/httpd/homedir.log homedir
</VirtualHost>

<VirtualHost 67.159.77.202:443>
SSLEngine on
SSLCertificateFile /etc/httpd/conf/ssl.crt/server.crt
SSLCertificateKeyFile /etc/httpd/conf/ssl.key/server.key
ServerName shared.domain
ScriptAliasMatch ^/~([^/]+)/+cgi-bin/+(.*) /home/$1/public_html/cgi-bin/$2
AliasMatch ^/~([^/]+)(/.*)* /home/$1/public_html$2
DocumentRoot /home/admin/domains/sharedip

User admin
Group admin

CustomLog /var/log/httpd/homedir.log homedir
</VirtualHost>

NameVirtualHost 67.159.77.203:80
NameVirtualHost 67.159.77.203:443
NameVirtualHost 67.159.77.204:80
NameVirtualHost 67.159.77.204:443
NameVirtualHost 67.159.77.205:80
NameVirtualHost 67.159.77.205:443
NameVirtualHost 67.159.77.206:80
NameVirtualHost 67.159.77.206:443
 
You have apache 1.3 configs instead of 2.x. That's why you're getting this error.
 
what about the solution ....

This solved my problem. For anyone else who has this problem--

What was once ..

<VirtualHost domain.com>
User username
Group foo
</VirtualHost>

now becomes

<VirtualHost domain.com>
SuexecUserGroup username foo
</VirtualHost>
 
Last edited:
I made my change but after that I got another problem :) hahaha
so I ran the ./build rewrite_confs and it is all working .....

thank you SMTALK :D
 
OK, the problem is back.....

I think DA overwrote the configs again....

so what now if that is a case ?
 
Are you sure that apache_ver=2.0 is set into /usr/local/directadmin/conf/directadmin.conf ?
 
Yes, it is...
and you know what....
I added new user..... Reseller... and the apache2 did not start again....
so I checked under directadmin/data/users/myreseller his httpd.conf config and he had those setting screwed up, I modified the setting manually (SuexecUserGroup) and I was able to restart httpd and it is running.... so for sure it's DA doing it ..... found a BUG :)

smtalk:
can you explain that do DA support :)
 
Yeap.... I shared some IPs, created user, it does screw configs :)

and another bug...
I deleted reseller and an entry in
/etc/httpd/conf/extra/directadmin-vhosts.conf
for the deleted user, was still there..... so I just deleted the line, which pointed to the not existing httpd.conf file for that user... and httpd daemon starts again :P

wow ... just scared of just changing anything....
 
Hello,

One things I've seen is where the setting might be present, but directadmin itself didn't get restarted for whatever unknown reason. Do a full restart of DA to ensure the value is loaded.
Code:
cd /usr/local/directadmin
killall -9 directadmin
./directadmin d
to do the full restart.

John
 
If you've restarted the server, then yes, that would restart DA.
You can make sure DA is reading it in by typing:
Code:
/usr/local/directadmin c | grep apache_ver
If it says apache_ver=1.3, then there would be a typo in the directadmin.conf on that line.. *or* if it's the very last line, it might be missing a newline character after it. Add a blank line (press enter a few times) to ensure that has a new line after it.

Failing that, if you'd like us to look:
https://www.directadmin.com/clients/safesubmit.php

John
 
hmmm the command.... returns that :) hmmm???

bash: /usr/local/directadmin: is a directory


but I did
cat /usr/local/directadmin/conf/directadmin.conf | grep apache_ver
returned ...
apache_ver=2.0

+ I added some more empty lines at the end of the config.... after the above line..... will check tomorrow what is going on after I make some changes...
 
Last edited:
Just to be extra sure, make sure there is not a space after the 0 in 2.0. If there is even one space at the end, the match of "2.0" and "2.0 " will fail, thus you'd get 1.3 settings.

If that still doesn't do it, let us know and we can check your system.

John
 
Back
Top