I get errors including "apache config test fails, aborting" when trying to create a subdomain. What do I do?

6,756

Make sure the directories that are missing are created. These directories should have appropriate permissions as well. Usually 755 permissions are sufficient.

Exmaple as below.

mkdir /var/www/example.com/subdomain
mkdir /var/log/apache2

Replace example.com and subdomain with actual directory names.

Share:
6,756

Related videos on Youtube

Jason
Author by

Jason

Updated on September 18, 2022

Comments

  • Jason
    Jason over 1 year

    I just made a change to the httpd.conf file. The reason I did this is I'm trying to set up a subdomain. I now would like to restart apache2, but when I try to restart I run into a slew of errors. Specifically I added the changes that are found here https://stackoverflow.com/questions/4203580/creating-subdomains-in-amazon-ec2 to the httpd.conf file

    <VirtualHost *:80>
      ServerName subdomain.example.com
      ServerAdmin [email protected]
    
      DocumentRoot /var/www/example.com/subdomain
    
      <Directory /var/www/example.com/subdomain>
        Options Indexes FollowSymLinks MultiViews
        AllowOverride All
        Order allow,deny
        allow from all
      </Directory>
    
      ErrorLog /var/log/apache2/subdomain.example.com.error.log
      LogLevel warn
      CustomLog /var/log/apache2/subdomain.example.com.access.log combined
    </VirtualHost>
    

    but when I try to restart apache I get the following errors.

    AH00112: Warning: DocumentRoot [/var/www/xxx.com/subdomain] does not exist
    (2)No such file or directory: AH02291: Cannot access directory '/var/log/apache2/' for error log of vhost defined at /xxx/xxx/apache2/conf/httpd.conf:193
    AH00014: Configuration check failed
    apache config test fails, aborting
    AH00112: Warning: DocumentRoot [/var/www/xxxcom/subdomain] does not exist
    (2)No such file or directory: AH02291: Cannot access directory '/var/log/apache2/' for error log of vhost defined at /opt/bitnami/apache2/conf/httpd.conf:193
    AH00014: Configuration check failed
    apache config test fails, aborting
    

    so lets break down these errors

    1. AH00112: Warning: DocumentRoot [/var/www/xxx.com/subdomain] does not exist (2)No such file or directory: to fix this do I add a file /var/www/xxx.com/subdomain if so should it be empty or have stuff in
      it. If it should have stuff in there what type of stuff?

    2. AH02291: Cannot access directory '/var/log/apache2/' for error log of vhost defined at
      /xxx/xxx/apache2/conf/httpd.conf:193
      I don't know what this means or what to do about it.

    3. AH00014: Configuration check failed apache config test fails, aborting I'm not sure what to do here either.

    4. AH02291: Cannot access directory '/var/log/apache2/' for error log of vhost defined at /xxx/xxx/apache2/conf/httpd.conf:193 Do I do the same thing ans error AH00112