So I have a small server with Lighttpd and I have installed PhpMyAdmin on it.
This is the default configuration. The Computer is accessible from the Internet on Port 80.
How can I make phpMyAdmin to listen on another port other then 80 ?
Or how can I make it to listen only on a specific subdomain ?
# Alias for phpMyAdmin directory
alias.url += (
"/phpmyadmin" => "/usr/share/phpmyadmin",
)
# Disallow access to libraries
$HTTP["url"] =~ "^/phpmyadmin/templates" {
url.access-deny = ( "" )
}
$HTTP["url"] =~ "^/phpmyadmin/libraries" {
url.access-deny = ( "" )
}
$HTTP["url"] =~ "^/phpmyadmin/setup/lib" {
url.access-deny = ( "" )
}
# Limit access to setup script
$HTTP["url"] =~ "^/phpmyadmin/setup" {
auth.backend = "htpasswd"
auth.backend.htpasswd.userfile = "/etc/phpmyadmin/htpasswd.setup"
auth.require = (
"/" => (
"method" => "basic",
"realm" => "phpMyAdmin Setup",
"require" => "valid-user"
)
)
}
After reading the newspaper and drinking coffee I found the solution ...
Simply make a symlink from /usr/share/phpmyadmin to a folder that runs on a domain on a port other then 80 ...
Have a Good Night.
After phpmyadmin is installed in your linux server (based on linux server flavors,such as CentOS, Debian, etc.), use online editor to open your lighttpd.conf file and add url.rewrite rules as shown below:
Then cd to /home/webroot directory (or any web directory where the web root level directory will be used for DOM (Document Objective Model) to serve web files such as html, php, etc. Then add a symbolic link to phpmyadmin:
Then, verify the symbolic link by typing:
which will display
Restart lighttpd, then open
http://dev.example.net/phpMyAdmin
in your web browser (or lynx)NOTES: Lighttpd url.rewrite rules may vary, depending on the type of website (such as wordpress, Laravel framework, etc.). This rewrite line
is important.
This dev.example.net domain name is used for reference. Replace dev.example.net with your domain name.