{"id":1302,"date":"2020-09-11T17:27:59","date_gmt":"2020-09-11T17:27:59","guid":{"rendered":"http:\/\/shaplakanon.com\/wpsupport\/?p=1302"},"modified":"2020-09-11T17:50:58","modified_gmt":"2020-09-11T17:50:58","slug":"how-to-install-wordpress-on-ubuntu-apache-server","status":"publish","type":"post","link":"https:\/\/shaplakanon.com\/wpsupport\/how-to-install-wordpress-on-ubuntu-apache-server\/","title":{"rendered":"How to install wordpress on ubuntu apache server"},"content":{"rendered":"\n
WordPress<\/a> is the most popular open source blogging system and CMS on the Web. It is based on PHP and MySQL. Its features can be extended with thousands of free plugins and themes.<\/p>\n\n\n\n In this tutorial we will install WordPress and show how to make a website<\/a> on Apache2 server and create your first post.<\/p>\n\n\n\n To install WordPress, use following command:<\/p>\n\n\n\n If you haven\u2019t installed MySQL before, you will be asked for password for \u201croot\u201d MySQL user. You can leave this field empty.<\/p>\n\n\n\n Create Apache site for WordPress. Create Then, enable this site with\u00a0 To configure WordPress, we need to create MySQL database. Let\u2019s do it!<\/p>\n\n\n\n Now, let\u2019s configure WordPress<\/a> to use this database. Open\u00a0 Enable MySQL with\u00a0 Open\u00a0 You can now login under You have probably noticed that \u201cHello world!\u201d post. We will delete it and write something more interesting\u2026<\/p>\n\n\n\n From Dashboard ( To create new post, click on the \u201cAdd New\u201d button. You should notice a fancy WYSIWYG editor with simple (but powerful) text formatting options. You may want to switch to Text mode, if you prefer pure HTML.<\/p>\n\n\n\n Let\u2019s write something! It\u2019s as easy, as using text processors that you know from office suites.<\/p>\n\n\n\n Now, click the Publish button. You can now view your brand new post!<\/p>\n\n\n\n Of course, this tutorial has only described basics of WordPress usage, you can do much more with this blogging platform\/CMS. You can install one of thousands of available (free and commercial) plugins and themes. You can even configure it as forum (with bbPress<\/a> plugin), microblogging platform (BuddyPress<\/a>), eCommerce platform (WooCommerce<\/a>) or extend existing WordPress features with plugins like JetPack<\/a> or TinyMCE Advanced<\/a>.<\/p>\n\n\n\nWhat you\u2019ll learn<\/h3>\n\n\n\n
How to Install WordPress<\/h2>\n\n\n\n
sudo apt update\nsudo apt install wordpress php libapache2-mod-php mysql-server php-mysql\n<\/code><\/pre>\n\n\n\n
Configure Apache for WordPress<\/h2>\n\n\n\n
\/etc\/apache2\/sites-available\/wordpress.conf<\/code> with following lines:<\/p>\n\n\n\n
Alias \/blog \/usr\/share\/wordpress\n<Directory \/usr\/share\/wordpress>\n Options FollowSymLinks\n AllowOverride Limit Options FileInfo\n DirectoryIndex index.php\n Order allow,deny\n Allow from all\n<\/Directory>\n<Directory \/usr\/share\/wordpress\/wp-content>\n Options FollowSymLinks\n Order allow,deny\n Allow from all\n<\/Directory>\n<\/code><\/pre>\n\n\n\n
sudo a2ensite wordpress<\/code>, enable URL rewriting with\u00a0
sudo a2enmod rewrite<\/code>\u00a0and reload apache2 with\u00a0
sudo service apache2 reload<\/code>.<\/p>\n\n\n\n
Configure database<\/h2>\n\n\n\n
$ sudo mysql -u root\nWelcome to the MySQL monitor. Commands end with ; or \\g.\nYour MySQL connection id is 7\nServer version: 5.7.20-0ubuntu0.16.04.1 (Ubuntu)\n\nCopyright (c) 2000, 2017, Oracle and\/or its affiliates. All rights reserved.\n\nOracle is a registered trademark of Oracle Corporation and\/or its\naffiliates. Other names may be trademarks of their respective\nowners.\n\nType 'help;' or '\\h' for help. Type '\\c' to clear the current input statement.\n\nmysql> CREATE DATABASE wordpress;\nQuery OK, 1 row affected (0,00 sec)\n\nmysql> GRANT SELECT,INSERT,UPDATE,DELETE,CREATE,DROP,ALTER\n -> ON wordpress.*\n -> TO wordpress@localhost\n -> IDENTIFIED BY '<your-password>';\nQuery OK, 1 row affected (0,00 sec)\n\nmysql> FLUSH PRIVILEGES;\nQuery OK, 1 row affected (0,00 sec)\n\nmysql> quit\nBye\n<\/code><\/pre>\n\n\n\n
\/etc\/wordpress\/config-localhost.php<\/code>\u00a0and write:<\/p>\n\n\n\n
<?php\ndefine('DB_NAME', 'wordpress');\ndefine('DB_USER', 'wordpress');\ndefine('DB_PASSWORD', '<your-password>');\ndefine('DB_HOST', 'localhost');\ndefine('DB_COLLATE', 'utf8_general_ci');\ndefine('WP_CONTENT_DIR', '\/usr\/share\/wordpress\/wp-content');\n?>\n<\/code><\/pre>\n\n\n\n
sudo service mysql start<\/code>.<\/p>\n\n\n\n
Configure WordPress<\/h2>\n\n\n\n
yourdomain.com\/blog<\/code>\u00a0in your browser. You will be asked for title of your new site, username, password and address e-mail. You can choose if you want to make your site indexed by search engines.<\/p>\n\n\n\n
<\/figure>\n\n\n\n
localhost\/blog\/wp-login.php<\/code>. In Dashboard, you will see bunch of icons and options. Don\u2019t worry, it\u2019s easy!<\/p>\n\n\n\n
<\/figure>\n\n\n\n
Write your first post<\/h2>\n\n\n\n
<\/figure>\n\n\n\n
yourdomain.com\/blog\/wp-admin\/<\/code>), select \u201cPosts\u201d icon and click on \u201cAll Posts\u201d. Mouse over the \u201cHello world!\u201d post title and select\u00a0Trash<\/strong>.<\/p>\n\n\n\n
<\/figure>\n\n\n\n
<\/figure>\n\n\n\n
That\u2019s all!<\/h2>\n\n\n\n