Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


Dr. Mike's Dumb Question #8344545 - phpmyadmin install
New on LowEndTalk? Please Register and read our Community Rules.

All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.

Dr. Mike's Dumb Question #8344545 - phpmyadmin install

drmikedrmike Member
edited September 2011 in General

Greets:

Beginning to want to bring back Apache....

Anyway I'm trying to install phpMyAdmin on Nginx and I'm having a problem. I installed the script via an apt-get, created the subdomain where I wanted it, created the following *.conf file:

server {
    listen 1.2.3.4:80;
    server_name phpmyadmin.mysite.tld;
    root /var/www/phpmyadmin.mysite.tld;
    access_log /var/log/nginx/phpmyadmin.mysite.tld.access.log;
    error_log /var/log/nginx/phpmyadmin.mysite.tld.error.log;
    include /etc/nginx/fastcgi_php;

location / {
root /usr/share/phpmyadmin;
index index.php;
}

location ~ \.php$ {
        include fastcgi_params;
        fastcgi_pass  127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /usr/share/phpmyadmin$fastcgi_script_name;
}

}

and restarted Nginx. Gives me a 404 Not Found error. The strange thing though is that the PMA favicons shows up fine so I know it's finding the files fine.

Any ideas? I'm looking at the last line, the fastcgi_param in there and wondering if that's correct.

The logs give me:

2011/09/10 18:12:16 [error] 2943#0: *5 open() "/var/www/phpmyadmin.mysite.tld/index.php" failed (2: No such file or directory), client: 1.2.3.4, server: phpmyadmin.mysite.tld, request: "GET / HTTP/1.1", host: "phpmyadmin.mysite.tld"

The strange thing with that is that it's returning the IP address of the vps, not the one that I'm coming in from.

Thanks

Should have just installed it manually.

Comments

  • InfinityInfinity Member, Host Rep
    edited September 2011

    Are you sure the favicon isn't cached from a previous install?

    I think this has happened to me before but I just can't recall how I solved it if I did actually solve it.

    Thanked by 1drmike
  • drmikedrmike Member
    edited September 2011

    Brand new install just from about 20 minutes ago. Newly created subdomain and everything.

    edit: And, yes, I know I need to ssl it. Want to get it up and running first. :)

    reedit: And I just confirmed that /usr/share/phpmyadmin/index.php does exist.

  • InfinityInfinity Member, Host Rep
    edited September 2011

    I am not an expert by any means but: why put the root section as "/var/www/phpmyadmin.mysite.tld" if you have the location section with "/usr/share/phpmyadmin". I'm wondering why you can't just make the root "/usr/share/phpmyadmin" and delete the location stanza.

    Where do you have the files uploaded, /usr/share/phpmyadmin or /var/www/phpmyadmin.mysite.tld because by the looks of it nginx is requesting the file from /var/www/phpmyadmin.mysite.tld

  • drmikedrmike Member
    edited September 2011

    apt-get stuck the files in /usr/share/phpmyadmin

    Let me try getting ride of that first root line and see what happens. The second root line was an originally an alias instead with many tutorials on how to do this.

    edit: No good. Looking for the file /usr/local/nginx/html/index.php now. Let me fiddle with that though.

  • InfinityInfinity Member, Host Rep

    Hmm.. I personally have never actually installed phpMyAdmin from apt-get or yum or what have you. Rather I prefer installing directly from source. It's not really installing, all it is doing is extracting a few files. I encourage you to go download it yourself and extract the files to /var/www/phpmyadmin.mysite.tld/ and put back the root thing.

    Thanked by 1drmike
  • Hmmm, this person looks familiar: http://joneslee85.wordpress.com/2010/02/28/howto-nginx-php5-mysql-phpmyadmin-ubuntu-shortest-setup/#comment-182

    I'm debating on it currently. Was on my locked down terminal when I first started so I didn't have webaccess. That's why I did it this way.

  • Got it:

    server {
        listen 1.2.3.4:80;
        root /usr/share/phpmyadmin;
        server_name phpmyadmin.mysite.tld;
        access_log /var/log/nginx/phpmyadmin.mysite.tld.access.log;
        error_log /var/log/nginx/phpmyadmin.mysite.tld.error.log;
        include /etc/nginx/fastcgi_php;
    
    location / {
    index index.html index.htm index.php;
    }
    
    location ~ \.php$ {
            include fastcgi_params;
            fastcgi_pass  127.0.0.1:9000;
    fastcgi_index index.php;
    fastcgi_param SCRIPT_FILENAME /usr/share/phpmyadmin$fastcgi_script_name;
    }
    
    
    }

    Thanks for your help

  • InfinityInfinity Member, Host Rep
    edited September 2011

    EDIT: Oh, you solved it. Your welcome ;)

  • yomeroyomero Member
    edited September 2011

    Moving root out of the location section =) FTW

    Hmmm by the way, someone know how to say to nging take the files form another folder? Let's say, I want phpmyadmin in

    http://mydomain.com/phpmyadmin

    and the files are in /usr/share/phpmyadmin

    The little hack to me at this moment, is copying/symlinking the folder to the root of mydomain.com, but I guess that isn't the best way, and nginx can do it for me (I did it before in lighttpd).

  • @yomero Just add this into your config file:

    location /phpmyadmin {
    root /usr/share/phpmyadmin;
    index index.php;
    }
  • Seems like I did it before... thanks Kuro, I will check :D

  • heh All that and now I'm reinstalling the vps. :)

  • InfinityInfinity Member, Host Rep

    Huh, why?

  • I screwed something up and apt-get is kicking out nothing but errors when I try to fix it.

    Trying the updated lowendscript as well.

  • By the way, that include up there should be:

    include /etc/nginx/php.conf;
  • Hi Mike,
    Welcome to LET.
    Because of your beginners knowledge I suggest you get a fully managed vps. If you use LET sister site lowendbox I'm sure you will find something.

    Good luck

  • FranciscoFrancisco Top Host, Host Rep, Veteran

    net said: Hi Mike, Welcome to LET. Because of your beginners knowledge I suggest you get a fully managed vps. If you use LET sister site lowendbox I'm sure you will find something.

    Good luck

    Biggest. Troll. Ever.

    Bravo :)

    Francisco

    Thanked by 1[Deleted User]
  • @Francisco Haha i was only joking. I know Mike has been around here longer than fidel castro has been in power.

  • drmikedrmike Member
    edited September 2011

    wtf?

    I made a mistake and tried to correct it. If you have a problem with that, well that's your problem.

  • InfinityInfinity Member, Host Rep

    Ooooww. net feels dumb. Net got par'd :O

    If you are wondering what par'd means: http://www.urbandictionary.com/define.php?term=par

  • edited September 2011

    Mike stop getting all arsey ;o
    It was a joke , deal with it.

  • LOL, stop...stop!!!

    That was funny @net

    Thanked by 1Infinity
  • InfinityInfinity Member, Host Rep

    Trololololololol.

  • sleddogsleddog Member
    edited September 2011

    yomero said: Hmmm by the way, someone know how to say to nging take the files form another folder? Let's say, I want phpmyadmin in

    http://mydomain.com/phpmyadmin

    and the files are in /usr/share/phpmyadmin

    location /phpmyadmin {
            alias /usr/share/phpmyadmin;
    }
  • @sleddog Interesting, thanks man, I didn't knew the alias stuff

  • tuxtux Member
    edited September 2011
    ln -s /usr/share/phpmyadmin /srv/www/www.domain.tld/public/phpmyadmin
  • tux said: ln -s /usr/share/phpmyadmin /srv/www/www.domain.tld/public/phpmyadmin

    Linking external directories into the public webspace works but might be less secure in some cases...

  • What's the difference between

    location /phpmyadmin {
            alias /usr/share/phpmyadmin;
    }

    and

    location /phpmyadmin {
            root /usr/share/phpmyadmin;
    }

    ?

  • vedranvedran Veteran
    edited September 2011

    You're right, I should RTFM

    Basically

    location /phpmyadmin {
            alias /usr/share/phpmyadmin;
    }

    is the same as

    location /phpmyadmin {
            root /usr/share/;
    }
Sign In or Register to comment.