Welcome to Centmin Mod Community
Register Now

Install phpmyadmin 404 not found

Discussion in 'Add Ons' started by Peace-Keeper, Nov 7, 2015.

  1. Peace-Keeper

    Peace-Keeper Member

    46
    8
    8
    Jul 9, 2014
    Ratings:
    +11
    Local Time:
    11:32 PM
    Mainline
    10.1
  2. eva2000

    eva2000 Administrator Staff Member

    34,591
    7,653
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +11,770
    Local Time:
    1:32 PM
    Nginx 1.15.x
    MariaDB 5.5/10.x
    A few things to try
    • If you upgraded PHP after you installed phpmyadmin addon, try clearing browser cache and restarting nginx and php-fpm
    • Check nginx error and access log - FAQ item 19 and Config Files page for overview.
    • Ensure you have a valid DNS for the main hostname pointing to your server's IP address
    • Ensure main hostname is setup as per step 1 of Getting Started Guide where main hostname is not the same as a site's nginx vhost domain name. They have to be different as outlined in the difference and summary of Getting Started Guide.
      This allows the main hostname vhost to house all the PHP and nginx statistic pages and phpmyadmin urls.
    • So ensure the server_name listed in main hostname vhost at /usr/local/nginx/conf/conf.d/virtual.conf isn't referenced in other nginx domain vhost files.
     
  3. rc112

    rc112 Member

    124
    14
    18
    Sep 22, 2017
    Ratings:
    +15
    Local Time:
    11:32 AM
    Hi
    I encountered 404 error while loging into phpmyadmin. I tried the advices above but I have main hostname and subdomain are pointing to different IP address because they are hosted on different servers. I am a bit confused about the hostname thing. Please Kindly help. Thanks.
     
  4. eva2000

    eva2000 Administrator Staff Member

    34,591
    7,653
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +11,770
    Local Time:
    1:32 PM
    Nginx 1.15.x
    MariaDB 5.5/10.x
    Getting Started Guide step 1 outlines that you need to setup a proper main hostname for centmin mod server and with valid DNS A record to server IP Getting Started Guide - CentminMod.com LEMP Nginx web stack for CentOS. So solution is
    • for subdomain that Centmin Mod is serving, change the main hostname used for that server to a different hostname for just that server using Getting Started Guide step 1 method and updating server_name in main hostname nginx vhost at /usr/local/nginx/conf/conf.d/virtual.conf to the updated main hostname
    As per Getting Started Guide bottom summary
     
  5. rc112

    rc112 Member

    124
    14
    18
    Sep 22, 2017
    Ratings:
    +15
    Local Time:
    11:32 AM
    I followed the docs and ran hostnamectl status. Transient hostname is not changed?

    Code:
    [[email protected] ~]$   hostnamectl status
       Static hostname: do.wooshop.com.tw
    Transient hostname: do.wooshop.om.tw
             Icon name: computer-vm
               Chassis: vm
            Machine ID: 764ff400d2334621a060ec79b096e787
               Boot ID: f68028c7fdfe4dfab65e9e82d895afa7
        Virtualization: kvm
      Operating System: CentOS Linux 7 (Core)
           CPE OS Name: cpe:/o:centos:centos:7
                Kernel: Linux 3.10.0-693.11.6.el7.x86_64
          Architecture: x86-64
    [[email protected] ~]$ nmcli general hostname
    -bash: nmcli: command not found
    [[email protected] ~]$ nano nmcli general hostname
    [[email protected] ~]$ cat /etc/cloud/cloud.cfg
     
  6. rc112

    rc112 Member

    124
    14
    18
    Sep 22, 2017
    Ratings:
    +15
    Local Time:
    11:32 AM
    It worked after I tried this.
    Code:
    sudo hostnamectl --transient set-hostname do.wooshop.com.tw
    But I got new problem when installing phpmyadmin
    Code:
    Warning: detected possible duplicate server_name entry
    main hostname vhost server_name value has to be unique
    and separate from any other nginx vhost site you addded
    Check your server_name in /usr/local/nginx/conf/conf.d/virtual.conf
    read Step 1 of Getting Started Guide for main hostname
    proper setup https://centminmod.com/getstarted.html
    I installed wordpress (option 22) on subdomain and have main domain hosting on another server. How can I have the hostname configured properly? Please Kindly help. Thank you so much.
     
  7. eva2000

    eva2000 Administrator Staff Member

    34,591
    7,653
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +11,770
    Local Time:
    1:32 PM
    Nginx 1.15.x
    MariaDB 5.5/10.x
    did you update server_name listed in main hostname nginx vhost /usr/local/nginx/conf/conf.d/virtual.conf to the updated hostname as well ? main hostname needs to be different from your site's domain name.
     
  8. rc112

    rc112 Member

    124
    14
    18
    Sep 22, 2017
    Ratings:
    +15
    Local Time:
    11:32 AM
    yes it is different from WP installation on do.wooshop.com.tw
    Code:
    server {
                listen 80 default_server backlog=2048 reuseport;
                server_name wooshop.com.tw;
                root   html;
     
  9. eva2000

    eva2000 Administrator Staff Member

    34,591
    7,653
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +11,770
    Local Time:
    1:32 PM
    Nginx 1.15.x
    MariaDB 5.5/10.x
    What does your /usr/local/nginx/conf/conf.d/virtual.conf and /usr/local/nginx/conf/conf.d/yourdomain.com.conf contents look like ? Make sure virtual.conf main hostname's server_name isn't same as any added nginx vhost site's domain name as per Getting Started Guide step 1, the main hostname needs to be unique.

    You can check via recursive grep filter of your domain name in vhost directory at /usr/local/nginx/conf/conf.d
    Code (Text):
    grep -rnw 'yourdomain.com' /usr/local/nginx/conf/conf.d
    

    Code (Text):
    grep -rnw 'hostname.yourdomain.com' /usr/local/nginx/conf/conf.d
    

    Also check DNS is correct use dig to check DNS for domain
    Code (Text):
    dig +short A @8.8.8.8 yourdomain.com
    dig +short A @8.8.8.8 www.yourdomain.com
    dig +short A @8.8.8.8 hostname.yourdomain.com
    

    check HTTP headers via curl for both HTTP (and HTTPS if you have HTTPS/SSL)
    Code (Text):
    curl -I http://yourdomain.com
    curl -I http://www.yourdomain.com
    curl -I https://yourdomain.com
    curl -I https://www.yourdomain.com
    curl -I http://hostname.yourdomain.com
    
     
  10. rc112

    rc112 Member

    124
    14
    18
    Sep 22, 2017
    Ratings:
    +15
    Local Time:
    11:32 AM
    Thank you so muhc @eva2000 Here is the output.
    Code:
    [04:13][[email protected] conf.d]# cat  /usr/local/nginx/conf/conf.d/virtual.conf
    server {
                listen 80 default_server backlog=2048 reuseport;
                server_name wooshop.com.tw;
                root   html;
    Code:
    [04:16][[email protected] conf.d]# cat do.wooshop.com.tw.ssl.conf
    
    #x# HTTPS-DEFAULT
     server {
    
       server_name do.wooshop.com.tw www.do.wooshop.com.tw;
       return 302 https://do.wooshop.com.tw$request_uri;
       include /usr/local/nginx/conf/staticfiles.conf;
     }
    
    server {
      listen 443 ssl http2;
      server_name do.wooshop.com.tw www.do.wooshop.com.tw;
    
      include /usr/local/nginx/conf/ssl/do.wooshop.com.tw/do.wooshop.com.tw.crt.key.conf;
      include /usr/local/nginx/conf/ssl_include.conf;
    Code:
    [04:10][[email protected] conf.d]# dig +short A @8.8.8.8 wooshop.com.tw
    35.194.229.194
    [04:12][[email protected] conf.d]# dig +short A @8.8.8.8 www.wooshop.com.tw
    webredir.vip.gandi.net.
    213.167.231.2
    [04:12][[email protected] conf.d]# dig +short A @8.8.8.8 do.wooshop.com.tw
    159.89.200.227
    Code:
    [04:16][[email protected] conf.d]# grep -rnw 'wooshop.com.tw' /usr/local/nginx/conf/conf.d
    /usr/local/nginx/conf/conf.d/virtual.conf:3:            server_name wooshop.com.tw;
    /usr/local/nginx/conf/conf.d/do.wooshop.com.tw.ssl.conf:5:   server_name do.wooshop.com.tw www.do.wooshop.com.tw;
    /usr/local/nginx/conf/conf.d/do.wooshop.com.tw.ssl.conf:6:   return 302 https://do.wooshop.com.tw$request_uri;
    /usr/local/nginx/conf/conf.d/do.wooshop.com.tw.ssl.conf:12:  server_name do.wooshop.com.tw www.do.wooshop.com.tw;
    /usr/local/nginx/conf/conf.d/do.wooshop.com.tw.ssl.conf:14:  include /usr/local/nginx/conf/ssl/do.wooshop.com.tw/do.wooshop.com.tw.crt.key.conf;
    /usr/local/nginx/conf/conf.d/do.wooshop.com.tw.ssl.conf:18:  #ssl_client_certificate /usr/local/nginx/conf/ssl/cloudflare/do.wooshop.com.tw/origin.crt;
    /usr/local/nginx/conf/conf.d/do.wooshop.com.tw.ssl.conf:54:  access_log /home/nginx/domains/do.wooshop.com.tw/log/access.log combined buffer=256k flush=5m;
    /usr/local/nginx/conf/conf.d/do.wooshop.com.tw.ssl.conf:55:  error_log /home/nginx/domains/do.wooshop.com.tw/log/error.log;
    /usr/local/nginx/conf/conf.d/do.wooshop.com.tw.ssl.conf:57:  include /usr/local/nginx/conf/autoprotect/do.wooshop.com.tw/autoprotect-do.wooshop.com.tw.conf;
    /usr/local/nginx/conf/conf.d/do.wooshop.com.tw.ssl.conf:58:  root /home/nginx/domains/do.wooshop.com.tw/public;
    /usr/local/nginx/conf/conf.d/do.wooshop.com.tw.ssl.conf:64:  include /usr/local/nginx/conf/wpincludes/do.wooshop.com.tw/wpcacheenabler_do.wooshop.com.tw.conf;
    /usr/local/nginx/conf/conf.d/do.wooshop.com.tw.ssl.conf:65:  #include /usr/local/nginx/conf/wpincludes/do.wooshop.com.tw/wpsupercache_do.wooshop.com.tw.conf;
    /usr/local/nginx/conf/conf.d/do.wooshop.com.tw.ssl.conf:67:  #include /usr/local/nginx/conf/wpincludes/do.wooshop.com.tw/rediscache_do.wooshop.com.tw.conf;
    /usr/local/nginx/conf/conf.d/do.wooshop.com.tw.ssl.conf:95:    auth_basic_user_file /home/nginx/domains/do.wooshop.com.tw/htpasswd_wplogin;
    /usr/local/nginx/conf/conf.d/do.wooshop.com.tw.ssl.conf:129:  include /usr/local/nginx/conf/wpincludes/do.wooshop.com.tw/wpsecure_do.wooshop.com.tw.conf;
    /usr/local/nginx/conf/conf.d/do.wooshop.com.tw.ssl.conf:134:  include /usr/local/nginx/conf/pre-staticfiles-local-do.wooshop.com.tw.conf;
     
  11. eva2000

    eva2000 Administrator Staff Member

    34,591
    7,653
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +11,770
    Local Time:
    1:32 PM
    Nginx 1.15.x
    MariaDB 5.5/10.x
    what's output for this single command line
    Code (Text):
    SSLHNAME=$(uname -n); echo $SSLHNAME; grep -rw server_name /usr/local/nginx/conf/conf.d/ | grep -w "$SSLHNAME"; grep -rw server_name /usr/local/nginx/conf/conf.d/ | grep -w "$SSLHNAME" | wc -l
    
     
  12. rc112

    rc112 Member

    124
    14
    18
    Sep 22, 2017
    Ratings:
    +15
    Local Time:
    11:32 AM
    Code:
    [04:19][[email protected] conf.d]# SSLHNAME=$(uname -n); echo $SSLHNAME; grep -rw server_name /usr/local/nginx/conf/conf.d/ | grep -w "$SSLHNAME"; grep -rw server_name /usr/local/nginx/conf/conf.d/ | grep -w "$SSLHNAME" | wc -l
    do.wooshop.com.tw
    /usr/local/nginx/conf/conf.d/do.wooshop.com.tw.ssl.conf:   server_name do.wooshop.com.tw www.do.wooshop.com.tw;
    /usr/local/nginx/conf/conf.d/do.wooshop.com.tw.ssl.conf:  server_name do.wooshop.com.tw www.do.wooshop.com.tw;
    2
    THANK YOU
     
  13. eva2000

    eva2000 Administrator Staff Member

    34,591
    7,653
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +11,770
    Local Time:
    1:32 PM
    Nginx 1.15.x
    MariaDB 5.5/10.x
    oh i see the problem now, you should set main hostname in virtual.conf vhost as somehostname.domain.com not just the domain name.. i.e. host1.wooshop.com.tw and update that as per getting started guide step 1 for DNS etc

    phpmyadmin.sh installer checks virtual.conf server_name entry against know server_name in /usr/local/nginx/conf/conf.d for duplicates so just using wooshop.com.tw matched against all subdomain entries too. If you had used something like host1.wooshop.com.tw it wouldn't of matched any of your entries in /usr/local/nginx/conf/conf.d
     
  14. rc112

    rc112 Member

    124
    14
    18
    Sep 22, 2017
    Ratings:
    +15
    Local Time:
    11:32 AM
    So it should be like this
    Code:
    [04:32][[email protected] conf.d]# cat /usr/local/nginx/conf/conf.d/virtual.conf
    server {
                listen 80 default_server backlog=2048 reuseport;
                server_name do.wooshop.com.tw;
                root   html;
    
            access_log              /var/log/nginx/localhost.access.log     combined buffer=8k flush=1m;
            error_log               /var/log/nginx/localhost.error.log      error;
     
  15. rc112

    rc112 Member

    124
    14
    18
    Sep 22, 2017
    Ratings:
    +15
    Local Time:
    11:32 AM
    I still got the same error.
    Code:
    [04:33][[email protected] conf.d]# cd /usr/local/src/centminmod/addons
    [04:35][[email protected] addons]#   ./phpmyadmin.sh install
    expr: syntax error
    ---------------------------------------------------------------
    Warning: detected possible duplicate server_name entry
    main hostname vhost server_name value has to be unique
    and separate from any other nginx vhost site you addded
    Check your server_name in /usr/local/nginx/conf/conf.d/virtual.conf
    read Step 1 of Getting Started Guide for main hostname
    proper setup https://centminmod.com/getstarted.html
     
  16. rc112

    rc112 Member

    124
    14
    18
    Sep 22, 2017
    Ratings:
    +15
    Local Time:
    11:32 AM
    What does this mean? Sorry.
     
  17. eva2000

    eva2000 Administrator Staff Member

    34,591
    7,653
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +11,770
    Local Time:
    1:32 PM
    Nginx 1.15.x
    MariaDB 5.5/10.x
    no server_name listed in virtual.conf is your server's main hostname i.e. host1.wooshop.com.tw and has to be different from your site domain name do.wooshop.com.tw
    then create a DNS A record for host1.wooshop.com.tw pointing to server IP address so server main hostname will be host1.wooshop.com.tw and your site domain name would be do.wooshop.com.tw

    from Getting Started Guide - CentminMod.com LEMP Nginx web stack for CentOS

     
  18. eva2000

    eva2000 Administrator Staff Member

    34,591
    7,653
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +11,770
    Local Time:
    1:32 PM
    Nginx 1.15.x
    MariaDB 5.5/10.x
    Also read config files overview page it outlines relationship between virtual.conf main hostname's vhost and your normal site's vhost Centmin Mod Configuration Files - CentminMod.com LEMP Nginx web stack for CentOS
     
  19. rc112

    rc112 Member

    124
    14
    18
    Sep 22, 2017
    Ratings:
    +15
    Local Time:
    11:32 AM
    I am sorry but a little confused. I think my hostname is do.
    yes I create A record to point to the server. The web page (do.wooshop.com.tw – Just another WordPress site )works well.
     
  20. eva2000

    eva2000 Administrator Staff Member

    34,591
    7,653
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +11,770
    Local Time:
    1:32 PM
    Nginx 1.15.x
    MariaDB 5.5/10.x
    what is your woocommerce site's domain name ? that domain name can't be the same domain name listed in virtual.conf server_name as that has to have it's own main hostname.

    So if my site is centminmod.com, i have to set main hostname in virtual.conf to a separate hostname from centminmod.com i.e. mainhost.centminmod.com

    so if do.wooshop.com.tw is your woocommerce site domain name, set main hostname in virtual.conf as host1.wooshop.com.tw
     
..