Question

How to Install Wordpress in a subfolder with express app running

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


Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

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.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

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