Apache2 fails on reboot..

Discussion in 'Installation/Configuration' started by husskii, Jan 17, 2010.

  1. husskii

    husskii New Member

    Hi when ever I follow the howto
    The Perfect Server - Debian Lenny (Debian 5.0) [ISPConfig 3]
    I get the following apache error, every time reboot and then I have to reinstall from scratch again.

    Code:
    apache2: Syntax error on line 281 of /etc/apache2/apache2.conf: Syntax error on line 66 of /etc/apache2/sites-enabled/monsterhost.co.cc.vhost: Expected </VirtualHost> but saw </Directory>
    Please if you know how to fix it, I could really use the help. Ive tried researching but none of the post I found really help, and the ones I do follow don't seem to work.
     
  2. oilyflutesalad

    oilyflutesalad ISPConfig Developer ISPConfig Developer

    How about posting line 275-285 of /etc/apache2/apache2.conf and line 60-70 of /etc/apache2/sites-enabled/monsterhost.co.cc.vhost ?

    Until we know exactly what is on the "error lines", we don't have a clue what the problem is. My guess is that you've modified both these files and removed a </VirtualHost> tag somewhere. Have you checked that?
     
  3. husskii

    husskii New Member

    hi oilyflutesalad

    thanks for getting back to me, I dnt think Ive done anything to change or remove any tags, Ive just followed the tutorial word for word and every time I reboot apache2 fails to start, Ive reinstalled over 10x now and was hoping to find a solution so I don't have to reinstall all the time..


    the lines 275-285 in /etc/apache2/apache2.conf are
    Code:
    # Include of directories ignores editors' and dpkg's backup files,
    # see README.Debian for details.
    
    # Include generic snippets of statements
    Include /etc/apache2/conf.d/
    
    # Include the virtual host configurations:
    Include /etc/apache2/sites-enabled/
    for
    Code:
    /etc/apache2/apache2.conf
    it only goes as far as 282.

    and lines 60-70 of /etc/apache2/sites-enabled/monsterhost.co.cc.vhost
    is
    Code:
        php_admin_value upload_tmp_dir /var/www/clients/client0/web9/tmp
        php_admin_value session.save_path /var/www/clients/client0/web9/tmp
        php_admin_value open_basedir /var/www/clients/client0/web9/web:/var/www/clients/client0/$
    
    [<Directory /var/www/monsterhost.co.cc/web>
      AllowOverride All
    </Directory>
    </VirtualHost>
    
    
    
    also this only goes as far as 67 and the rest of the lines to 71 are blank.

    If u like I can post the whole thing if it helps, but ye I have no idea on where to go from here...

    thanks:confused:
     
    Last edited: Jan 17, 2010
  4. husskii

    husskii New Member

    I found an earlier post from november last yr and a user had deleted one of his websites from ispconfig3 and the same problem happened to him after he did that.
    Im thinking I might of delete a site when trying ti get elgg installed and this might be the reason for my error too, as I tend to delete sites when I make an error instead of editing them.

    I tried
    Code:
    /var/log/apache2/error.log
    to view the file and recieved a permission denied error, so i tried
    Code:
    nano /var/log/apache2/error.log
    and it was blank, does anyone know how I can locate my error file please...
    as it might give a better understanding to the problem. I also have webmin installed if it makes it easier..

    Thanks

    ok I tried viewing through webmin and this is what I got for
    Code:
    /var/log/apache2/error.log
    Code:
    Fri Jan 15 13:04:04 2010] [error] [client 72.20.40.51] File does not exist: /var/www/proxycheck.txt
    [Fri Jan 15 13:04:05 2010] [error] [client 72.20.40.51] client denied by server configuration: /htdocs
    [Fri Jan 15 16:15:53 2010] [error] [client 85.190.0.3] client denied by server configuration: /htdocs
    [Fri Jan 15 19:31:56 2010] [error] [client 72.20.40.51] File does not exist: /var/www/proxycheck.txt
    [Fri Jan 15 19:31:56 2010] [error] [client 72.20.40.51] File does not exist: /usr/local/ispconfig/interface/web/proxycheck.txt
    [Fri Jan 15 19:31:56 2010] [error] [client 72.20.40.51] client denied by server configuration: /htdocs
    [Fri Jan 15 19:31:56 2010] [error] [client 72.20.40.51] client denied by server configuration: /htdocs
    [Fri Jan 15 19:32:00 2010] [error] [client 72.20.40.51] File does not exist: /var/www/proxycheck.txt
    [Fri Jan 15 19:32:00 2010] [error] [client 72.20.40.51] File does not exist: /usr/local/ispconfig/interface/web/proxycheck.txt
    [Sun Jan 17 14:46:32 2010] [error] [client 10.1.1.1] File does not exist: /var/www/favicon.ico
    [Sun Jan 17 14:46:35 2010] [error] [client 10.1.1.1] File does not exist: /var/www/favicon.ico
    [Sun Jan 17 14:46:35 2010] [error] [client 10.1.1.1] File does not exist: /var/www/favicon.ico
    [Sun Jan 17 23:03:51 2010] [error] [client 72.20.40.51] client denied by server configuration: /htdocs
    [Sun Jan 17 23:03:51 2010] [error] [client 72.20.40.51] File does not exist: /usr/local/ispconfig/interface/web/proxycheck.txt
    [Sun Jan 17 23:03:52 2010] [error] [client 72.20.40.51] File does not exist: /var/www/proxycheck.txt
    [Mon Jan 18 02:02:39 2010] [error] [client 121.55.236.139] client denied by server configuration: /htdocs
    [Mon Jan 18 04:37:25 2010] [error] [client 10.1.1.1] File does not exist: /var/www/favicon.ico
    [Mon Jan 18 04:37:25 2010] [error] [client 10.1.1.1] File does not exist: /var/www/favicon.ico
    [Mon Jan 18 04:37:59 2010] [error] [client 67.218.116.134] File does not exist: /var/www/robots.txt
    [Mon Jan 18 04:57:10 2010] [notice] caught SIGTERM, shutting down
    and for
    Code:
    /var/log/syslog
    Code:
    Jan 18 06:45:01 server1 postfix/smtpd[18677]: disconnect from localhost.localdomain[127.0.0.1]
    Jan 18 06:46:01 server1 /USR/SBIN/CRON[18695]: (root) CMD (/usr/local/ispconfig/server/server.sh > /dev/null 2>> /var/log/ispconfig/cron.log)
    Jan 18 06:47:01 server1 /USR/SBIN/CRON[18702]: (root) CMD (/usr/local/ispconfig/server/server.sh > /dev/null 2>> /var/log/ispconfig/cron.log)
    Jan 18 06:48:01 server1 /USR/SBIN/CRON[18726]: (root) CMD (/usr/local/ispconfig/server/server.sh > /dev/null 2>> /var/log/ispconfig/cron.log)
    Jan 18 06:49:01 server1 /USR/SBIN/CRON[18733]: (root) CMD (/usr/local/ispconfig/server/server.sh > /dev/null 2>> /var/log/ispconfig/cron.log)
    Jan 18 06:50:01 server1 /USR/SBIN/CRON[18740]: (getmail) CMD (/usr/local/bin/run-getmail.sh > /dev/null 2>> /var/log/ispconfig/cron.log)
    Jan 18 06:50:01 server1 /USR/SBIN/CRON[18743]: (root) CMD (/usr/local/ispconfig/server/server.sh > /dev/null 2>> /var/log/ispconfig/cron.log)
    Jan 18 06:50:02 server1 pure-ftpd: ([email protected]) [INFO] New connection from localhost.localdomain
    Jan 18 06:50:02 server1 pure-ftpd: ([email protected]) [INFO] Logout.
    Jan 18 06:50:02 server1 pop3d: Connection, ip=[::ffff:127.0.0.1]
    Jan 18 06:50:02 server1 pop3d: Disconnected, ip=[::ffff:127.0.0.1]
    Jan 18 06:50:02 server1 imapd: Connection, ip=[::ffff:127.0.0.1]
    Jan 18 06:50:02 server1 imapd: Disconnected, ip=[::ffff:127.0.0.1], time=0
    Jan 18 06:50:02 server1 postfix/smtpd[18758]: connect from localhost.localdomain[127.0.0.1]
    Jan 18 06:50:02 server1 postfix/smtpd[18758]: lost connection after CONNECT from localhost.localdomain[127.0.0.1]
    Jan 18 06:50:02 server1 postfix/smtpd[18758]: disconnect from localhost.localdomain[127.0.0.1]
    Jan 18 06:51:01 server1 /USR/SBIN/CRON[18800]: (root) CMD (/usr/local/ispconfig/server/server.sh > /dev/null 2>> /var/log/ispconfig/cron.log)
    Jan 18 06:52:01 server1 /USR/SBIN/CRON[18830]: (root) CMD (/usr/local/ispconfig/server/server.sh > /dev/null 2>> /var/log/ispconfig/cron.log)
    Jan 18 06:53:01 server1 /USR/SBIN/CRON[18842]: (root) CMD (/usr/local/ispconfig/server/server.sh > /dev/null 2>> /var/log/ispconfig/cron.log)
    Jan 18 06:54:01 server1 /USR/SBIN/CRON[18849]: (root) CMD (/usr/local/ispconfig/server/server.sh > /dev/null 2>> /var/log/ispconfig/cron.log)
     
    Last edited: Jan 17, 2010
  5. husskii

    husskii New Member

    I know a whole bunch of files dnt exist but what I dnt know is how that came to be, because then I could try prevent it wen I reinstall next time round.
     
  6. oilyflutesalad

    oilyflutesalad ISPConfig Developer ISPConfig Developer

    First, change line 62 (the open_basedir one) to this:
    Code:
        php_admin_value open_basedir /var/www/clients/client0/web9/web:/var/www/clients/client0/web9/tmp:/usr/share/php5:/tmp:/usr/share/phpmyadmin
    Then remove the [ from the start of line 64. Save the file, restart apache, and see if it works.


    Webmin could be interfering with your setup. If you have (or decide) to reinstall the server again, try it without webmin and see how it goes. There's no guarantees it will work, but if you're following the Perfect Server guide then you shouldn't have any problems if that's all you're doing. Webmin has some features similar to those in ISPConfig, so it's very much like installing two anti-virus programs on a Windows PC.
     
    Last edited: Jan 18, 2010
  7. husskii

    husskii New Member

    hi oilyflutesalad
    I just saw your reply but it w after I had completed a reinstall and unfortunatly I had install webmin aswell, but I went into
    Code:
    /etc/apache2/sites-enabled/monsterhost.co.cc.vhost
    after creating a site in ispconfig3 and I noticed I had the exact same line as you gave me, only instead of web9 its web1.

    I think it had to do with me deleting the website via ispconfig, I must of tried elgg 9times lol..

    my current file looks like this.
    Code:
     # mod_php enabled
        AddType application/x-httpd-php .php .php3 .php4 .php5
        php_admin_value sendmail_path "/usr/sbin/sendmail -t -i [email protected]"
        php_admin_value upload_tmp_dir /var/www/clients/client0/web1/tmp
        php_admin_value session.save_path /var/www/clients/client0/web1/tmp
        php_admin_value open_basedir /var/www/clients/client0/web1/web:/var/www/clients/client0/web1/tmp:/usr/share/php5
    but I saw another post that had done the same thing (deleting a website and apache2 wouldn't restart, and falko gave the guy a few commands which fixes the problem.. So I thought I would try them, but with no success..
    they commands were,
    Code:
    mkdir -p /var/log/ispconfig/httpd/gatesoft.gotdns.com/
    touch /var/log/ispconfig/httpd/gatesoft.gotdns.com/error.log
    chown -R www-data:www-data /var/log/ispconfig/httpd/gatesoft.gotdns.com/
    /etc/init.d/apache2 restart

    but it looks like this is the answer, and Ill copy the details so that when I delete a website next time, ill know what to use...

    Thanks heaps for your help, very much appreciated :)
     
  8. husskii

    husskii New Member

    nope apache2 still failed on reboot

    :confused: nope that wasn't the problem because I just rebooted the server to test and again apache2 failed to start even tho I didn't delete any websites from ispconfig... :'(

    maybe its because of webmin, I guess ill now try without webmin and see if it helps, because sometimes I will need to reboot as its unavoidable...
    does anyone have any suggestions on a replacement for webmin, because I use it to mange the server...

    ok last try, this time without webmin, if apache2 dies again, I guess ispconfig isnt for me :(
     
    Last edited: Jan 18, 2010
  9. oilyflutesalad

    oilyflutesalad ISPConfig Developer ISPConfig Developer

    If it is indeed webmin that's causing the problems, you will need to find a server manager that does not include any features that change the way Apache works, as this could end up with the same results you're getting now. Which features of webmin do you use most?
     
  10. husskii

    husskii New Member

    mainly I use it for hdd quotas, manage user accounts, software packages, just mainly server maintenance & now Im using it to view logs. I've only started using webmin recently, before I used to always install a gui but as I got more comfortable with ssh (command line) I moved away from gui because of all its vulnerabilities and started to use webmin for things I wasn't good at when using the commend line..
    But yea it just give the server a much more user friendly feel and helps manage user accounts.
    I just hope there is a substitute for it, at least till I get past the novice stages of linux lol...
     
  11. husskii

    husskii New Member

    ok not realising but this time the error was a liitle difrent, like instead of lines 60 to 70 it was line 45, I should of had a closer look before I reinstalled lol...

    the error this time was
    Code:
    Restarting web server: apache2apache2: Syntax error on line 281 of /etc/apache2/apache2.conf: Syntax error on line 45 of /etc/apache2/sites-enabled/monsterhost.co.cc.vhost: Expected </VirtualHost> but saw </Directory>
     failed!
    as soon as I saw the error without looking I quickly opened
    Code:
    /etc/apache2/sites-enabled/monsterhost.co.cc.vhost
    and saw they were the same as it was when I first reinstalled.. so I imagined something else was the source.. but ye this time it was lines 45 on
    Code:
    /etc/apache2/sites-enabled/monsterhost.co.cc.vhost
    & only line 281 again on
    Code:
    /etc/apache2/apache2.conf:
    damn I guess thats what you get for not paying more attention...

    well hopefully not installing webmin does the trick.
     
  12. oilyflutesalad

    oilyflutesalad ISPConfig Developer ISPConfig Developer

    If it's just a web server then you should be able to get away with using just ISPConfig... Any required users are automatically created and you can manage quotas for each reseller/client. When it comes to install software there're just a few basic commands you need, like aptitude install [packageName] to install from a repo, wget to download a file, and something ...file. Not to mention make and make install =p
     
  13. oilyflutesalad

    oilyflutesalad ISPConfig Developer ISPConfig Developer

    Line 281 in apache2.conf will be where the vconf files for each virtual host are included into the main conf file, so if you have an error in one of the virtual host config files, you'll get the error in the apache config file too.
     
  14. husskii

    husskii New Member

    thats true about the webser and not needing webmin, I guess I just liked the feel of it I guess, its more suited for my LAMP server lol...

    Im in the middle of a new install now, so once done Ill reboot and see what happens, do you think if I used ubuntu instead I would still get the same error, because to be frank I dnt understand why this error is.. anyways ill see how it goes without webmin and hopefully that's the answer...
    as for everything else Im following it word for word command for command...
     
  15. oilyflutesalad

    oilyflutesalad ISPConfig Developer ISPConfig Developer

    It shouldn't matter what distro you use, as long as it's one of the main supported ones. If webmin is the problem then you'd probably get the same problem on every distro you tried. Good luck with the install xD
     
  16. husskii

    husskii New Member

    thanks I think I need it :)
    ok all done, just about to test restarting apache2.. fingers crossed =)

    btw I think I just realized something I forgot to do in the last install..

    at step 14 ""Install Vlogger And Webalizer""
    when you need to edit
    Code:
    /etc/webalizer/webalizer.conf
    and uncomment change to yes
    Code:
    #Incremental no to Incremental yes
    I believe I forgot to uncomment Incremental. not sure if it makes a difference but I guess I didn't copy word for word lol..

    ok here goes reboot....
     
  17. husskii

    husskii New Member

    Apache Fails Agains

    ok finished install and restarted apache2 with the command
    Code:
    /etc/init.d/apache2 restart
    and yes once again it fails... ah frustrating...
    the error this time is

    Code:
    Restarting web server: apache2We failed to correctly shutdown apache, so we're now killing all running apache processes. This is almost certainly suboptimal, so please make sure your system is working as you'd expect now! (warning).
     ... waiting apache2: Syntax error on line 281 of /etc/apache2/apache2.conf: Syntax error on line 46 of /etc/apache2/sites-enabled/monsterhost.co.cc.vhost: Expected </VirtualHost> but saw </Directory>
     failed!

    ok line 281 of
    Code:
    /etc/apache2/apache2.conf
    is
    Code:
    Include /etc/apache2/sites-enabled/
    and line 46 of
    Code:
    /etc/apache2/sites-enabled/monsterhost.co.cc.vhost
    is
    Code:
    </Directory>

    and to show more lines before and after, they look like this
    274 to 282 of
    Code:
    /etc/apache2/apache2.conf
    Code:
    # Include of directories ignores editors' and dpkg's backup files,
    # see README.Debian for details.
    
    # Include generic snippets of statements
    Include /etc/apache2/conf.d/
    
    # Include the virtual host configurations:
    Include /etc/apache2/sites-enabled/
    
    
    and lines 40 to 47 of
    Code:
    /etc/apache2/sites-enabled/monsterhost.co.cc.vhost
    Code:
        php_admin_value upload_tmp_dir /var/www/clients/client0/web1/tmp
        php_admin_value session.save_path /var/www/clients/client0/web1/tmp
        php_admin_value open_basedir /var/www/clients/client0/web1/web:/var/www/clients/client0/web1/tmp:/usr/share/php5
    
    [<Directory /var/www/monsterhost.co.cc/web>
      AllowOverride All
    </Directory>
    </VirtualHost>
    I dnt see it, but then again I don't know what Im supposed to be looking for.
    all I did was complete the setup and then create a website and email account through ispconfig3.:(

    Just a thought, but if your not busy, maybe I can give you access and you could maybe have a quick look for me, before I throw the towel in.. I dnt mind if its cool with you :)

    thanks..
     
    Last edited: Jan 18, 2010
  18. oilyflutesalad

    oilyflutesalad ISPConfig Developer ISPConfig Developer

    Remove the [ from before <Directory /var/[...]> and it should work. If it's a clean install though, and you've done everything word for word, then I can't see what's causing the [ to be added =/
     
  19. husskii

    husskii New Member

    Houston, We Have Lift-Off

    You a champion XD it did the trick... w00t lol

    I defiantly followed it word for word, very strange strange why or how that symbol got there...
    but hopefully its all sorted now.. and I'm definitely not risking webmin either, well at least not yet... maybe I'll test the setup on one of my virtual machines and add webmin to see if its compatible or not...

    again thanks heaps apache started without a glitch and I couldn't of done it without your help =)

    Ive been stuck on this install for a while now, the number of times Ive completed this setup, I think I know every letter in the tutorial now lol.
    who would of thought after all this it was maybe as simple as one symbol that shouldn't of been there....

    thanks....
     
  20. oilyflutesalad

    oilyflutesalad ISPConfig Developer ISPConfig Developer

    Haha, the amount of times I've had that problem when coding websites is unbelievable! I can be sat checking through code looking for some really complicated solution when in the end it's just one letter either missing or in the wrong place :rolleyes:

    You may also want to check the master config too, just in case the [ is in that as well.
    Code:
    /usr/local/ispconfig/server/conf/vhost.conf.master
    There's a lot more stuff in there than there is in the site config file, but you should know what to look for by now :D
     

Share This Page