LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 01-09-2019, 05:59 AM   #1
vask0
LQ Newbie
 
Registered: Dec 2018
Posts: 22

Rep: Reputation: Disabled
access to phpmyadmin ban ip addresses


Hi i want to ask how can i limit access to phpmyadmin who is in your folder site/admin

I only want certain IP addresses to be able to access this folder and everyone else can not

os: debian 9

10x!!!
 
Old 01-09-2019, 07:20 AM   #2
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
Quote:
Originally Posted by vask0 View Post
Hi i want to ask how can i limit access to phpmyadmin who is in your folder site/admin

I only want certain IP addresses to be able to access this folder and everyone else can not

os: debian 9

10x!!!
You didn't mention the webserver software you're running, but if it's apache, you should take a look at here

Regards
 
Old 01-09-2019, 01:16 PM   #3
vask0
LQ Newbie
 
Registered: Dec 2018
Posts: 22

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by bathory View Post
You didn't mention the webserver software you're running, but if it's apache, you should take a look at here

Regards
Here I think I forbid any and all ip-addresses to visit the server,? I must be banned from the specified directive so that it can not be ip-accessed from all ip-addresses and I can determine which adress will have access to the directory
 
Old 01-09-2019, 04:12 PM   #4
scasey
LQ Veteran
 
Registered: Feb 2013
Location: Tucson, AZ, USA
Distribution: CentOS 7.9.2009
Posts: 5,727

Rep: Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211
bathory's advice can be applied to a single directory, if that's what you want to do. It doesn't have to apply to the entire server.

I did two things to limit access to phpmyadmin:
1. changed the name of the directory where it lives, and therefore the URL to reach it.
2. Used mod auth to require a userid and password to see the login to phpmyadmin.

Yes, I have to log in twice, but without the first login, no one else can even see the phpmyadmin login.

I've opted NOT to limit by IP address because
1. my home IP address is dynamic and could change
2. I may not be at home when I need to access phpmyadmin
 
Old 01-10-2019, 01:34 AM   #5
vask0
LQ Newbie
 
Registered: Dec 2018
Posts: 22

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by scasey View Post
bathory's advice can be applied to a single directory, if that's what you want to do. It doesn't have to apply to the entire server.

I did two things to limit access to phpmyadmin:
1. changed the name of the directory where it lives, and therefore the URL to reach it.
2. Used mod auth to require a userid and password to see the login to phpmyadmin.

Yes, I have to log in twice, but without the first login, no one else can even see the phpmyadmin login.

I've opted NOT to limit by IP address because
1. my home IP address is dynamic and could change
2. I may not be at home when I need to access phpmyadmin

In short, I want to do something like thi link

I do the instructions but it does not work. folder site.com/admin where it is accessed again from all IP addresses

As I mentioned, it is about:

OS: Debian server 9

Software:
Code:
apachectl -V
Server version: Apache/2.4.25 (Debian)
Server built:   2018-11-03T18:46:19
Server's Module Magic Number: 20120211:68
Server loaded:  APR 1.5.2, APR-UTIL 1.5.4
Compiled using: APR 1.5.2, APR-UTIL 1.5.4
Architecture:   32-bit
Server MPM:     prefork
  threaded:     no
    forked:     yes (variable process count)
Server compiled with....
 -D APR_HAS_SENDFILE
 -D APR_HAS_MMAP
 -D APR_HAVE_IPV6 (IPv4-mapped addresses enabled)
 -D APR_USE_SYSVSEM_SERIALIZE
 -D APR_USE_PTHREAD_SERIALIZE
 -D SINGLE_LISTEN_UNSERIALIZED_ACCEPT
 -D APR_HAS_OTHER_CHILD
 -D AP_HAVE_RELIABLE_PIPED_LOGS
 -D DYNAMIC_MODULE_LIMIT=256
 -D HTTPD_ROOT="/etc/apache2"
 -D SUEXEC_BIN="/usr/lib/apache2/suexec"
 -D DEFAULT_PIDLOG="/var/run/apache2.pid"
 -D DEFAULT_SCOREBOARD="logs/apache_runtime_status"
 -D DEFAULT_ERRORLOG="logs/error_log"
 -D AP_TYPES_CONFIG_FILE="mime.types"
 -D SERVER_CONFIG_FILE="apache2.conf"

Last edited by vask0; 01-10-2019 at 01:37 AM.
 
Old 01-10-2019, 02:41 AM   #6
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
Quote:
In short, I want to do something like thi link

I do the instructions but it does not work. folder site.com/admin where it is accessed again from all IP addresses
Could you show us the relevant part of your apache config file?
Also make sure you clear the browser cache before testing.

Regards
 
Old 01-10-2019, 02:48 AM   #7
scasey
LQ Veteran
 
Registered: Feb 2013
Location: Tucson, AZ, USA
Distribution: CentOS 7.9.2009
Posts: 5,727

Rep: Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211
...and did you restart Apache after making the change?
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
PhpMyAdmin completly installed but can not connect to Server (IP/phpmyadmin) DKI Linux - Newbie 4 11-22-2014 08:51 AM
phpMyAdmin error: client denied by server configuration: /usr/share/phpMyAdmin Kropotkin Linux - Server 2 05-15-2010 12:55 PM
phpmyadmin shows blank page; no "phpmyadmin" database in mysql qajaq Linux - Software 2 12-20-2009 12:23 PM
Mapping IP addresses to MAC addresses basilio Linux - Networking 17 09-12-2007 01:48 AM
How to ban IP addresses SUSE/VSFTPD t3___ Linux - Newbie 7 05-23-2005 08:32 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 10:40 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration