Welcome! Log In Create A New Profile

Advanced

Running phpmyadmin off a separate port

Posted by edbloom 
Running phpmyadmin off a separate port
March 12, 2011 09:40AM
Hi all,

Finally getting to grips with nginx and I've successfully setup my server as follows:

In my nginx.conf I've got the following directive:

include /etc/nginx/sites-enabled/*;

In my sites-enabled directory I have 3 vhosts

default
mysite.com
mysqladmin.mysite.com

I've not yet pointed mysite.com to this server so I'm setting my local hosts file for mysite.com to go to the server public IP. I've done the same for mysqladmin.mysite.com which is running phpmyadmin and that also works no problem (i found a good nginx host file setup for phpmyadmin).

With this setting I can see mysite.com no problem.

My question is - with this setup do I absolutely need to point mysite.com and mysqladmin.mysite.com to the server to be able to access these vhosts or is there someway I can access them over IP e.g.

MYIPADDRESS/~mysite.com
MYIPADDRESS/~mysqladmin.mysite.com

or if that is not possible, instead of mysqladmin.mysite.com could I secure phpmyadmin by running it on a different port e.g.
MYIPADDRESS:8082/ (to bring you to the phpmyadmin login) I don't like running phpmyadmin over port 80 anyway

Apologies if I'm asking a question that has been answered before - I tried looking here and on Google extensively before I posted.

Thanks,

Ed
Re: Running phpmyadmin off a separate port
March 12, 2011 08:12PM
Hi all,

For anyone who is interested I managed to figure out both of these today after a lot of trail and error:

a.) phpmyadmin on a different port:

server {

listen 8084;
server_name MYIPADDRESS;

...rest of config...

}


b.) Viewing sites over IP's in subdirectories (useful for pre-dns change testing - the below also includes directive for wordpress friendly urls)

server {
listen 80;
server_name MYIPADDRESS;

location /mysubdirsite/ {
root /path/to//public_html/;
index index.php index.html index.htm;
try_files $uri $uri/ /mysubdirsite/index.php?q=$uri&$args;
}

... rest of config ...

}
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 214
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready