Port already in use error

Discussion in 'Server Operation' started by cvgeeks, Jun 28, 2011.

  1. cvgeeks

    cvgeeks New Member


    I did some updates the other day after installing mod-security and restarted my server after which I could no longer connect to ISPConfig3
    control panel nor any of my sites.

    I did lots of searches and reading however to no avail. I had given up and figured the server was down for good so I started
    building 5 more replacement boxes thinking I needed to migrate all my data etc. I just happend to be going through the apache.conf
    file in /etc/apache2/ when I came across a double statement in the file see below.

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

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

    What eneded up happening is this causes the sites-enabled directory to be loaded twice which then canceld each other out because the port was
    already in use even though it was not in use it never loaded at all. When I would do a netstat -all no port or service was running on
    8080. Normally when another service is running on a port you can kill the service and restart apache2 but not in this case as apache2
    was not running anything on 8080. Infact because of this error apache2 would not start at all.

    Baffling I know but I found it and fixed it and I'm back up and running. Great thing though I learned how to backup all my RoundCube
    accounts so they can be migrated over without loosing any emails and I don't need to perform any imap to imap migrations which I'm
    very greatful for. Just create a new db for the user in ispconfig3 and import my .sql and I'm back online. :)

    I have to say as dreadful as this experience was I learned allot about apache2, ispconfig3, php, mod-security and a few others along the way.
    So in the end a major disastor turned out to be a huge learning experience and I hope this helps anyone getting the error "PORT ALREADY IN USE".

    Sometimes the error is the port is already in use but it could mean it loaded the port then killed the port because it tried to reload the port again!
    Everything I was reading was about the port already being used and not being cancled out ;)

Share This Page