So I've already checked through my config file and I really can't see an instance where any tag hasn't been properly closed...but I keep getting this configuration error...Would you mind taking a look through the error and the config file below? Any assistance would be greatly appreciated.

FYI, I've already googled the life out of the error and looked through the log extensively, I really can't find anything.

Error:

apache2: Syntax error on line 236 of /etc/apache2/apache2.conf: syntax error on line 1 of /etc/apache2/sites-enabled/000-default: /etc/apache2/sites-enabled/000-default:1: was not closed.

Line 236 of apache2.conf:

# Include the virtual host configurations:                                      
Include /etc/apache2/sites-enabled/   

Contents of 000-default:

<VirtualHost *:80>
        ServerAdmin webmaster@localhost

        DocumentRoot /var/www
        <Directory />
                Options FollowSymLinks
                AllowOverride None
        </Directory>
        <Directory /var/www/>
                Options Indexes FollowSymLinks MultiViews
                AllowOverride None
                Order allow,deny
                allow from all
        </Directory>

        ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
        <Directory "/usr/lib/cgi-bin">
                AllowOverride None
                Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
                Order allow,deny
                Allow from all
        </Directory>

        ErrorLog /var/log/apache2/error.log

        # Possible values include: debug, info, notice, warn, error, crit,
        # alert, emerg.
        LogLevel warn

        CustomLog /var/log/apache2/access.log combined

    Alias /doc/ "/usr/share/doc/"
    <Directory "/usr/share/doc/">
        Options Indexes MultiViews FollowSymLinks
        AllowOverride None
        Order deny,allow
        Deny from all
        Allow from 127.0.0.0/255.0.0.0 ::1/128
    </Directory>

</VirtualHost>


<VirtualHost *:443>
        SetEnvIf Request_URI "^/u" dontlog
        ErrorLog /var/log/apache2/error.log
        Loglevel warn
        SSLEngine On
        SSLCertificateFile /etc/apache2/ssl/apache.pem

        ProxyRequests Off
        <Proxy *>
                AuthUserFile /srv/ajaxterm/.htpasswd
                AuthName EnterPassword
                AuthType Basic
                require valid-user

                Order Deny,allow
                Allow from all
        </Proxy>
        ProxyPass / http://localhost:8022/
        ProxyPassReverse / http://localhost:8022/
</VirtualHost>

UPDATE

I had a load of other issues with my install so I wound up just wiping it and reinstalling. If I run into the same problem, I'll repost.

Everyone, thanks for your help/suggestions.

link|improve this question
2  
Have you checked the lines proceeding the lines quoted in the error? – Chris S Jun 28 '10 at 19:22
Since the error is on line 1 something is probably broken on a some other file and not 000-default – Zoredache Jun 28 '10 at 19:26
Check the proceeding lines as Chris says, and also try disabling one site at a time until Apache starts loading again. – kaerast Jun 28 '10 at 19:30
To answer Chris S, yes, I've checked the preceeding lines, I've checked both files multiple times and can't find anything. Someone I know recommended that I try to remove the virtual host for port 80 and try again...Can you have more than one host in the file successfully? I'm going to try removing 80 when I get home tonight to see what happens. – Chris Jun 28 '10 at 20:24
Please add the content of apache2.conf – radius Jun 28 '10 at 22:32
feedback

3 Answers

I had the same problem in my virtualHosts config and solved it by converting Windows format file to Unix format file.

All characters "\r" (CR carriage return) need to be converted in "\n" unix (LF line feed)

link|improve this answer
feedback

you can try an grep "<Virtualhost>" -r /etc/apache2 to check all Open Virtual Hosts Tags

link|improve this answer
feedback

I hate to answer so far in the future but on line 5 your XML is malformed namely <Directory /> should be <Directory "/">

I have also had issues with line ending characters between unix and windows and my apache config files.

link|improve this answer
Apache configuration files are not XML. They look similar in some ways, but they don't follow the same rules. – Jeff Snider May 9 '11 at 19:47
feedback

Your Answer

 
or
required, but never shown