[SOLVED] Apache refuses to start
In /etc/apache2/sites-available/ I have "domain.com" which works fine. I then duplicated it and renamed to "sub.domain.com" and ln -s'd it to sites-enabled.
When I tried to start Apache it failed. The subdomain is already added in /etc/hosts as "sub.domain.com". What might be causing this, any ideas?
"domain.com" in sites-available:
<virtualhost *="">ServerAdmin admin@domain.com
ServerName domain.com
ServerAlias www.domain.com
DocumentRoot /var/www/vhosts/domain.com/htdocs
# <directory var="" www="" vhosts="" domain.com="">AddHandler fcgid-script .php
FCGIWrapper /usr/lib/cgi-bin/php5 .php
#</directory>
LogLevel warn
ErrorLog /var/www/vhosts/domain.com/log/error.log
CustomLog /var/www/vhosts/domain.com/log/access.log combined</virtualhost>
… and "sub.domain.com" file:
<virtualhost *="">ServerAdmin admin@domain.com
ServerName sub.domain.com
DocumentRoot /var/www/vhosts/domain.com/subdomains/sub/htdocs
# <directory var="" www="" vhosts="" domain.com="" subdomains="" sub="">#AddHandler fcgid-script .php
#FCGIWrapper /usr/lib/cgi-bin/php5 .php
#</directory>
LogLevel warn
ErrorLog /var/www/vhosts/domain.com/subdomains/sub/log/error.log
CustomLog /var/www/vhosts/domain.com/subdomains/sub/log/access.log combined</virtualhost>
4 Replies
Other than that, the configuration looks fine to me.
As of Apache 2.2, I believe it ships with the command a2ensite. Run that command to enable the site, and it should get you going.
In simple terms, all it does is creating a symlink for the site from …/sites-available/ to …/sites-enabled/.
NeonNero, as I've mentioned in my previous post, it's already enabled.
Now that this is done, I've added the subdomain as an A record in Linode DNS Manager. Should I wait for the TTL to expire? Because right now, sub.domain.com doesn't resolve.