Managed-WP.™

  • Home
  • Wordpress Tutorial
  • How to install WordPress in a traditional way and Why you should choose Managed-WP.™ PRO ?

How to install WordPress in a traditional way and Why you should choose Managed-WP.™ PRO ?

How to install WordPress in a traditional way and Why you should choose Managed-WP.™ PRO ?

If you are looking for a manual WordPress install guide on VPS/local server, please check the below steps:

Since its conception in 2003, WordPress has been one of the best and easiest ways to get a stylish site up and running. In fact, recent trends show that its popularity is just increasing. WordPress is easy to use, and hosting it yourself isn't difficult, as we'll show you in this article.

In this post, we'll show you how to host your WordPress site on Ubuntu Linux. We'll install Apache as our HTTP server, as well as PHP and MariaDB (an open source MySQL implementation), because WordPress requires them. This collection of programs is usually referred to as a LAMP stack (Linux, Apache, MySQL, PHP). After those programs are installed, we'll go over Apache and MySQL settings, including initial database and user setup, before installing WordPress. Finally, we'll teach you how to install a self-signed SSL certificate or get a free one from Let's Encrypt, allowing your site to use HTTPS.

This tutorial will teach you:

  1. Installing and configuring Apache
  2. Installing and configuring MariaDB for MySQL
  3. How to Create a WordPress MySQL User and Database
  4. How to Get and Install WordPress
  5. How to Install a Self-Signed SSL Certificate on a WordPress Site
  6. How to Setup a Let's Encrypt Free SSL Certificate

1. Installing and configuring Apache:

The first step will be to install the necessary software packages on our Ubuntu machine. WordPress can only function if we supply it with an HTTP server, PHP and its associated modules, and a MySQL database. To install Apache, PHP, and MariaDB, an open source fork of MySQL, open a terminal and enter the following commands:

$ sudo apt update
$ sudo apt install apache2 php libapache2-mod-php mariadb-server mariadb-client php-mysql php-curl php-xml php-mbstring php-imagick php-zip php-gd

This is a large number of packages to install, and they are all essential. You will not receive a perfect score in the "Site Health Status" area of the WordPress administrator dashboard unless you install some more PHP modules.

2. Installing and configuring MariaDB for MySQL:

One of the initial steps should be to prepare our WordPress database. To do so, we must first perform some basic MySQL configuration. To begin, type the following command into the terminal:

$ sudo mysql_secure_installation

Press enter after leaving the first response blank. You should answer y (yes) to the remaining prompts and set a root password when required. This setup takes only a few seconds to finish.

Although the following configuration will enough for our WordPress site, if you want to go a bit deeper, you may read our post on Install and Configure MySQL Workbench on Ubuntu Linux.

3. Create a WordPress database:

MySQL is where WordPress keeps all of its post and page content, as well as other information. With the following steps, we will create a MySQL user and database for WordPress to access:

Begin by launching MySQL as the root user:

$ sudo mysql

Make a new WordPress database. In this example, we'll call it wordpress_db, but you can call it whatever you like.

MariaDB [(none)]> CREATE DATABASE wordpress_db;

Next, we need to establish a new user that WordPress may use to access the newly formed database. In this case, we'll use the username wordpress_user and the password my_password. Replace the following text with a secure password (and save it somewhere safe):

MariaDB [(none)]> CREATE USER 'wordpress_user'@'localhost' IDENTIFIED BY 'my_password';

Then, provide the WordPress user complete access to the WordPress database:

MariaDB [(none)]> GRANT ALL PRIVILEGES ON wordpress_db.* to wordpress_user@'localhost';

Finally, save your modifications to user permissions and quit MariaDB:

MariaDB [(none)]> FLUSH PRIVILEGES;
MariaDB [(none)]> exit

4. Set up Apache:

At this point, Apache should be installed and operating, which you can confirm by opening a browser and visiting to loopback address 127.0.0.1 or just localhost on your system.

Although Apache is already hosting our site (or lack thereof), it is great practice to create a new Apache virtual host file for our WordPress installation. This will provide you greater freedom in the future if you want to host numerous websites or modify the location of the WordPress directory, for example.

Step 1: Using the following command, copy the default Apache configuration into a new file:

$ sudo cp /etc/apache2/sites-available/000-default.conf /etc/apache2/sites-available/wordpress.conf

Step 2: open this file in nano or your preferred text editor:

$ sudo nano /etc/apache2/sites-available/wordpress.conf

Step 3: Change the DocumentRoot setting to the location where we intend to install WordPress. Our recommendation is the directory listed below.

DocumentRoot /var/www/wordpress

Step 4: Create a ServerName option and input the fully qualified domain name of your website. If you don't have one, use localhost.

ServerName mydomain.com

Step 5: Also, make an alias for the www prefix. If you're only utilizing localhost, this isn't necessary.

ServerAlias www.mydomain.com

When you're through, your config file should look like this. Because we are only hosting locally, we commented out the alias line in our configuration.

Step 6: Save your modifications and then close the file. Then, in Apache, enable the site and disable the default site.

$ sudo a2ensite wordpress.conf
$ sudo a2dissite 000-default.conf

Step 7: restart Apache to have the new changes take effect.

$ sudo systemctl reload apache2

5. WordPress should be downloaded and installed.

Now that our HTTP server is configured and PHP and MySQL are up and running, we can proceed to the WordPress installation.

Step 1: use wget to get the most recent version of WordPress:

$ wget -O /tmp/wordpress.tar.gz https://wordpress.org/latest.tar.gz

第2步:提取tar归档入支目录如下:

$sudo tar-xzvf/tmp/wordpress.tar.gz -C/var/www

步骤3:确保目录及其所有文件具有必要的权限。

$sudo chown-R www-数据。www-数据/var/www pc

步骤4:我们现在可以开始设置。 打开你的网络浏览器和去localhost地址127.0.0.1或者,如果你有一个,你完全合格的域名。 WordPress设置导应该迎接你。 开始,点击"我们走"

第5步:输入数据库的信息,你先前的指定。 最后两个项目(数据库的主机和桌前缀)可以单独留在家中。 当你完成后,点击"提交"。

步骤6:自举将尝试连接的数据库,并通知你,如果它是成功的。 假设它是,继续通过点击"运行安装。"

步骤7:下面将请求一些一般信息,你的新网站。 当你完成后,点击"件"在屏幕底部完成安装。

步骤8:无安装现在是结束! 你可以开始创建内容,通过点击"记录"按钮。

步骤9:请记住,你总是可以利用的URL http://127.0.0.1/wp-admin 回到台管理小组在未来(或替换127.0.0.1与你充分合格的域名称,例如mydomain.com).

你现在应该能够访问您的支通过http://127.0.0.1 或者你完全合格的域名。

6. 设立了一个自签署SSL证书。

我们已经完成了配置我们的网站,但是它仍然利用HTTP而不是HTTPS。 有这么多的网络转移到HTTPS,您可能想要考虑它对你的网站以及,即使它不是绝对必要的。 在这部书,我们会教你如何使用自签发的证书以使SSL在你的网站上。

步骤1:为产生自签证,输入以下命令的终端。 你只是问了几个一般性问题。 确保进入你的网站IP地址或域名的"共同名称"一栏中。

$sudo openssl req-x509节点-天365-newkey rsa:2048-keyout/etc/ssl/私人/apache-selfsigned.关键出/etc/ssl/cert/apache-selfsigned.crt

第2步:我们必须作出一些调整我们的Apache网站设置。 与纳米或另一个文本编辑器,打开默认SSL配置文件:

$sudo纳米/etc/apache2/网站可用/default-ssl。conf

步骤3:改变DocumentRoot价值的位置WordPress是预先安装。 然后,修改了sslcertificatefile和SSLCertificateKeyFile值的要点的位置我们的SSL文件。

DocumentRoot /var/www/wordpress
了sslcertificatefile/etc/ssl/cert/apache-selfsigned.crt
SSLCertificateKeyFile/etc/ssl/私人/apache-selfsigned.关键

步骤4:保存修改,然后关闭该文件。 然后,对修改生效,使SSL module for Apache和重新启动:

$sudo a2enmod ssl
$sudo该重新启动apache2

Step 5: Finally, activate the SSL site that we created and restart Apache:

$ sudo a2ensite default-ssl
$ sudo systemctl reload apache2

All done. Your WordPress site is now capable of using SSL encryption:

7. Configure a Let's Encrypt free SSL certificate.

Let's Encrypt is a free service that delivers SSL certificates to websites. If you've gotten this far and set up your WordPress site on Ubuntu, there are only a few more steps to establish SSL encryption, which prevents man in the middle attacks, improves your page's SEO, and prevents browsers like Firefox from warning users that your site is insecure.

这个过程很简单并且可以完全从Ubuntu的命令行。 按照下面的步骤,以完成安装SSL证书从我们加密在你的网站上。

Step 1: Install the certbot software with the following command to enable SSL encryption with Let's Encrypt.

$ sudo apt install certbot python3-certbot-apache

Step 2: Configure the SSL certificate by running the following command and following the prompts that appear. The final question will ask if you wish to redirect HTTP queries to HTTPS. It is advised that you choose this option. Obviously, the domain must correctly point to our publicly visible server IP for this to work.

$ sudo certbot --apache

That's the end of it. The certbot utility does practically all of the heavy lifting for us, making all of the necessary adjustments to your Apache virtual host files. It will also renew your SSL certificate when it is due to expire, keeping it active.

Why you should choose Managed-WP.™ PRO?

Instead of spending hours on setting up your Ubuntu Linux OS, Apache Web server, MySQL and Install WordPress. We provide WordPress-as-a-Service and deploy fully optimized WordPress in mins. Please check the below steps and start your WordPress site in the easiest way.

Check the steps below:

Step 1: Open https://pro.managed-wp.com/dashboard

Step 2: Click "Add site"

Step 3: Enter site name, URL and required info in below.

Step 4: Select required resources.

Step 5: Finally, click "Deploy" and the WordPress will setup be completed in few mins.

Step 6: Connect Primary Domain and Enable SSL:

After you create a new WordPress site, you will see a notification bar (red color).

  1. Click it and you will see the popup to enable live domain.
  2. Update DNS record base on the info in the popup.
  3. If you are not using Cloudflare or your cannot connect successfully, please click "show DNS Rocoard without Cloudflare>>"
  4. Then click "ENABLE SSL" to generate free SSL certification for connected domain.

Step 7: (Optional) Connect Primary Domain:

  1. visit https://pro.managed-wp.com/domain
  2. Add 2nd custom domain ,enter the domain in "CUSTOM DOMAIN", then click "add"
  3. Click "List" under "Category" , and you will see all connected domains.

Tips: create your 管理-WP.™ PRO account with code “TRIAL10” and get $10 free credit now!


Popular Posts