Added user - apache won't restart

blanezx3

Verified User
Joined
Sep 14, 2006
Messages
16
Location
Virginia
Hello

The past few times I've added a user to our server apache hasn't restarted. I traced the problem to ips.conf and httpd.conf being overwritten, so I replaced them from backups.

Code:
[root@serv1 conf]# httpd start
Syntax error on line 1 of /etc/httpd/conf/ips.conf:
</VirtualHost> without matching <VirtualHost> section
[root@serv1 conf]# cp /home/blane/httpconfs/httpd.conf .
cp: overwrite `./httpd.conf'? y
[root@serv1 conf]# cp /home/blane/httpconfs/ips.conf .
cp: overwrite `./ips.conf'? y
[root@serv1 conf]# httpd start

and then it works.

The only thing in the error log that is fishy is:

Code:
[root@serv1 conf]# tail -20 /var/log/httpd/error_log
[Thu May  3 14:52:15 2007] [error] Cannot remove module mod_perl.c: not found in module list
[Thu May  3 14:52:15 2007] [error] Cannot remove module mod_ssl.c: not found in module list

I uncommented the mod_ssl entry in httpd.conf, but that didn't help either.

The permissions seem to be correct -

Code:
[root@serv1 conf]# ls -al ips.conf httpd.conf
-rw-r--r--  1 root root 25947 May  3 14:57 httpd.conf
-rw-r--r--  1 root root 12138 May  3 14:57 ips.conf

Why is ips.conf being re-written and not including the first 20-30 lines? I can't figure it out :( I followed the steps to rebuild, which were

Code:
cd /usr/local/directadmin/customapache
./build clean
rm -f configure.*
./build update
./build all


Anyone have a clue? I'm stumped.

Thanks in advance
 
Anyone? The problem doesn't want to go away.

Can someone at least tell me if the permissions are correct for the files listed in the above post?
 
Try this:
Code:
cd /usr/local/directadmin
wget http://files.directadmin.com/services/custombuild/beta/custombuild.tar.gz
tar xvzf custombuild.tar.gz
cd custombuild
perl -pi -e 's/2.2/1.3/' build
./build update_data
./build all d
 
It couldn't happen, because your httpd.conf is rewritten now.
 
It did happen. Gave the same error -

Code:
[root@serv1 conf]# httpd start
Syntax error on line 1 of /etc/httpd/conf/ips.conf:
</VirtualHost> without matching <VirtualHost> section

I copied a backup ips.conf to /etc/httpd/conf/ and it works, but I'd like to not have to do that everytime a user is added. It's being re-written incorrectly somehow and I can't figure it out.

Any other suggestions?
 
Just so I'm being clear (not sure if i was before), when I add a user /etc/httpd/conf/ips.conf gets re-written. When it is re-written and apache tries to start, it fails with the error:
Code:
Syntax error on line 1 of /etc/httpd/conf/ips.conf:
</VirtualHost> without matching <VirtualHost> section

Which script modifies ips.conf when the user is added? Is there an error log for the useradd in DA?
 
DirectAdmin doesn't use scripts; it's a C++ program.

What do the first five lines of your /etc/httpd/conf/ips.conf file look like after the user is added? Mine looks like:
Code:
# Auto generated apache config file by DirectAdmin version 1.29.4
# 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

What do you get as the output ofls -al /etc/httpd/conf/ips.conf?

What version of DirectAdmin are you using?

DirectAdmin logs what it does at /var/log/directadmin/. The error log is at /var/log/directadmin/error.log.

Jeff
 
[root@serv1 ~]# ls -al /etc/httpd/conf/ips.conf
-rw-r--r-- 1 root root 12138 May 4 12:18 /etc/httpd/conf/ips.conf

We're using v1.28.0


The first 5 lines of ips.conf now look like

Code:
</VirtualHost>

<VirtualHost IP.add.re.ss:443>
#       SSLEngine on
#       SSLCertificateFile /etc/httpd/conf/ssl.crt/server.crt

after adding a user. Once I replace it with the backup it's fine and will start correctly.
 
Now we're getting somewhere. Obviously DA is copying something incorrectly. I can't figure out where. Have you contacted them for support?

Jeff
 
Not yet. I was hoping to find the answers here before escalating the situation. I guess I'll do that now.
 
FYI, my reply was to update DA. Not quite sure what the initial problem was.. we didn't use templates with 1.28.0 .. possibly a corrupted binary, or OS mismatch. If you have any problems after upgrading to 1.29.6, let us know.

John
 
Can someone tell me the correct permissions of httpd.conf and ips.conf?

Right now I have:

-rw-r--r-- 1 root root

For all .conf files in /etc/httpd/conf
 
Nevermind. John with DA support has helped me fix these problems.

Many kudos to John for helping me get this resolved!
 
Just to get the info out there in search engines.


I did rebuild DA per John's instructions. I then copied an old httpd.conf and ips.conf over to /etc/httpd/conf/ and uncommented the SSL entries. From there we realized that DA was calling /etc/httpd/conf/extra/directadmin-vhosts.conf instead of /etc/httpd/conf/httpd.conf. To fix that, John said to remove all "user" entries in /etc/httpd/conf/httpd.conf and to use an include statement.

So I deleted everything in httpd.conf that had, for example:
Code:
Include /usr/local/directadmin/data/users/testuser/httpd.conf
and added
Code:
Include /etc/httpd/conf/extra/directadmin-vhosts.conf

This last line has all of your user links and calls the appropriate file for the person.

HTH future people!
 
Back
Top