Question

How to Install Wordpress in a subfolder with express app running

Posted April 25, 2021 233 views
WordPress

Hi guys,

I am new to digital ocean.

How can I install wordpress in subfolder like this mydomain.com/blog alongside with the express app running on the root folder. how can I setup express to understand that ’/blog’ is belong to apache web server, and how can I restrict ’/’ for the apache web server.

Thank you for any response

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

×
Submit an Answer
1 answer

Hello, @birunidev

If you’re already running the express app in the root folder of mydomain.com you can simply create a blog folder inside the root directory and then manually install WordPress inside the blog directory.

You can check the following tutorial on how to install WordPress on a LAMP stack droplet:

https://www.digitalocean.com/community/tutorials/how-to-install-wordpress-on-ubuntu-20-04-with-a-lamp-stack

You’ll need to have Apache, MySQL/MariaDB and PHP installed on the droplet in order to run WordPress so if this is not already configured you’ll need to complete the LAMP or LEMP setup before installing WordPress.

It is recommended to use a domain name to host your site/app instead of accessing them using the droplet IP address. The domain names will have a different root directory from / usually this will be /var/www/domainname.com or similar. You can configure the Apache virtual host to serve the blog subdomain from any subdirectory.

You can also check the tutorial on how to setup Apache virtual hosts:

https://www.digitalocean.com/community/tutorials/how-to-set-up-apache-virtual-hosts-on-ubuntu-18-04

Hope that this helps!
Regards,
Alex

by Lisa Tagliaferri
This tutorial will guide you through setting up multiple domains and websites using Apache virtual hosts on an Ubuntu 18.04 server. During this process, you’ll learn how to serve different content to different visitors depending on which domains they are requesting.