Changes between Version 16 and Version 17 of Csle2022/Agenda/databaseandweb
- Timestamp:
- Nov 29, 2022, 11:15:12 AM (2 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Csle2022/Agenda/databaseandweb
v16 v17 305 305 }}} 306 306 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'; 307 Next you need to grant permissions to user called wordpressuser to do any operations on the database as below. 308 309 {{{ 310 grant all privileges on wordpress.* to 'wordpressuser'@'localhost' IDENTIFIED BY 'dala1234'; 317 311 }}} 318 312 … … 320 314 321 315 {{{ 322 UPDATE mysql.user set plugin = 'mysql_native_password' where User = 'wordpressuser';316 ALTER USER wordpressuser@localhost IDENTIFIED VIA mysql_native_password; 323 317 }}} 324 318 … … 389 383 390 384 {{{ 391 touch wordpress/.htaccess385 sudo touch wordpress/.htaccess 392 386 }}} 393 387 … … 395 389 396 390 {{{ 397 cp wordpress/wp-config-sample.php wordpress/wp-config.php391 sudo cp wordpress/wp-config-sample.php wordpress/wp-config.php 398 392 }}} 399 393 … … 401 395 402 396 {{{ 403 mkdir -p wordpress/wp-content/upgrade397 sudo mkdir -p wordpress/wp-content/upgrade 404 398 }}} 405 399 … … 407 401 408 402 {{{ 409 cp -a wordpress/. /var/www/wp.your_domain.com/public_html/403 sudo cp -a wordpress/. /var/www/wp.your_domain.com/public_html/ 410 404 }}} 411 405 … … 413 407 414 408 {{{ 415 chown -R www-data:www-data /var/www/wp.your_domain.com409 sudo chown -R www-data:www-data /var/www/wp.your_domain.com 416 410 }}} 417 411 … … 419 413 420 414 {{{ 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 {} \; 415 cd /var/www 416 417 sudo find wp.your_domain.com/public_html/ -type d -exec chmod 750 {} \; 418 sudo find wp.your_domain.com/public_html/ -type f -exec chmod 640 {} \; 419 }}} 423 420 424 421 Now we are going to modify the configuration file we have added earlier. Here we will configure WordPress security keys and database connection settings. … … 435 432 436 433 {{{ 437 nano /var/www/wp.your_domain.com/public_html/wp-config.php434 sudo nano /var/www/wp.your_domain.com/public_html/wp-config.php 438 435 }}} 439 436 … … 463 460 The 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”. 464 461 462 {{{ 465 463 define('FS_METHOD', 'direct'); 464 }}} 466 465 467 466 Now 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.