LEMP (One-click App) with Phpmyadmin ERROR, only since 3 days

August 5, 2016 258 views
PHP LEMP Apache Ubuntu

I am autocreating droplets with the API to digitalocean but you can do it manually too. I just followed the tutorials and the error continues

  1. Create Droplet -> INSTALL LEMP on 14.04 One-click App in DO
  2. Create sudo user and login https://www.digitalocean.com/community/tutorials/initial-server-setup-with-ubuntu-14-04
  3. follow to install phpmyadmin https://www.digitalocean.com/community/tutorials/how-to-install-and-secure-phpmyadmin-with-nginx-on-an-ubuntu-14-04-server
sudo apt-get update
sudo apt-get install phpmyadmin
  1. ERROR follows DURING Install phpmyadmin

Restarting web server apache2 AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using Set the 'ServerName' directive globally to suppress this message
(98)Address already in use: AH00072: makesock: could not bind to address [::]:80
(98)Address already in use: AH00072: make
sock: could not bind to address
no listening sockets available, shutting down
AH00015: Unable to open logs
Action 'start' failed.
The Apache error log may have more information.

ALL DONE LIKE TUTORIAL. DID work this way last week, now not. Automated and working last week, so NO CODE errors.

Whats the issue?

1 comment
  • Hi there,

    To answer the question re: the error you're seeing, apache2 isn't able to start as nginx is already listening on :80:

    root@phpmyadmin-test:~# netstat -ntlp | grep :80
    tcp        0      0    *               LISTEN      1376/nginx
    tcp6       0      0 :::80                   :::*                    LISTEN      1376/nginx

    Since nginx is already listening, naturally apache2 isn't going to be able to listen on the same port. If you continue on through the article, there will be the following set of commands:

    sudo ln -s /usr/share/phpmyadmin /usr/share/nginx/html
    sudo php5enmod mcrypt
    sudo service php5-fpm restart

    The key here is to reload nginx/php5-fpm, and you should be able to see the phpmyadmin page from http://<YOURDROPLETIP>/phpmyadmin. You can also test this from inside your droplet using the following:

    curl -IL localhost/phpmyadmin

    Which should yield something like:

    root@phpmyadmin-test:~# curl -IL localhost/phpmyadmin
    HTTP/1.1 301 Moved Permanently
    Server: nginx/1.4.6 (Ubuntu)
    Date: Tue, 09 Aug 2016 16:55:14 GMT
    Content-Type: text/html
    Content-Length: 193
    Location: http://localhost/phpmyadmin/
    Connection: keep-alive
    HTTP/1.1 200 OK
    Server: nginx/1.4.6 (Ubuntu)
    Date: Tue, 09 Aug 2016 16:55:14 GMT
    Content-Type: text/html; charset=utf-8
    Connection: keep-alive
    X-Powered-By: PHP/5.5.9-1ubuntu4.19
    Set-Cookie: pma_lang=en; expires=Thu, 08-Sep-2016 16:55:14 GMT; Max-Age=2592000; path=/phpmyadmin/; httponly
    Set-Cookie: pma_collation_connection=utf8_general_ci; expires=Thu, 08-Sep-2016 16:55:14 GMT; Max-Age=2592000; path=/phpmyadmin/; httponly
    Set-Cookie: phpMyAdmin=4ghmqa2r4a8r8i6ivj9uo0inqdidj6ht; path=/phpmyadmin/; HttpOnly
    X-ob_mode: 0
    X-Frame-Options: DENY
    X-Content-Security-Policy: default-src 'self' ;options inline-script eval-script;img-src 'self' data:  *.tile.openstreetmap.org *.tile.opencyclemap.org;
    X-WebKit-CSP: default-src 'self' ;script-src 'self'  'unsafe-inline' 'unsafe-eval';style-src 'self' 'unsafe-inline';img-src 'self' data:  *.tile.openstreetmap.org *.tile.opencyclemap.org;
    Expires: Tue, 09 Aug 2016 12:55:14 -0400
    Cache-Control: no-store, no-cache, must-revalidate,  pre-check=0, post-check=0, max-age=0
    Pragma: no-cache
    Last-Modified: Tue, 09 Aug 2016 12:55:14 -0400

    Can you give that a shot and let me know what that yields for you?

1 Answer

How long did you wait at this point? I just replicated the issue. These warnings are expected since you already have nginx installed and the phpmyadmin Ubuntu package lists apache as a prerequsite.

I noticed that when I went through the process the output paused at this point for about 30 seconds. It is also important that you do not let the installation process auto-configure apache, when prompted you should tab down and choose next without selecting either option.

PHPMyAdmin is not super hard to install from scratch and if you plan to use it without Apache on Ubuntu this might be a good option. Since it's just a PHP application you should be able to create a new directory on your LEMP web root and download PHPMyAdmin from the official site.

Yet another option (and one I've used myself where I didn't need to do a lot of direct administation of my database) is Adminer. It is similar to PHPMyAdmin but is implemented in just one file so you can drop it anywhere in your web root and browse to it. Log in using your existing MySQL credentials and you can manage your databases.

Have another answer? Share your knowledge.