Want to subscribe to topics you're interested in?
Become a Member

Nginx How can I do to run phpmyadmin from the IP ?

Discussion in 'Install & Upgrades or Pre-Install Questions' started by virtualorbis, Sep 6, 2018.

  1. virtualorbis

    virtualorbis New Member

    10
    3
    3
    Jul 11, 2018
    Ratings:
    +3
    Local Time:
    7:02 PM
    Hello,
    I recently uploaded and decompressed phpmyadmin in the folder of one of my servers
    but when I load the URL http://IP/phpmyadmin
    I get a 404 error message.

    PS:
    I recently changed the /usr/local/nginx/conf/conf.d/virtual.conf
    to make wordpress run in this server as you can see in the attached picture.

    CentOS Version: i.e. CentOS 7 64bit
    Centmin Mod Version Installed: 123.09beta01
    Nginx Version Installed: i.e. 1.15.2
    PHP Version Installed: 7.2.8
    MariaDB MySQL Version Installed: 10.1.35-MariaDB
     

    Attached Files:

    Last edited: Sep 6, 2018
  2. eva2000

    eva2000 Administrator Staff Member

    36,834
    8,062
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +12,417
    Local Time:
    10:02 AM
    Nginx 1.15.x
    MariaDB 5.5/10.x
    generally you shouldn't use /usr/local/nginx/conf/conf.d/virtual.conf as main hostname is reserved for all centmin mod /statistics configurations i.e. PHP Opcode and Memcached statistics pages so there maybe conflicts if you setup your site on main hostname

    also all centmin mod automated optimisations and auto configuration of nginx HTTPS/SSL certificates and future nginx vhost related fixes/updates at nginx vhost level maybe bypassed when using main hostname's nginx vhost instead of creating one at centmin.sh menu option 2/22 or nv command line as per Nginx Vhost & NSD DNS Setup - CentminMod.com LEMP Nginx web stack for CentOS

    main hostname has it's own web root separate from all other vhosts in /usr/local/nginx/html so that is where you upload files for main hostname as per config info outlined at Centmin Mod Configuration Files - CentminMod.com LEMP Nginx web stack for CentOS

    what does contents of your /usr/local/nginx/conf/conf.d/virtual.conf main hostname nginx vhost contain with your changes ?

    output for this command
    Code (Text):
    cat /usr/local/nginx/conf/conf.d/virtual.conf
    

    for posting code or output from commands to keep the formatting, you might want to use CODE tags for code How to use forum BBCODE code tags :)
     
  3. virtualorbis

    virtualorbis New Member

    10
    3
    3
    Jul 11, 2018
    Ratings:
    +3
    Local Time:
    7:02 PM
    [17:58][[email protected] ~]# cat /usr/local/nginx/conf/conf.d/virtual.conf
    server {
    listen 80 default_server backlog=2048 reuseport fastopen=256;
    server_name onpe;
    root html;

    access_log /var/log/nginx/localhost.access.log combined buffer=8k flush=1m;
    error_log /var/log/nginx/localhost.error.log error;

    # ngx_pagespeed & ngx_pagespeed handler
    #include /usr/local/nginx/conf/pagespeed.conf;
    #include /usr/local/nginx/conf/pagespeedhandler.conf;
    #include /usr/local/nginx/conf/pagespeedstatslog.conf;

    # limit_conn limit_per_ip 16;
    # ssi on;

    location /nginx_status {
    stub_status on;
    access_log off;
    allow 127.0.0.1;
    #allow youripaddress;
    deny all;
    }

    location / {

    # block common exploits, sql injections etc
    #include /usr/local/nginx/conf/block.conf;

    #Enables directory listings when index file not found
    #autoindex on;

    #Shows file listing times as local time
    #autoindex_localtime on;

    # Wordpress Permalinks example
    try_files \$uri \$uri/ /lms/index.php?q=\$uri&\$args;

    }

    include /usr/local/nginx/conf/staticfiles.conf;
    include /usr/local/nginx/conf/include_opcache.conf;
    include /usr/local/nginx/conf/php.conf;
    #include /usr/local/nginx/conf/phpstatus.conf;
    include /usr/local/nginx/conf/drop.conf;
    #include /usr/local/nginx/conf/errorpage.conf;
    #include /usr/local/nginx/conf/vts_mainserver.conf;

    }[17:58][[email protected] ~]#
     
  4. eva2000

    eva2000 Administrator Staff Member

    36,834
    8,062
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +12,417
    Local Time:
    10:02 AM
    Nginx 1.15.x
    MariaDB 5.5/10.x
    FYI, for posting vhost/ssh command output you should wrap in CODE tags outlined at How to use forum BBCODE code tags it helps keeps original format and prevents parsing of domain names as links.

    You must of taken the try_files from the centmin mod code template, which needs escaping with backslash for variables beginning with $ so \$. But centmin mod template once added to actual nginx vhost removes the backslash so the code in nginx vhost config file should be in fact
    Code (Text):
    try_files $uri $uri/ /lms/index.php?q=$uri&$args;
    

    though this part /lms is only required if your wordpress install is installed in subdirectory /lms ?? if installed in web root it should be
    Code (Text):
    try_files $uri $uri/ /index.php?q=$uri&$args;
    
     
..