Difference between revisions of "EWEB2"

From Klaus' wiki
Jump to: navigation, search
(Administer MySQL through PHP MyAdmin)
Line 42: Line 42:
  
 
===Administer MySQL through PHP MyAdmin===
 
===Administer MySQL through PHP MyAdmin===
 +
 +
First ensure that you have mysql and the mysql server installed.
 +
 +
<source lang="bash">
 +
$ yum install mysql mysql-server
 +
$ service mysqld start
 +
$
 +
</source>
  
 
Install phpmyadmin by, as root, issuing this command:
 
Install phpmyadmin by, as root, issuing this command:

Revision as of 13:35, 16 January 2014

Install PHP

In order to use PHP in the web server, you have to install PHP.

As root perform:

$ yum install php
$ service httpd restart

The last line is to restart the Apache server loading the newly installed module.

Test the PHP installation

In the web-server root (typical /var/www/html) create a file info.php with this content:

<?php
phpinfo();
?>

Next test that your web-server and PHP is running as expected by entering in your web-browser the IP-address of your virtual server and /info.php like:

10.1.18.104/info.php


Get in contact with MySQL

As root install support for the MySQL database by issuing:

$ yum install php-mysql

Restart the httpd server.

Reload the info.php page and observe that you now have a section about MySQL.

Administer MySQL through PHP MyAdmin

First ensure that you have mysql and the mysql server installed.

$ yum install mysql mysql-server
$ service mysqld start
$

Install phpmyadmin by, as root, issuing this command:

$ yum install phpmyadmin

Next you have to configure the phpmyadmin a little:

In /etc/http/conf.d/phpmyadmin.conf comment out the <Directory "/usr/share/phpmyadmin"> stanza ending up with something like this:

# But allowing phpMyAdmin to anyone other than localhost should be considered
# dangerous unless properly secured by SSL
 
Alias /phpMyAdmin /usr/share/phpMyAdmin
Alias /phpmyadmin /usr/share/phpMyAdmin
 
#<Directory /usr/share/phpMyAdmin/>
#   Order Deny,Allow
#   Deny from All
#   Allow from 127.0.0.1
#   Allow from ::1
#</Directory>

Next we check that the authentication in phpMyAdmin is set to http:

Open /usr/share/phpMyAdmin/config.inc.php and look for the line:


$cfg['Servers'][$i]['auth_type']     = 'http';      // Authentication method (config, http or cookie based)?

if the setting is not http change it.

Restart the httpd.