Ero sivun ”Phpmyadmin/en” versioiden välillä
(Ak: Uusi sivu: 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 wit...) |
(Ak: Uusi sivu: Logging in to the phpmyadmin settings page.) |
||
Rivi 74: | Rivi 74: | ||
# | # | ||
− | + | Logging in to the phpmyadmin settings page. | |
# Authorize for setup | # Authorize for setup |
Versio 17. elokuuta 2015 kello 07.38
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
Asetussivun fyysinen polku:
<Directory /usr/share/phpmyadmin/setup> <IfModule mod_authn_file.c> AuthType Basic AuthName "phpMyAdmin Setup"
Salasana tiedoston sijainti:
AuthUserFile /etc/phpmyadmin/htpasswd.setup </IfModule> Require valid-user </Directory>
Estä pääsemästä phpmyadminin järjestelmähakemistoihin kun ei tarvita niitä
# 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>
Useita MySQL palvelimia Phpmyadminiin
Lisää seuraavat konffit /etc/phpmyadmin/config.inc.php tiedostoon seuraavan konffien jälkeen:
/* * End of servers configuration * */
Tämä:
$i++; $cfg['Servers'][$i]['verbose'] = 'Database Server 2'; #Tietokantapalvelimen nimi, jolla tunnistetaan kirjautuessa /* Authentication type */ $cfg['Servers'][$i]['auth_type'] = 'cookie'; /* Server parameters */ $cfg['Servers'][$i]['host'] = '10.5.2.5'; #palvelimen IP-osoite, voi käyttää DNS-nimeä mutta saattaa olla hidas $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; #phpmyadminin tietokannan käyttäjätunnus $cfg['Servers'][$i]['controlpass'] = $dbpass; #phpmyadminin tietokannan salasana /* Optional: Advanced phpMyAdmin features */ $cfg['Servers'][$i]['pmadb'] = 'phpmyadmin'; #phpmyadminin tietokannan nimi $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 */
Testaa toiminta menemällä selaimella phpmyadminiin. Pitäisi näkyä nyt palvelimet listattuna.