problem with virtualhosts after update apache

hisairnes

Verified User
Joined
Feb 23, 2011
Messages
12
after update system

Code:
cd /usr/local/directadmin/custombuild
./build update
./build all d

restart httpd and get warning.
Code:
Starting httpd: Warning: DocumentRoot [/domains/DOMAIN.COM/public_html] does not exist
Warning: DocumentRoot [/domains/DOMAIN.COM/private_html] does not exist

DocumentRoot must point to :

/home/USER/domains/DOMAIN.COM/private_html
and
/home/USER/domains/DOMAIN.COM/public_html

I ran :
Code:
cd /usr/local/directadmin/custombuild
./build rewrite_confs

but still get this warning

people from internet are unable to access DOMAIN.COM

any suggestions ?
 
Did you modify the virtual_host2.conf and virtual_host2_secure.conf
files from the /usr/local/directadmin/templates directory?

They should look similar to this:
Code:
|?DOCROOT=`HOME`/domains/`DOMAIN`/public_html|
...
        DocumentRoot |DOCROOT|
The DOCROOT at the top says to use the $HOME/domains/$DOMAIN/public_html and the next DOCROOT actually sets it. For some reason yours didn't set the `HOME` portion of the DOCROOT.
 
virtual_host.conf

Code:
root@hosting:/usr/local/directadmin/custombuild# cat /usr/local/directadmin/data/templates/virtual_host.conf
|?DOCROOT=`HOME`/domains/`DOMAIN`/public_html|
|?OPEN_BASEDIR_PATH=`HOME`/:/tmp:/var/tmp:/usr/local/lib/php/|
<VirtualHost |IP|:80 |MULTI_IP|>
|CUSTOM|
|?CGI=ScriptAlias /cgi-bin/ `DOCROOT`/cgi-bin/|
        ServerName www.|DOMAIN|
        ServerAlias www.|DOMAIN| |DOMAIN| |SERVER_ALIASES|
        ServerAdmin |ADMIN|
        DocumentRoot |DOCROOT|
        |CGI|

        |USECANONICALNAME|

        User |USER|
        Group |GROUP|
        CustomLog /var/log/httpd/domains/|DOMAIN|.bytes bytes
        CustomLog /var/log/httpd/domains/|DOMAIN|.log combined
        ErrorLog /var/log/httpd/domains/|DOMAIN|.error.log

        <Directory |DOCROOT|>
                Options +Includes -Indexes
|*if CLI="1"|
                php_admin_flag engine |PHP|
                <IfModule !mod_php6.c>
                        php_admin_flag safe_mode |SAFE_MODE|
                </IfModule>
                php_admin_value sendmail_path '/usr/sbin/sendmail -t -i -f |USER|@|DOMAIN|'
|*endif|
|*if OPEN_BASEDIR="ON"|
                php_admin_value open_basedir |OPEN_BASEDIR_PATH|
|*endif|
|*if SUPHP="1"|
                suPHP_Engine |PHP|
                suPHP_UserGroup |USER| |GROUP|
|*endif|
        </Directory>
|HANDLERS|
|MIMETYPES|

</VirtualHost>

virtual_host2.conf

Code:
root@hosting:/usr/local/directadmin/custombuild# cat /usr/local/directadmin/data/templates/virtual_host2.conf
|?DOCROOT=`HOME`/domains/`DOMAIN`/public_html|
|?OPEN_BASEDIR_PATH=`HOME`/:/tmp:/var/tmp:/usr/local/lib/php/|
<VirtualHost |IP|:80 |MULTI_IP|>
|CUSTOM|
|?CGI=ScriptAlias /cgi-bin/ `DOCROOT`/cgi-bin/|
        ServerName www.|DOMAIN|
        ServerAlias www.|DOMAIN| |DOMAIN| |SERVER_ALIASES|
        ServerAdmin |ADMIN|
        DocumentRoot |DOCROOT|
        |CGI|

        |USECANONICALNAME|

        SuexecUserGroup |USER| |GROUP|
        CustomLog /var/log/httpd/domains/|DOMAIN|.bytes bytes
        CustomLog /var/log/httpd/domains/|DOMAIN|.log combined
        ErrorLog /var/log/httpd/domains/|DOMAIN|.error.log

        <Directory |DOCROOT|>
                Options +Includes -Indexes
|*if CLI="1"|
                php_admin_flag engine |PHP|
                <IfModule !mod_php6.c>
                        php_admin_flag safe_mode |SAFE_MODE|
                </IfModule>
                php_admin_value sendmail_path '/usr/sbin/sendmail -t -i -f |USER|@|DOMAIN|'
|*endif|
|*if OPEN_BASEDIR="ON"|
                php_admin_value open_basedir |OPEN_BASEDIR_PATH|
|*endif|
|*if SUPHP="1"|
                suPHP_Engine |PHP|
                suPHP_UserGroup |USER| |GROUP|
|*endif|
        </Directory>
|HANDLERS|
|MIMETYPES|

</VirtualHost>
 
What do you have in /usr/local/directadmin/data/templates/custom they would be used prior to the ones in /usr/local/directadmin/data/templates .
 
the same files as in /usr/local/directadmin/data/templates/

Code:
root@hosting:/usr/local/directadmin/data/templates/custom# ls
virtual_host2.conf         virtual_host2_secure_sub.conf  virtual_host.conf         virtual_host_secure_sub.conf
virtual_host2_secure.conf  virtual_host2_sub.conf         virtual_host_secure.conf  virtual_host_sub.conf
 
OK, now look at those files, they are the ones your DirectAdmin is going to use to produce the VirtualHost entries for apache. I am guessing the DOCROOT is missing the `HOME` portion. If so, make sure you add it to look exactly like the original in the templates directory. You may still have to manually update all the /usr/local/directadmin/data/users/*/httpd.conf files to add the /home/$USER to the entries that were added incorrectly.
 
files in custom folder have the same structure as files in templates folder.

Am I able to update automatic all httpd.conf files ?

how?

Manually gonna take so long...
 
I am pretty sure there is a command you can echo into the task queue to rewrite all the .conf files. Do a search on the forum for keywords like rewrite and conf and you should find the exact command.
 
Back
Top