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


Ignore:
Timestamp:
Nov 29, 2022, 10:21:23 AM (2 years ago)
Author:
admin
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Csle2022/Agenda/databaseandweb

    v15 v16  
    374374}}}
    375375
    376 Now that our server software is configured, we can download and set up WordPress. For security reasons in particular, it is always recommended to get the latest version of WordPress from their site.
    377 
    378 cd /tmp
    379 curl -O https://wordpress.org/latest.tar.gz
     376Now that our server software is configured, we can download and set up WordPress. For security reasons in particular, it is always recommended to get the latest version of WordPress from their site. In this lab to make easy for you we have already downloaded the WordPress. Now please go to the directory below for continuing the WordPress installation.
     377
     378{{{
     379cd /opt/softwares
     380}}}
    380381
    381382Extract the compressed file
    382383
    383 tar xzvf latest.tar.gz
     384{{{
     385sudo tar xzvf latest.tar.gz
     386}}}
    384387
    385388To enable Wordpress modify the directory content through the .htaccess file let's create the required file within the directory.
    386389
    387 touch /tmp/wordpress/.htaccess
     390{{{
     391touch wordpress/.htaccess
     392}}}
    388393
    389394Then let's create a initial configuration file from a sample configuration given.
    390395
    391 cp /tmp/wordpress/wp-config-sample.php /tmp/wordpress/wp-config.php
     396{{{
     397cp wordpress/wp-config-sample.php wordpress/wp-config.php
     398}}}
    392399
    393400We will also create the upgrade directory for WordPress as below.
    394401
    395 mkdir /tmp/wordpress/wp-content/upgrade
     402{{{
     403mkdir -p wordpress/wp-content/upgrade
     404}}}
    396405
    397406Now we will copy entire content to the document root of WordPress site.
    398407
     408{{{
    399409cp -a wordpress/. /var/www/wp.your_domain.com/public_html/
     410}}}
    400411
    401412Now we will set the ownership settings of the WordPress directory to the Apache user.
    402413
     414{{{
    403415chown -R www-data:www-data /var/www/wp.your_domain.com
     416}}}
    404417
    405418Next we will set correct directory and file permissions for document root.
    406419
     420{{{
    407421find wp.your_domain.com/public_html/  -type d -exec chmod 750 {} \;
    408422find wp.your_domain.com/public_html/  -type f -exec chmod 640 {} \;
     
    412426WordPress uses security keys to protect your website against hacking attempts. WordPress security keys are an encryption tool that protects login information by making it harder to decode. WordPress provides a secure generator for these keys to generate them use the below command.
    413427
     428{{{
    414429curl -s https://api.wordpress.org/secret-key/1.1/salt/
     430}}}
    415431
    416432[[Image(https://ws.learn.ac.lk/raw-attachment/wiki/Csle2022/Agenda/databaseandweb/web24.png)]]
     
    418434These lines can be directly copied into the WordPress configuration file. Open configuration file and replace the existing sample keys with them.
    419435
     436{{{
    420437nano /var/www/wp.your_domain.com/public_html/wp-config.php
     438}}}
    421439
    422440Now we will add the database connection settings as below.