C
corman420
Guest
Hello,
I am trying to enable wildcard DNS so I can use a simple index.php file to redirect according to a subdomain. Simple enough. (Obviously I replaced domain.com with my domain, I havent posted it for security reasons...)
I created a vhost.conf file in the /var/www/vhosts/domain.com/conf/ directory with the following:
<VirtualHost *:80>
ServerName www.domain.com
ServerAlias domain.com
ServerAlias *.domain.com
DocumentRoot /var/www/vhosts/domain.com/httpdocs/
</VirtualHost>
I then followed with this command:
# /usr/local/psa/admin/bin/websrvmng -av
But now I receive the following output:
[root@server conf]# /usr/local/psa/admin/bin/websrvmng -av
Syntax error on line 1 of /var/www/vhosts/nstakeout.com/conf/vhost.conf:
<VirtualHost> cannot occur within <VirtualHost> section
websrvmng: Service /etc/init.d/httpd failed to gracefully restart
websrvmng: Service /etc/init.d/httpd failed to gracefully restart
I then have to remove the vhosts file, and do the /usr/local/psa/admin/bin/websrvmng -av command and then /etc/init.d/httpd reload to get my server back up.
What am I doing wrong?
I am trying to enable wildcard DNS so I can use a simple index.php file to redirect according to a subdomain. Simple enough. (Obviously I replaced domain.com with my domain, I havent posted it for security reasons...)
I created a vhost.conf file in the /var/www/vhosts/domain.com/conf/ directory with the following:
<VirtualHost *:80>
ServerName www.domain.com
ServerAlias domain.com
ServerAlias *.domain.com
DocumentRoot /var/www/vhosts/domain.com/httpdocs/
</VirtualHost>
I then followed with this command:
# /usr/local/psa/admin/bin/websrvmng -av
But now I receive the following output:
[root@server conf]# /usr/local/psa/admin/bin/websrvmng -av
Syntax error on line 1 of /var/www/vhosts/nstakeout.com/conf/vhost.conf:
<VirtualHost> cannot occur within <VirtualHost> section
websrvmng: Service /etc/init.d/httpd failed to gracefully restart
websrvmng: Service /etc/init.d/httpd failed to gracefully restart
I then have to remove the vhosts file, and do the /usr/local/psa/admin/bin/websrvmng -av command and then /etc/init.d/httpd reload to get my server back up.
What am I doing wrong?