{"id":1041,"date":"2022-10-15T14:48:43","date_gmt":"2022-10-15T08:48:43","guid":{"rendered":"https:\/\/staging.arifbillah.com\/new\/?p=1041"},"modified":"2022-10-15T14:48:43","modified_gmt":"2022-10-15T08:48:43","slug":"how-to-install-wordpress-in-ubuntu-server","status":"publish","type":"post","link":"https:\/\/arifbillah.com\/?p=1041","title":{"rendered":"How to install WordPress in ubuntu server"},"content":{"rendered":"\n<ol class=\"wp-block-list\">\n<li><strong>Install Apache<br \/><\/strong>sudo apt update &amp;&amp; sudo apt upgrade -y<br \/>sudo apt install apache2 -y<\/li>\n\n\n\n<li><strong>Install PHP<\/strong><\/li>\n<\/ol>\n\n\n\n<h6 class=\"wp-block-heading\">sudo apt install php libapache2-mod-php php-mysql -y<\/h6>\n\n\n\n<h6 class=\"wp-block-heading\"><strong>MARIA DB Installation<\/strong><\/h6>\n\n\n\n<p class=\"wp-block-paragraph\">MYSQL<br \/>sudo apt install mysql-server -y<br \/>sudo mysql_secure_installation<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">sudo apt install mariadb-server<br \/>sudo mysql_secure_installation<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>if show errors, when you install database. if sucessfully install then flow next section &#8220;database create&#8221;  <\/strong><br \/>solved it by running &#8220;$sudo mysql&#8221;<br \/>which logged me in as root without a password, then I ran<br \/>$ALTER USER &#8216;root&#8217;@&#8217;localhost&#8217; IDENTIFIED WITH mysql_native_password by &#8216;mynewpassword&#8217;;<br \/>$ALTER USER &#8216;root&#8217;@&#8217;localhost&#8217; IDENTIFIED WITH mysql_native_password by &#8216;4Hxla]h!@\/8gjEWY&#8217;;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Database create<\/strong><br \/>sudo mysql -u root -p<br \/>CREATE DATABASE wpdb DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci;<br \/>CREATE USER &#8216;wpuser&#8217;@&#8217;localhost&#8217; IDENTIFIED BY &#8216;BNlerp4@38%4o^G7&#8217;;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">mysql&gt; CREATE DATABASE wpdb;<br \/>mysql&gt; CREATE USER &#8216;wpuser&#8217;@&#8217;localhost&#8217; IDENTIFIED BY &#8216;BNlerp4@38%4o^G7&#8217;;<br \/>mysql&gt; GRANT ALL ON wpdb.* TO &#8216;wpuser&#8217;@&#8217;localhost&#8217;;<br \/>mysql&gt; FLUSH PRIVILEGES;<br \/>mysql&gt; EXIT;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><br \/><strong>Flow the command for a single website. For multi websites follow the next section command<br \/><\/strong>cd \/var\/www\/html<br \/>sudo wget http:\/\/wordpress.org\/latest.tar.gz<br \/>sudo tar xzf latest.tar.gz<br \/>sudo mv wordpress\/* .<br \/>sudo chown -R www-data: .<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">cp wp-config-sample.php wp-config.php<br \/>nano wp-config.php<br \/>sudo systemctl reload apache2<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<p class=\"has-ast-global-color-3-color has-text-color wp-block-paragraph\"><strong>Follow the command for 2+ websites===Ignore this command, if you want to configure a single website.========================<br \/><\/strong>No:1# WordPress<br \/>cd \/var\/www<br \/>sudo mkdir site1<br \/>cd site1<br \/>sudo wget http:\/\/wordpress.org\/latest.tar.gz<br \/>sudo tar xzf latest.tar.gz<br \/>sudo mv wordpress\/* .<br \/>sudo chown -R www-data: .<br \/>3.3 Apache configuration<br \/>cd \/etc\/apache2\/sites-available\/<br \/>sudo cp 000-default.conf site1.conf<br \/>nano site1.conf<br \/>ServerName netvnsite1.tk<br \/>ServerAlias www.netvn.site1.tk<br \/>DocumentRoot \/var\/www\/site1<br \/>a2ensite site1.conf<br \/>a2dissite 000-default.conf<br \/>systemctl reload apache2<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>4.2 WordPress<\/strong><br \/>cd \/var\/www<br \/>sudo mkdir site2<br \/>cd site2<br \/>sudo wget http:\/\/wordpress.org\/latest.tar.gz<br \/>sudo tar xzf latest.tar.gz<br \/>sudo mv wordpress\/* .<br \/>sudo chown -R www-data: .<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>4.3 Apache configuration<\/strong><br \/>cd \/etc\/apache2\/sites-available\/<br \/>sudo cp 000-default.conf site2.conf<br \/>sudo nano site2.conf<br \/>ServerName netvnsite2.tk<br \/>ServerAlias www.netvnsite2.tk<br \/>DocumentRoot \/var\/www\/site2<br \/>sudo a2ensite site2.conf<br \/>sudo systemctl reload apache2<\/p>\n\n\n\n<ol class=\"wp-block-list\" start=\"5\">\n<li><strong>Port Forwarding<\/strong><br \/>80,443<br \/>ufw allow 80<br \/>ufw allow 443<br \/>============================================ssl=========================<\/li>\n\n\n\n<li><strong>HTTPS<br \/><\/strong>sudo apt install python3-certbot-apache -y<br \/>sudo certbot &#8211;apache -d -d <a href=\"http:\/\/www.domain\" target=\"_blank\" rel=\"noopener\">www.domain<\/a><br \/>sudo certbot &#8211;apache -d huskyfurniture.com -d www.huskyfurniture.com<\/li>\n<\/ol>\n\n\n\n<p class=\"has-luminous-vivid-orange-color has-text-color wp-block-paragraph\">Congratulations! we prepare a complete web configuration<\/p>\n","protected":false},"excerpt":{"rendered":"<p>sudo apt install php libapache2-mod-php php-mysql -y MARIA DB Installation MYSQLsudo apt install mysql-server -ysudo mysql_secure_installation sudo apt install mariadb-serversudo mysql_secure_installation if show errors, when you install database. if sucessfully install then flow next section &#8220;database create&#8221; solved it by running &#8220;$sudo mysql&#8221;which logged me in as root without a password, then I ran$ALTER USER [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":3199,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[115,117,127,119,121],"tags":[],"class_list":["post-1041","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-apache","category-aws","category-ubuntu","category-website","category-wordpress"],"_links":{"self":[{"href":"https:\/\/arifbillah.com\/index.php?rest_route=\/wp\/v2\/posts\/1041","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/arifbillah.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/arifbillah.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/arifbillah.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/arifbillah.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1041"}],"version-history":[{"count":0,"href":"https:\/\/arifbillah.com\/index.php?rest_route=\/wp\/v2\/posts\/1041\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/arifbillah.com\/index.php?rest_route=\/wp\/v2\/media\/3199"}],"wp:attachment":[{"href":"https:\/\/arifbillah.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1041"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/arifbillah.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1041"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/arifbillah.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1041"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}