You can open subdirectory under your html root and place WordPress/Ghost there.
By default, html root is located under
When you want to serve it from root page, you would install WP/Ghost in that directory
But if you want to serve it from /blog, like in your case, you would just create
blog folder in
/var/www/html. So you will install WP/Ghost in
In case in WordPress, after installation verify WordPress & Site addresses, by going to WP-Admin -> Settings -> General. Make sure both are
How to install WordPress on LAMP stack.
How to install WordPress on LEMP stack.
Note: In case of LAMP stack you’re using Apache, while in case of LEMP you are using nginx (engine x)
There is second possibility too. You can use subdomain, e.g.
You can saw it very frequently and it is easy to setup.
You will create new Virtual Host (or Server Block in case for nginx) and make it point to another folder, e.g.:
/var/www/blog.example.com/html, and you would place there WP/Ghost.
Learn more about it from tutorials:
How to set up Apache Virtual Hosts.
How to set up Nginx Server Blocks.
How to set up subdomain.
Note: You will use blog.example.com instead of test.com
The Apache web server is the most popular way to serve web content on the internet. Apache has the ability to serve multiple domains from a single server by using a mechanism called "virtual hosts". If a virtual host is configured correctly for each domain, the web server can correctly route traffic to the appropriate files based on the domain name requested. In this guide, we'll demonstrate how to configure Apache virtual hosts on an Ubuntu 16.04 server.