Ero sivun ”Phpmyadmin/en” versioiden välillä
(Ak: Uusi sivu: Phpmyadmin's apache2 configuration files are located in:) |
(Ak: Uusi sivu: https://www.omaserveri.info/asenna-phpmyadmin-ubuntuun/ (Finnish)) |
||
(13 välissä olevaa versiota samalta käyttäjältä ei näytetä) | |||
Rivi 43: | Rivi 43: | ||
nano /etc/apache2/conf.d/phpmyadmin.conf | nano /etc/apache2/conf.d/phpmyadmin.conf | ||
− | + | AND (both have the same file) | |
nano /etc/phpmyadmin/apache.conf | nano /etc/phpmyadmin/apache.conf | ||
− | + | Contents of the file: | |
# phpMyAdmin default Apache configuration | # phpMyAdmin default Apache configuration | ||
Rivi 53: | Rivi 53: | ||
Alias /phpmyadmin /usr/share/phpmyadmin | Alias /phpmyadmin /usr/share/phpmyadmin | ||
− | Alias | + | Alias is a virtual directory where phpmyadmin is located. It is recommended to change the location of the virtual directory to somewhere else, so an attacker who isn't familiar with your configuration will have a harder time to access the phpmyadmin page. |
#<Directory /usr/share/phpmyadmin> | #<Directory /usr/share/phpmyadmin> | ||
Rivi 74: | Rivi 74: | ||
# | # | ||
− | + | Logging in to the phpmyadmin settings page. | |
# Authorize for setup | # Authorize for setup | ||
− | + | Settings page physical path: | |
<Directory /usr/share/phpmyadmin/setup> | <Directory /usr/share/phpmyadmin/setup> | ||
<IfModule mod_authn_file.c> | <IfModule mod_authn_file.c> | ||
AuthType Basic | AuthType Basic | ||
AuthName "phpMyAdmin Setup" | AuthName "phpMyAdmin Setup" | ||
− | + | Password file location: | |
AuthUserFile /etc/phpmyadmin/htpasswd.setup | AuthUserFile /etc/phpmyadmin/htpasswd.setup | ||
</IfModule> | </IfModule> | ||
Rivi 88: | Rivi 88: | ||
</Directory> | </Directory> | ||
− | + | Block access to the phpmyadmin system directories when they are not required. | |
# Disallow web access to directories that don't need it | # Disallow web access to directories that don't need it | ||
Rivi 100: | Rivi 100: | ||
</Directory> | </Directory> | ||
− | == | + | == Several MySQL servers for Phpmyadmin == |
− | + | Add the following configurations to the /etc/phpmyadmin/config.inc.php after the next configurations: | |
/* | /* | ||
Rivi 109: | Rivi 109: | ||
*/ | */ | ||
− | + | This: | |
$i++; | $i++; | ||
− | $cfg['Servers'][$i]['verbose'] = 'Database Server 2'; # | + | $cfg['Servers'][$i]['verbose'] = 'Database Server 2'; #Database server name, which is used for authentication |
/* Authentication type */ | /* Authentication type */ | ||
$cfg['Servers'][$i]['auth_type'] = 'cookie'; | $cfg['Servers'][$i]['auth_type'] = 'cookie'; | ||
/* Server parameters */ | /* Server parameters */ | ||
− | $cfg['Servers'][$i]['host'] = '10.5.2.5'; # | + | $cfg['Servers'][$i]['host'] = '10.5.2.5'; #server IP-address, you can use a DNS name but it might be slow |
$cfg['Servers'][$i]['connect_type'] = 'tcp'; | $cfg['Servers'][$i]['connect_type'] = 'tcp'; | ||
//$cfg['Servers'][$i]['compress'] = false; | //$cfg['Servers'][$i]['compress'] = false; | ||
Rivi 124: | Rivi 124: | ||
$cfg['Servers'][$i]['extension'] = 'mysql'; | $cfg['Servers'][$i]['extension'] = 'mysql'; | ||
/* Optional: User for advanced features */ | /* Optional: User for advanced features */ | ||
− | $cfg['Servers'][$i]['controluser'] = $dbuser; # | + | $cfg['Servers'][$i]['controluser'] = $dbuser; #phpmyadmin database username |
− | $cfg['Servers'][$i]['controlpass'] = $dbpass; # | + | $cfg['Servers'][$i]['controlpass'] = $dbpass; #phpmyadmin database password |
/* Optional: Advanced phpMyAdmin features */ | /* Optional: Advanced phpMyAdmin features */ | ||
− | $cfg['Servers'][$i]['pmadb'] = 'phpmyadmin'; # | + | $cfg['Servers'][$i]['pmadb'] = 'phpmyadmin'; #phpmyadmin database name |
$cfg['Servers'][$i]['bookmarktable'] = 'pma_bookmark'; | $cfg['Servers'][$i]['bookmarktable'] = 'pma_bookmark'; | ||
$cfg['Servers'][$i]['relation'] = 'pma_relation'; | $cfg['Servers'][$i]['relation'] = 'pma_relation'; | ||
Rivi 145: | Rivi 145: | ||
*/ | */ | ||
− | + | Test functionality by using your web browser to navigate to phpmyadmin. Now you should see the servers listed. | |
[[Tiedosto:Phpmyadmin multiple server login.png]] | [[Tiedosto:Phpmyadmin multiple server login.png]] | ||
− | == | + | == Additional information == |
− | https://www.omaserveri.info/asenna-phpmyadmin-ubuntuun/ | + | https://www.omaserveri.info/asenna-phpmyadmin-ubuntuun/ (Finnish) |
[[Category:Mysql]] | [[Category:Mysql]] | ||
[[Category:Linux]] | [[Category:Linux]] | ||
[[Category:Apache2]] | [[Category:Apache2]] |
Nykyinen versio 17. elokuuta 2015 kello 07.45
Phpmyadmin is a useful application for the administrator of a mysql database. Before installing phpmyadmin, install php5,mysql and apache2. More information on phpmyadmin.
Sisällysluettelo
Installation
1. We install phpmyadmin using the command line or by downloading the package online http://www.phpmyadmin.net/
aptitude install phpmyadmin
2. While installing we select the automatic configuration for an apache2 webserver.
3. We install an automatic database for phpmyadmin.
4. Give the Mysql ROOT user password.
5. Give the phpmyadmin user password. You can leave it blank, and a password will be generated.
6. Confirm password
You can access the web GUI and use it to administrate your database by:
http://serveraddress/phpmyadmin
Configuration
By default all configurations are made ready to function in the installation phase.
Phpmyadmin's apache2 configuration files are located in:
nano /etc/apache2/conf.d/phpmyadmin.conf
AND (both have the same file)
nano /etc/phpmyadmin/apache.conf
Contents of the file:
# phpMyAdmin default Apache configuration Alias /phpmyadmin /usr/share/phpmyadmin
Alias is a virtual directory where phpmyadmin is located. It is recommended to change the location of the virtual directory to somewhere else, so an attacker who isn't familiar with your configuration will have a harder time to access the phpmyadmin page.
#<Directory /usr/share/phpmyadmin> # Options FollowSymLinks # DirectoryIndex index.php # # <IfModule mod_php5.c> # AddType application/x-httpd-php .php # # php_flag magic_quotes_gpc Off # php_flag track_vars On # php_flag register_globals Off # php_admin_flag allow_url_fopen Off # php_value include_path . # php_admin_value upload_tmp_dir /var/lib/phpmyadmin/tmp # php_admin_value open_basedir /usr/share/phpmyadmin/:/etc/phpmyadmin/:/var/lib/phpmyadmin/ # </IfModule> # #</Directory> #
Logging in to the phpmyadmin settings page.
# Authorize for setup
Settings page physical path:
<Directory /usr/share/phpmyadmin/setup> <IfModule mod_authn_file.c> AuthType Basic AuthName "phpMyAdmin Setup"
Password file location:
AuthUserFile /etc/phpmyadmin/htpasswd.setup </IfModule> Require valid-user </Directory>
Block access to the phpmyadmin system directories when they are not required.
# Disallow web access to directories that don't need it <Directory /usr/share/phpmyadmin/libraries> Order Deny,Allow Deny from All </Directory> <Directory /usr/share/phpmyadmin/setup/lib> Order Deny,Allow Deny from All </Directory>
Several MySQL servers for Phpmyadmin
Add the following configurations to the /etc/phpmyadmin/config.inc.php after the next configurations:
/* * End of servers configuration * */
This:
$i++; $cfg['Servers'][$i]['verbose'] = 'Database Server 2'; #Database server name, which is used for authentication /* Authentication type */ $cfg['Servers'][$i]['auth_type'] = 'cookie'; /* Server parameters */ $cfg['Servers'][$i]['host'] = '10.5.2.5'; #server IP-address, you can use a DNS name but it might be slow $cfg['Servers'][$i]['connect_type'] = 'tcp'; //$cfg['Servers'][$i]['compress'] = false; /* Select mysqli if your server has it */ $cfg['Servers'][$i]['extension'] = 'mysql'; /* Optional: User for advanced features */ $cfg['Servers'][$i]['controluser'] = $dbuser; #phpmyadmin database username $cfg['Servers'][$i]['controlpass'] = $dbpass; #phpmyadmin database password /* Optional: Advanced phpMyAdmin features */ $cfg['Servers'][$i]['pmadb'] = 'phpmyadmin'; #phpmyadmin database name $cfg['Servers'][$i]['bookmarktable'] = 'pma_bookmark'; $cfg['Servers'][$i]['relation'] = 'pma_relation'; $cfg['Servers'][$i]['table_info'] = 'pma_table_info'; $cfg['Servers'][$i]['table_coords'] = 'pma_table_coords'; $cfg['Servers'][$i]['pdf_pages'] = 'pma_pdf_pages'; $cfg['Servers'][$i]['column_info'] = 'pma_column_info'; $cfg['Servers'][$i]['history'] = 'pma_history'; $cfg['Servers'][$i]['designer_coords'] = 'pma_designer_coords'; $cfg['Servers'][$i]['tracking'] = 'pma_tracking'; $cfg['Servers'][$i]['userconfig'] = 'pma_userconfig'; /* Uncomment the following to enable logging in to passwordless accounts, * after taking note of the associated security risks. */ // $cfg['Servers'][$i]['AllowNoPassword'] = TRUE; /* * End of servers configuration */
Test functionality by using your web browser to navigate to phpmyadmin. Now you should see the servers listed.
Additional information
https://www.omaserveri.info/asenna-phpmyadmin-ubuntuun/ (Finnish)