Changes between Version 15 and Version 16 of Csle2022/Agenda/databaseandweb
- Timestamp:
- Nov 29, 2022, 10:21:23 AM (2 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Csle2022/Agenda/databaseandweb
v15 v16 374 374 }}} 375 375 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 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. 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 {{{ 379 cd /opt/softwares 380 }}} 380 381 381 382 Extract the compressed file 382 383 383 tar xzvf latest.tar.gz 384 {{{ 385 sudo tar xzvf latest.tar.gz 386 }}} 384 387 385 388 To enable Wordpress modify the directory content through the .htaccess file let's create the required file within the directory. 386 389 387 touch /tmp/wordpress/.htaccess 390 {{{ 391 touch wordpress/.htaccess 392 }}} 388 393 389 394 Then let's create a initial configuration file from a sample configuration given. 390 395 391 cp /tmp/wordpress/wp-config-sample.php /tmp/wordpress/wp-config.php 396 {{{ 397 cp wordpress/wp-config-sample.php wordpress/wp-config.php 398 }}} 392 399 393 400 We will also create the upgrade directory for WordPress as below. 394 401 395 mkdir /tmp/wordpress/wp-content/upgrade 402 {{{ 403 mkdir -p wordpress/wp-content/upgrade 404 }}} 396 405 397 406 Now we will copy entire content to the document root of WordPress site. 398 407 408 {{{ 399 409 cp -a wordpress/. /var/www/wp.your_domain.com/public_html/ 410 }}} 400 411 401 412 Now we will set the ownership settings of the WordPress directory to the Apache user. 402 413 414 {{{ 403 415 chown -R www-data:www-data /var/www/wp.your_domain.com 416 }}} 404 417 405 418 Next we will set correct directory and file permissions for document root. 406 419 420 {{{ 407 421 find wp.your_domain.com/public_html/ -type d -exec chmod 750 {} \; 408 422 find wp.your_domain.com/public_html/ -type f -exec chmod 640 {} \; … … 412 426 WordPress 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. 413 427 428 {{{ 414 429 curl -s https://api.wordpress.org/secret-key/1.1/salt/ 430 }}} 415 431 416 432 [[Image(https://ws.learn.ac.lk/raw-attachment/wiki/Csle2022/Agenda/databaseandweb/web24.png)]] … … 418 434 These lines can be directly copied into the WordPress configuration file. Open configuration file and replace the existing sample keys with them. 419 435 436 {{{ 420 437 nano /var/www/wp.your_domain.com/public_html/wp-config.php 438 }}} 421 439 422 440 Now we will add the database connection settings as below.