EWEB2
Installing MySQL
With your team prepare your virtual server for running MySQL by following the steps below.
Install the server
As root perform
$ yum install mysql mysql-server
Secure the server
Next configure mysql by issuing
$ /usr/bin/mysql_secure_installation
Give a password you can remember for the root user and accept the default for the rest - but DO READ and understand what you're accepting.
Make mysqld start with Linux
Next configure the mysqld to start with the server start:
$ chkconfig --list|grep mysql
expect a result like this:
mysqld 0:off 1:off 2:off 3:off 4:off 5:off 6:off
Now configure the mysql daemon to start with Linux boot:
$ chkconfig --level 345 mysqld on
this instructs Linux to start mysqld in run-level 3, 4 and 5. MySQL will now start every time you (re)boot your computer.
Check that you've enabled the mysqld
$ chkconfig --list|grep mysql
expect a result like this:
mysqld 0:off 1:off 2:off 3:on 4:on 5:on 6:off
Manually start the daemon
Finally start the daemon manually for the first time:
$ service mysqld start
Test that you can login by issuing:
$ mysql -p
give the previously set password. To quit from the mysql console type
quit;
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.nnn/info.php
where you replace nnn with your virtual computers IP address.
Install PDT in Eclipse
If you've havn't got Eclipse install for the C/C++ do so by going to eclipse.org and download the package. Install it in /opt/eclipses/CDT
There are several plugins for Eclipse handling PHP. I suggest two different plugins here:
PDT
In the Help menu select Install New software. In the Work with select box choose Kepler - ... Open the Web development collection and select PHP Development Toolkit (PDT)
Be patient - it may take very long time to install, for some reason, but eventually you may end up with PDT installed.
Be sure to restart your Eclipse after installation.
PHPEclipse
Next start the Eclipse and in the Help menu select Install new software - click on the Add button. Add this link: http://update.phpeclipse.net/update/stable/1.2.x type or select a site name it PHPEclipse.
Be patient - I've seen this taking very, very long time.
Be sure to restart your Eclipse after installation.
Alternative go to Eclipse Marketplace and download a the package from there. Install the package by clicking on the Add button and select the Archive button thereafter. Locate the downloaded package and install it. Beware this I've also seen being a very long running process.
Next create a new PHP project and work in there.
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 PHPMyAdmin
PHPHMyAdmin is a web based application enabling you to manipulate the MySQL database.
Installation
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
Configuration
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 by issuing:
$ service httpd restart
Testing the PHPMyAdmin installation
Test PHPMyAdmin by using this link phpMyadmin (works only if you're loged in on the development host using a NX terminal).
You may have to edit the phpmyadmin configuration file. Add the location og the mysql.sock file.
$ vi /etc/phpMyAdmin/config.inc.php
Find and change the socket setting so it looks like this:
$cfg['Servers'][$i]['socket'] = '/var/lib/mysql/mysql.sock'; // Path to the socket - leave blank for default socket
The path and file name of the mysql.sock file was added.
Be sure to reload the httpd before testing again.