Saturday, May 13, 2017

How to install Wordpress on Lubuntu 16.04

How to install Wordpress on Lubuntu 16.04

Wordpress is the most popular blog platform in the universe, in this article i'm going to show you how to install wordpress on local computer running lubuntu 16.04 operating system.

Wordpress is php-based blog platform/cms, therefore we need to have php and of course a web server installed on our lubuntu, also you need to have mysql database server, because wordpress is using mysql for storing data.


Step by step how to install wordpress on lubuntu 16.04
  • make sure you have apache web server installed
  • make sure you have php and mysql installed
  • make sure apache mod rewrite is enable
  • install wordpress package
  • sudo apt-get install wordpress
  • create new file called wordpress.conf
  • sudo leafpad /etc/apache2/sites-available/wordpress.conf
  • copy paste this code and save
  • 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>
    
  • run this command to enable wordpress.conf
  • sudo a2ensite wordpress
  • restart apache web server
  • sudo service apache2 reload
  • create new file called config-localhost.php
  • sudo leafpad /etc/wordpress/config-localhost.php
  • copy paste this code and save (the database name, user and password should match your own mysql configuration)
  • <?php
    define('DB_NAME', 'lubuntu_wordpress');
    define('DB_USER', 'root');
    define('DB_PASSWORD', 'entering');
    define('DB_HOST', 'localhost');
    define('WP_CONTENT_DIR', '/usr/share/wordpress/wp-content');
    ?>
  • create symbolic link for config.localhost.php
  • sudo ln -s /etc/wordpress/config-localhost.php /etc/wordpress/config-default.php
  • open url http://localhost/blog/
  • http://localhost/blog/
  • finish the wordpress installation setup (create username and password for the blog admin)
  • enjoy your new wordpress blog on http://localhost/blog/

Note :
you can go to http://localhost/blog/wp-admin/ to open the wordpress dashboard and login with username and password for the blog admin.

7 comments:

  1. This comment has been removed by a blog administrator.

    ReplyDelete
  2. Cannot create wordpress.conf. Permission denied. Even as admin.

    ReplyDelete
    Replies
    1. you need to run with sudo,
      assuming you have leafpad
      sudo leafpad /etc/apache2/sites-available/wordpress.conf

      Delete
  3. How do I get write premissions to /etc/apache2/sites/available

    ReplyDelete
  4. This comment has been removed by a blog administrator.

    ReplyDelete