Published Mar 29, 2020 - Author: zgxsin
In this blog, I will talk about how to set up your personal website using WordPress step-by-step. It is oriented for those who just start building their personal website.
Here I will list the detailed steps of setting up your personal website. For me, I am using my laptop with Ubuntu 19.01 to do all the steps listed below.
For those who do not understand the domain name, please refer to this link here. However, this is not necessary if you do not want to spend too time on it. You can just go ahead to figure out how to get a domain name. There are several online providers for domain names:
One thing to notice that is you might also get a free domain name when you buy the online web hosting service, such BlueHost,which has a special offer for WordPress users. WordPress is a powerful open source software for building websites, blogs, apps and etc.. I actually use this software to write this post.
I personally choose Alibaba Cloud to buy a domain name with ''.com" suffix, which is most recognized and popular in my mind. Here is the screenshot from their website.
You just need to search your personal domain name with your chosen suffix such as ".com" and ".site" in your mind and choose one from the search result and finally pay for it. And now you have your domain name already. Regarding the price, I just payed $7.9 for a ".com" domain name for one year!
The next thing to do is to obtain a server where you can store the data of your websites and keep your website live for the most of time. Any laptop can literally act as a server. However, it is recommended to use the product from specialized hosting providers since they are more stable and oriented for this purpose. You can choose BlueHost to get both domain name and web hosting server service. I stick with Alibaba Cloud and choose their Elastic Computing Service (ECS). As a new user of their service, I have free trial period for 12 months. I install clean Ubuntu 18.04 LTS for my server, which can be easily done using their console platform.
In previous step, we have both domain name and our web hosting server. To set up a personal website, we can install a software bundle called LAMP (Linux, Apache, MySQL, PHP/Perl/Python), which is a popular example of web service stack. This can be easily done in Ubuntu systems. I follow this
to install LAMP as well as WordPress for my server. It works like a charm! Here I briefly sum the steps to be done in the server side:
# ==================================================
# Install required tools
# ==================================================
# Update software cache
sudo apt update
# Upgrade software
sudo apt upgrade
# Install zip
sudo apt install zip
# Install common software
sudo apt install software-properties-common
# ==================================================
# Install LAMP stack
# ==================================================
sudo apt-get install lamp-server^
# MYSQL database intilialization
mysql -u root -p
# Run the following commands sequentially
# Here "wordpressuser" is the user name and "wordpresspassword" is the password.
CREATE DATABASE wordpressdb;
CREATE USER wordpressuser@localhost IDENTIFIED BY 'wordpresspassword';
GRANT ALL PRIVILEGES ON wordpressdb.* TO wordpressuser@localhost;
FLUSH PRIVILEGES;
exit
# ==================================================
# Install WordPress
# ==================================================
cd /tmp
wget https://wordpress.org/latest.zip
unzip -q latest.zip -d /var/www/html/
chown -R www-data:www-data /var/www/html
chmod -R 755 /var/www/html
mkdir -p /var/www/html/wp-content/uploads
chown -R www-data:www-data /var/www/html/wp-content/uploads
# Finally, open https://your_server_ip/wordpress in your local laptop and set up and install WordPress.
Now if you type your_domain_name/wordpress (your_domain_name also includes the suffix such as .com) in your web browser, unfortunately you will see nothing meaningful, because your domain name is not understood by the internet service provider (ISP). That's why we need Domain Name Resolution to set up a correspondence between your domain name and your server's IP address. When you buy a domain name, you will be usually shown how to set up Domain Name Resolution for that.
In my case, I follow this guide to resolve my domain name. It is very easy to do!
It is almost done. After you finish the domain name resolution, you need to wait for around 10 minutes for the DNS server to recognize your domain name. Please also make sure the ports 80 and 433 of your server is open as 80 and 443 were chosen as the default HTTP and HTTPS ports. Then you type your_domain_name/wordpress in your web browser, you should see the default WordPress software homepage. Usually we should direct type your_domain_name to get this homepage.
To configure this, you first need to change the settings in WordPress. In your homepage, go to the WordPress Dashboard and find Settings->General Settings. You will find two entries called WordPress Address (URL) and Site Address (URL), please change them like the following image.
Remember to replace your actual domain name with your_domain_name.
Next, you need to run
# Copy the index.php from wordpress folder to /var/www/html
cp wordpress/index.php .
cp wordpress/.htacccess .
inside the folder /var/www/html of your server. And you need to do some modifications in index.php in /var/www/html at your server. Open index.php and find this line
and replace it with
Last step is that you need to configure Apache to load index.php instead of index.html. Please check this link to see where your Apache configuration file is located. In my case, it is located in /etc/apache2/apache2.conf. What you need to do is to edit this file and find this block inside the file
<Directory /var/www/>
Options Indexes FollowSymLinks
AllowOverride None
Require all granted
</Directory>
and change it to
<Directory /var/www/>
Options Indexes FollowSymLinks
DirectoryIndex index.php
AllowOverride ALL
Require all granted
</Directory>
Finally you need to restart apache by running
sudo service apache2 restart
Now you should visit your website by directly typing your_domain_name in your web browser.
At previous step, you can normally visit your website by your_domain_name in your browser. But your website will be marked insecure since no SSL certificate is installed for your domain name. Please check this link to understand SSL certificate based on your need. You can google online for a free certificate or buy one with a cheap price. I bought one from Taobao.com.
Here I list the steps I did to obtain and install SSL certificate for my domain name. Notice these steps might not apply to your case exactly.
Since we are using Apache web server, you just need the contents in apache folder of your SSL certificate. Please contact your SSL certificate provider for one-to-one correspondence between the files in apache folder and the file names inside the above mentioned link. With all the above steps done, you should now visit your website without pain.
If you want to move your WordPress website to a new host. Please follow this guide. After migration, if you cannot open your previous pages in the new host, please change the permanent link to plain type and try again.
Q: Can not save/update your post or pages in the default editor.
A: Try to log out WordPress and then log in again.
[thumbs-rating-buttons]