I restarted my server, apache falls into a heap

Discussion in 'Server Operation' started by shiidii, Feb 4, 2007.

  1. shiidii

    shiidii New Member

    My Ubuntu server has been running without a hitch since its installation. Recently it required a restart and once rebooted, things went awry.
    First of all, I followed the perfect setup and installed ISPConfig. After the reboot, the websites on the server all pointed to /var/www/, instead of /home/web#/. I stopped Apache and restarted Apache2, and this seems to be resolved. What still doesn't work are the ports.

    Nothing looks wrong in the Apache2 logs, but when I restart apache2 I get this:
    Code:
     * Forcing reload of apache 2.0 web server...
    apache2: Could not determine the server's fully qualified domain name, using 127.0.0.1 for ServerName
    apache2: Could not determine the server's fully qualified domain name, using 127.0.0.1 for ServerName
    

    When restarting Proftpd, I get this
    Code:
    Restarting ProFTPD ftp daemon.proftpd
    .. - getaddrinfo 'DOMAIN.com_server.DOMAIN.com' error: Name or service not known
     - warning: unable to determine IP address of 'DOMAIN.com_server.DOMAIN.com'
     - getaddrinfo 'DOMAIN.com_server.DOMAIN.com' error: Name or service not known
     - warning: unable to determine IP address of 'DOMAIN.com_server.DOMAIN.com'
    proftpd
     done
    Usually the Apache2 error means I don't have a proper IP address in my hosts file, but I do, and I have all this time. It's just.. not work for no reason :(
     
  2. shiidii

    shiidii New Member

    I added this to apache2.conf:

    Which removed the FQDN error, but the ports are not still working. :81 will take me to /var/www/ instead of ISPconfig like it used to.
     
  3. martinfst

    martinfst ISPConfig Developer ISPConfig Developer

    Did you a clean 'shutdown -r' for restarting the server? It looks like at least a couple of configuration files are in error.

    1st: lets check if everything is listening to the correct ports: what's the output of
    Code:
    netstat -tap
    ?
     
  4. shiidii

    shiidii New Member

    Nope, it was restarted by accident, power outage.
    I've done a clean restart, but problems persist. This is the output of netstat -tap

    Code:
    Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
    tcp        0      0 localhost.localdo:60000 *:*                     LISTEN     4535/postgrey.pid -
    tcp        0      0 localhost.localdo:44736 *:*                     LISTEN     4437/hpiod
    tcp        0      0 *:ldap                  *:*                     LISTEN     4543/slapd
    tcp        0      0 localhost.localdo:10025 *:*                     LISTEN     5138/master
    tcp        0      0 localhost.localdo:mysql *:*                     LISTEN     4994/mysqld
    tcp        0      0 *:10031                 *:*                     LISTEN     5147/postfix-policy
    tcp        0      0 server.domain:imap2 *:*                     LISTEN     4703/couriertcpd
    tcp        0      0 *:sunrpc                *:*                     LISTEN     3617/portmap
    tcp        0      0 localhost.localdo:10000 *:*                     LISTEN     4550/whitelister
    tcp        0      0 *:x11                   *:*                     LISTEN     4364/X
    tcp        0      0 localhost.localdo:41332 *:*                     LISTEN     4440/python
    tcp        0      0 server.domain:domain *:*                     LISTEN     7129/named
    tcp        0      0 localhost.locald:domain *:*                     LISTEN     7129/named
    tcp        0      0 localhost.localdoma:ipp *:*                     LISTEN     17522/cupsd
    tcp        0      0 *:823                   *:*                     LISTEN     4882/rpc.dracd
    tcp        0      0 localhost.localdoma:953 *:*                     LISTEN     7129/named
    tcp        0      0 *:smtp                  *:*                     LISTEN     5138/master
    tcp        0      0 server.domain:60088 ftp.heanet.ie:www       ESTABLISHED4661/freshclam
    tcp        0      0 localhost.localdo:44736 localhost.localdo:40517 ESTABLISHED4437/hpiod
    tcp        0      0 localhost.localdo:40517 localhost.localdo:44736 ESTABLISHED4440/python
    tcp6       0      0 *:imaps                 *:*                     LISTEN     4726/couriertcpd
    tcp6       0      0 *:pop3s                 *:*                     LISTEN     4766/couriertcpd
    tcp6       0      0 *:ldap                  *:*                     LISTEN     4543/slapd
    tcp6       0      0 *:pop3                  *:*                     LISTEN     4744/couriertcpd
    tcp6       0      0 *:www                   *:*                     LISTEN     22936/apache2
    tcp6       0      0 *:x11                   *:*                     LISTEN     4364/X
    tcp6       0      0 *:81                    *:*                     LISTEN     22936/apache2
    tcp6       0      0 *:ftp                   *:*                     LISTEN     22936/apache2
    tcp6       0      0 *:ssh                   *:*                     LISTEN     5244/sshd
    tcp6       0      0 ip6-localhost:953       *:*                     LISTEN     7129/named
    tcp6       0      0 *:smtp                  *:*                     LISTEN     5138/master
    tcp6       0      0 *:https                 *:*                     LISTEN     22936/apache2
    tcp6       0     84 server.domain:ssh CPE-58-167-28-92.:60579 ESTABLISHED2527/sshd: username2 
     
  5. martinfst

    martinfst ISPConfig Developer ISPConfig Developer

    Do you use ISPConfig?

    A power failure restart can have all kinds of nasty side effects (Linus does a lot of buffering in memory and a power crash prevents cache being written back to disk or to close file handles cleanly) and I think that happened. Do you have backups of everything in /etc of a date before the crash? I suggest comparing them by hand.

    Did the system do a 'fsck' automatically? You may find something useful then in the lost+found directories (per filesystem), but you need to review those files carefully. Most of the times anything in lost+found is either truncated or hosed in some way. And also you need to determine where the contents is coming from, as fsck just 'numbers' the filenames.
     
  6. shiidii

    shiidii New Member

    Yep, I do use ISPconfig, which runs on port 81.
    There are backup Confs in a lot of the directories, I will probably have to do some restoration in that respect.

    I'm not familiar with the workings of fsck.

    In the worst case scenario, I'm fine with formatting and reinstalling the server. Is there a way to mostly format, but to keep the ssh client and host?
     
  7. martinfst

    martinfst ISPConfig Developer ISPConfig Developer

    Reason for asking about ISPConfig is, that you then have the wrong webserver listening on port 81. You now have Apache2 listening and is should be a special ispconfig_httpd program. I would advise a re-installation from scratch.

    The ssh client is of course on your client PC and will not be touched. The installation of the ssh server is very easy. But for a re-install, you need to have access to the system and to the system console. If you have that, the quickest route to a full functional system will most likely be a re-install.
     
  8. shiidii

    shiidii New Member

    Thanks for your help!
    Well, I have absolutely no access to this server, everything is through SSH. I would be content with, for now, getting just the FTP port to work. I can handle ISP config not working.

    Like you said before, I'll compare the old Conf files and see what I can do. Otherwise, would it be possible to just reinstall Apache2 / Proftpd?
     
  9. martinfst

    martinfst ISPConfig Developer ISPConfig Developer

    You can completely remove a package and reinstall it again. It will give you clean config files.
    Code:
    apt-get --purge remove <package_name>
    Or similar from any package manager.
     

Share This Page