Académique Documents
Professionnel Documents
Culture Documents
Install Apache
# chkconfig httpd on
Allow Apache server default port 80 through your firewall/router if you want to
connect from remote systems. To do that, edit file /etc/sysconfig/iptables,
# vi /etc/sysconfig/iptables
Add the following lines.
[...]
-A INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEP
[...]
Restart iptables:
Install MySQL
MySQL is an enterprise class, open source, worlds second most used database.
MySQL is a popular choice of database for use in web applications, and is a
central component of the widely used LAMP open source web application
software stack.
# chkconfig mysqld on
Setup MySQL root password
By default, mysql root user doesnt has password. To secure mysql, we have to
setup mysql root user password.
# mysql_secure_installation
NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MySQL
In order to log into MySQL to secure it, we'll need the current
password for the root user. If you've just installed MySQL, and
you haven't set the root password yet, the password will be blank,
Setting the root password ensures that nobody can log into the
MySQL
... Success!
to log into MySQL without having to have a user account created for
production environment.
... Success!
ensures that someone cannot guess at the root password from the
network.
... Success!
... Success!
Reloading the privilege tables will ensure that all changes made so
far
... Success!
Cleaning up...
All done! If you've completed all of the above steps, your MySQL
Create a sample testphp.php file in Apache document root folder and append
the lines as shown below:
# vi /var/www/html/testphp.php
Add the following lines.
If you wanna to get MySQL support in your PHP, you should install php-mysql
package. If you want to install all php modules just you use the command yum
install php*
phpMyAdmin is a free open source web interface tool, used to manage your
MySQL databases. By default phpMyAdmin is not found in CentOS official
repositories. So let us install it using EPEL repository.
# vi /etc/httpd/conf.d/phpMyAdmin.conf
Find and comment the whole /<Directory> section as shown below:
[...]
#<Directory /usr/share/phpMyAdmin/>
# <IfModule mod_authz_core.c>
# # Apache 2.4
# Require local
# </IfModule>
# <IfModule !mod_authz_core.c>
# # Apache 2.2
# Order Deny,Allow
# </IfModule>
#</Directory>
[...]
Open config.inc.php file and change from cookie to http to change the
authentication in phpMyAdmin:
# cp /usr/share/phpMyAdmin/config.sample.inc.php
/usr/share/phpMyAdmin/config.inc.php
# vi /usr/share/phpMyAdmin/config.inc.php
Change cookie to http.
[...]
/* Authentication type */
$cfg['Servers'][$i]['auth_type'] = 'http';
[...]
Restart the Apache service:
Enter your MySQL username and password which you have given in previous
steps. In my case its root and centos.
Now
you will be redirected to the phpmyadmin dashboard.page as shown below.
Now you will able to manage your MariaDB databases from phpMyAdmin web
interface.
Cheers!