tejash1991

install wordpress on ubuntu

Aug 22nd, 2017
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.49 KB | None | 0 0
  1. Step 1: Install Apache Web Server
  2.  
  3. $ sudo apt-get install apache2 apache2-utils
  4.  
  5. Step 2: Install MySQL Database Server
  6.  
  7. $ sudo apt-get install mysql-client mysql-server
  8.  
  9. The database server deployment is not yet secure,
  10.  
  11. $ sudo mysql_secure_installation
  12.  
  13. Step 3: Install PHP and Modules
  14.  
  15. $ sudo apt-get install php7.0 php7.0-mysql libapache2-mod-php7.0 php7.0-cli php7.0-cgi php7.0-gd
  16.  
  17. to test if php is working with the web server create a info.php file in /var/www/html
  18.  
  19. sudo gedit /var/www/html/info.php
  20.  
  21. <?php
  22. phpinfo();
  23. ?>
  24.  
  25. open web browser and type this address http://localhost/info.php
  26.  
  27. Step 4: Install WordPress CMS
  28.  
  29. $ wget -c http://wordpress.org/latest.tar.gz
  30. $ tar -xzvf latest.tar.gz
  31.  
  32. move the WordPress files to the Apache root directory, /var/www/html/
  33.  
  34. $ sudo rsync -av wordpress/* /var/www/html/
  35.  
  36. give permission
  37.  
  38. $ sudo chown -R www-data:www-data /var/www/html/
  39. $ sudo chmod -R 755 /var/www/html/
  40.  
  41. Step 5: Create WordPress Database name wp
  42.  
  43. $ mysql -u root -p
  44.  
  45. mysql> CREATE DATABASE wp;
  46. mysql> GRANT ALL PRIVILEGES ON wp.* TO 'your_username_here'@'localhost' IDENTIFIED BY 'your_chosen_password_here';
  47. mysql> FLUSH PRIVILEGES;
  48. mysql> EXIT;
  49.  
  50. Go the /var/www/html/ directory and rename wp-config-sample.php to wp-config.php:
  51.  
  52. $ sudo mv /var/www/html/wp-config-sample.php /var/www/html/wp-config.php
  53.  
  54. then update it with your database information under the MySQL settings section in wp-config.php file
  55.  
  56. restart the web server and mysql service
Add Comment
Please, Sign In to add comment