My linux world » WordPress

Wordpress


WordPress is an online publishing / weblog package that makes it very easy, almost trivial, to get nformation out to people on the web.

Installation

You can copy/paste this script and use it to configure automatically your server.

  1. #!/bin/bash
  2.  
  3. ##################################################
  4. # PARAMETERS
  5. ##################################################
  6.  
  7. wp_database_name=wordpress
  8. wp_username=wordpress
  9. wp_password=wordpress
  10.  
  11.  
  12. ##################################################
  13. # INSTALLATION SCRIPT
  14. ##################################################
  15.  
  16. echo "install wordpress"
  17. dnf -y install wordpress
  18.  
  19. echo "create database $wp_database_name, user/password $wp_username/$wp_password":
  20. mysql --user=root --password=root -e "CREATE USER '$wp_username'@'localhost' IDENTIFIED BY '$wp_password';"
  21. mysql --user=root --password=root -e "CREATE DATABASE IF NOT EXISTS $wp_database_name;"
  22. mysql --user=root --password=root -e "use $wp_database_name; GRANT ALL PRIVILEGES ON $wp_database_name.* TO '$wp_username'@'localhost' WITH GRANT OPTION;"
  23.  
  24. echo "Note: by default only local users can access to wordpress."
  25. echo "Let's update the file /etc/httpd/conf.d/wordpress.conf and allow everyone."
  26. sed -i "s/\(Deny\s*from\s*All\)/#\1/" /etc/httpd/conf.d/wordpress.conf
  27.  
  28. echo "configure the database connection here: /usr/share/wordpress/wp-config.php"
  29. sed -i "s/\database_name_here/$wp_database_name/" /usr/share/wordpress/wp-config.php
  30. sed -i "s/\username_here/$wp_username/" /usr/share/wordpress/wp-config.php
  31. sed -i "s/\password_here/$wp_password/" /usr/share/wordpress/wp-config.php
  32.  
  33. echo "restart httpd"
  34. systemctl restart httpd.service
  35.  
  36. myip=`hostname -I`
  37. echo "Now meet you here: http://$myip/wordpress/"

That’s all 🙂
Administration – wordpress


Copyright © 2023 My linux world - by Marc RABAHI
Design by Marc RABAHI and encelades.

Fork me on GitHub