Sunday 19 May 2019

Wordpress - Install WordPress on Ubuntu


1. Install Lamp Server

(a) Install tasksel


(b) Install lamp using tasksel
sudo tasksel install lamp-server

(c) Check php version

php -v

   (d) Check mysql version
mysql -v


   (e) Check mysql version
apache2 -v


9. PHP Configuration


(a) Create info.php file

echo "<?php phpinfo(); ?>" | sudo tee /var/www/html/info.php

(b) Open info.php page on browser
http://your-ip-address/info.php or https://your-domain/info.php

    (c) Install phpmyadmin
sudo apt install phpmyadmin


    (d) Edit phpMyAdmin’s Apache Config
 If the PhpMyAdmin package has not been enable to work with apache web server automatically, run the following commands to copy the phpmyadmin apache configuration file located under /etc/phpmyadmin/ to apache webserver available configurations directory /etc/apache2/conf-available/ and then activate it using the a2enconf utility, and restart apache service effect the recent changes, as follows.

sudo cp /etc/phpmyadmin/apache.conf /etc/apache2/conf-available/phpmyadmin.conf

(e) Open phpmyadmin
http://your-ip-address/phpmyadmin or https://your-domain/phpmyadmin

11. Mysql configuration

(a) Create root password for mysql where default user is root
sudo mysql_secure_installation

      (b) Root login into mysql

      (c) Create new database
CREATE DATABASE your-db-name


      (d) Create new user
GRANT ALL PRIVILEGES ON your-db-name.* TO 'your-user-name'@'localhost' -> IDENTIFIED BY 'your-password';


      (e)  FLUSH PRIVILEGES;
(f) exit;

12. Wordpress setup

       (a) Install wordpress
sudo apt install wordpress


       (b) Create new configuration  file

Open /etc/apache2/sites-available/wordpress.conf and write the following lines:
#....................................................................................
#Alias /blog /usr/share/wordpress
<Directory /usr/share/wordpress>
Options FollowSymLinks
AllowOverride Limit Options FileInfo
DirectoryIndex index.php
Order allow,deny
Allow from all
</Directory>
<Directory /usr/share/wordpress/wp-content>
Options FollowSymLinks
Order allow,deny
Allow from all
</Directory>
#....................................................................................

(c) Enable this new configuration file with
a2ensite utility

(d) Restart the apache2 web server

(e) Now configure WordPress to use a mysql database.

Open /etc/wordpress/config-localhost.php file and write the following lines:

sudo nano /etc/wordpress/config-localhost.php
#...................................................................................
<?php
define('DB_NAME', 'your-db-name');
define('DB_USER', 'your-user-name');
define('DB_PASSWORD', 'your-password');
define('DB_HOST', 'localhost');
define('WP_CONTENT_DIR', '/usr/share/wordpress/wp-content');
?>
#...................................................................................

(f) cd /etc/wordpress/
(g) sudo cp config-localhost.php config-yourip.php
(h) sudo service apache2 restart

No comments:

Post a Comment

Bitnami - For security reasons, this URL is only accessible using localhost (127.0.0.1) as the hostname.

For security reasons, this URL is only accessible using localhost (127.0.0.1) as the hostname. login into your server using ssh or from ...