My Youtube Channel

Please Subscribe

Flag of Nepal

Built in OpenGL

Word Cloud in Python

With masked image

Showing posts with label install. Show all posts
Showing posts with label install. Show all posts

Thursday, February 1, 2024

Steps to install HTTPD, PHP, MYSQL and PHPMYADMIN in CentOS 8


Steps to install httpd in CentOS 8

  1. sudo yum install dnf
  2. sudo dnf update
  3. sudo dnf install httpd
  4. sudo systemctl start httpd
  5. sudo systemctl enablr httpd
  6. sudo systemctl enable httpd
  7. sudo firewall-cmd --add-service=http --permanent
  8. sudo firewall-cmd --reload
  9. sudo systemctl status httpd
  10. sudo dnf update

Steps to install PHP in CentOS 8

  1. sudo dnf update
  2. sudo dnf install epel-release
  3. sudo dnf install https://rpms.remirepo.net/enterprise/remi-release-8.rpm
  4. sudo dnf module enable php:remi-8.2
  5. sudo dnf module reset php
  6. sudo dnf module enable php:remi-8.2
  7. sudo dnf module list php
  8. sudo dnf install php php-cli php-fpm php-mysqlnd php-pdo php-gd php-xml
  9. php -v
Steps to install MYSQL in CentOS 8

  1. sudo dnf update
  2. sudo dnf install https://dev.mysql.com/get/mysql80-community-release-el8-    3.noarch.rpm
  3. sudo dnf module enable mysql:8.0
  4. sudo dnf update
  5. sudo dnf install mysql-server
  6. sudo systemctl start php-fpm
  7. sudo systemctl enable php-fpm
  8. sudo systemctl restart httpd
  9. sudo systemctl start mysqld
  10. sudo systemctl enable mysqld
Steps to install phpmyadmin in CentOS 8

  1. Sudo dnf install epel-release
  2. sudo dnf update
  3. yum -y update
  4. yum -y install phpmyadmin
  5. dnf --enablerepo=remi install phpMyAdmin
  6. sudo vi /etc/httpd/conf.d/phpMyAdmin.conf
Make sure the phpMyAdmin.conf file looks similar to this:

Alias /phpMyAdmin /usr/share/phpMyAdmin

Alias /phpmyadmin /usr/share/phpMyAdmin

 

<Directory /usr/share/phpMyAdmin/>

   AddDefaultCharset UTF-8

   <IfModule mod_authz_core.c>

      # Apache 2.4

      <RequireAny>

         Require all granted

      </RequireAny>

   </IfModule>

   <IfModule !mod_authz_core.c>

      # Apache 2.2

      Order Deny,Allow

      Deny from All

      Allow from 127.0.0.1

      Allow from ::1

   </IfModule>

</Directory>

 

<Directory /usr/share/phpMyAdmin/setup/>

7. sudo systemctl restart httpd

8. You can verify the phpmyadmin installation by opening URL:

http://your_server_ip/phpMyAdmin

Alternative way to install phpmyadmin on CentOS 8

  1. sudo dnf update
  2. sudo dnf install tar
  3. sudo dnf install wget
  4. wget https://files.phpmyadmin.net/phpMyAdmin/5.1.3/phpMyAdmin-5.1.3-all-languages.tar.gz
  5. tar xzf phpMyAdmin-5.1.3-all-languages.tar.gz
  6. sudo mv phpMyAdmin-5.1.3-all-languages /usr/share/phpMyAdmin
  7. sudo mkdir /etc/phpMyAdmin
  8. sudo cp /usr/share/phpMyAdmin/config.sample.inc.php /etc/phpMyAdmin/config.inc.php
  9. sudo chmod 660 /etc/phpMyAdmin/config.inc.php
  10. sudo chown -R apache:apache /etc/phpMyAdmin
  11. sudo vi /etc/phpMyAdmin/config.inc.php
  12. add to config.inc.php,
                $cfg['blowfish_secret'] = 'a1b2c3d4e5f6g7h8i9j0';

13. sudo vi /etc/httpd/conf.d/phpMyAdmin.conf

Your phpMyAdmin.conf should be similar to given below,

Alias /phpMyAdmin /usr/share/phpMyAdmin

Alias /phpmyadmin /usr/share/phpMyAdmin

 

<Directory /usr/share/phpMyAdmin/>

   AddDefaultCharset UTF-8

   <IfModule mod_authz_core.c>

      # Apache 2.4

      <RequireAny>

         Require all granted

      </RequireAny>

   </IfModule>

   <IfModule !mod_authz_core.c>

      # Apache 2.2

      Order Deny,Allow

      Deny from All

      Allow from 127.0.0.1

      Allow from ::1

   </IfModule>

</Directory>

 

<Directory /usr/share/phpMyAdmin/setup/>

14. sudo systemctl restart httpd

 

Note: "vi" command used above is an editor. I hope you know how to use it.

To insert, press i

To exit without saving, press esc then :q! and then enter

To exit along with saving, press esc then :wq! then enter