Changes between Version 16 and Version 17 of Csle2022/Agenda/databaseandweb


Ignore:
Timestamp:
Nov 29, 2022, 11:15:12 AM (2 years ago)
Author:
admin
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Csle2022/Agenda/databaseandweb

    v16 v17  
    305305}}}
    306306
    307 Then create a user for the database.
    308 
    309 {{{
    310 CREATE USER 'wordpressuser'@'localhost' IDENTIFIED BY 'dala1234';
    311 }}}
    312 
    313 Next you need to grant permissions to user to do any operations on the database as below.
    314 
    315 {{{
    316 GRANT ALL ON wordpress.* TO 'wordpressuser'@'localhost';
     307Next you need to grant permissions to user called wordpressuser to do any operations on the database as below.
     308
     309{{{
     310grant all privileges on wordpress.* to 'wordpressuser'@'localhost' IDENTIFIED BY 'dala1234';
    317311}}}
    318312
     
    320314
    321315{{{
    322 UPDATE mysql.user set plugin = 'mysql_native_password' where User = 'wordpressuser';
     316ALTER USER wordpressuser@localhost IDENTIFIED VIA mysql_native_password;
    323317}}}
    324318
     
    389383
    390384{{{
    391 touch wordpress/.htaccess
     385sudo touch wordpress/.htaccess
    392386}}}
    393387
     
    395389
    396390{{{
    397 cp wordpress/wp-config-sample.php wordpress/wp-config.php
     391sudo cp wordpress/wp-config-sample.php wordpress/wp-config.php
    398392}}}
    399393
     
    401395
    402396{{{
    403 mkdir -p wordpress/wp-content/upgrade
     397sudo mkdir -p wordpress/wp-content/upgrade
    404398}}}
    405399
     
    407401
    408402{{{
    409 cp -a wordpress/. /var/www/wp.your_domain.com/public_html/
     403sudo cp -a wordpress/. /var/www/wp.your_domain.com/public_html/
    410404}}}
    411405
     
    413407
    414408{{{
    415 chown -R www-data:www-data /var/www/wp.your_domain.com
     409sudo chown -R www-data:www-data /var/www/wp.your_domain.com
    416410}}}
    417411
     
    419413
    420414{{{
    421 find wp.your_domain.com/public_html/  -type d -exec chmod 750 {} \;
    422 find wp.your_domain.com/public_html/  -type f -exec chmod 640 {} \;
     415cd /var/www
     416
     417sudo find wp.your_domain.com/public_html/  -type d -exec chmod 750 {} \;
     418sudo find wp.your_domain.com/public_html/  -type f -exec chmod 640 {} \;
     419}}}
    423420
    424421Now we are going to modify the configuration file we have added earlier. Here we will configure WordPress security keys and database connection settings.
     
    435432
    436433{{{
    437 nano /var/www/wp.your_domain.com/public_html/wp-config.php
     434sudo nano /var/www/wp.your_domain.com/public_html/wp-config.php
    438435}}}
    439436
     
    463460The other change we need to make is to set the method that WordPress should use to write to the filesystem. Since we’ve given the web server permission to write where it needs to, we can explicitly set the filesystem method to “direct”.
    464461
     462{{{
    465463define('FS_METHOD', 'direct');
     464}}}
    466465
    467466Now we are done with configuration of the WordPress.  To begin the installation you have to access the WordPress URL from the web browser. Enter the http://wp.your_domain.com/ on the browser and we need to follow the steps as below.