Install Wordpress with Magento : Multiple Website with Apache

Hi there !

I followed this tutorial to install my Magento website : How to set up a web server for Magento 2.2 (Thanks again Craig ! :slight_smile: )

I installed my Magento in this directory : var/www/html/

I tried to install a wordpress website on a subdomain : blog.example.com so I put my wordpress in var/www/html/blog. Everything seems to work great except that there is a conflict beetween my magento URL and my blog URL (redirection from my wordpress to my magento when I try to visit some pages).

So I uninstalled all and I try to install my wordpress website in var/www/blog to avoid any problem with my magento, like two independant websites.

I tried to follow this tutorial (https://www.digitalocean.com/community/tutorials/how-to-set-up-apache-virtual-hosts-on-ubuntu-16-04) but it doesn’t work with me : I have an server error on my wordpress website.

Do you have a tutorial to recommand or any tips to succeed what I want to do ?

Cheers !

I see what you’re trying to do. It might in fact be something I have to do for a project later this year. If it were me and I was installing Wordpress under a different domain e.g.

  • example.com (Magento)
  • wordpress.example.com (Wordpress)

Then I would have installed wordpress under (or something similar): /var/www/wordpress/

It doesn’t really matter what the directory is called. But I definitely wouldn’t put it inside the Magento root directory (/var/www/html/).

I would then create a new Apache Configuration file. It would need to know what anyone attempting to connect to wordpress.example.com to load the files in /var/www/wordpress/.

I would then need to check my existing Apache Configuration to ensure that it set to example.com rather than a wildcard - Otherwise this would conflict with my other Configuration File.

I don’t have a tutorial for this or any references, I’m afraid. This answer is mostly instinctual based on what I’ve done in the past. I’ve just skim read over the How To Set Up Apache Virtual Hosts on Ubuntu 16.04 you referenced and the instructions look pretty solid. If you find yourself running around in circles still, reach out to serverfault.com for Server Configuration advice/help.

Let me know how you get on.

1 Like

Thanks Craig ! This is what I though ! I will try this way in few days and tell you if it’s OK for your project :wink:

Have a good day :slight_smile:

1 Like

I’m still torn about what I want to do. I’m still weighing up the Pros and Cons of User Experience vs SEO. For example, do I want dilute my SEO in favour of installing a platform that does a job really well. Or do I want to focus hard on SEO at the expense or repurposing and micromanaging a bunch of CMS Pages. I guess my decision will come down to how heavily the Blog would get used :man_shrugging:

Anyway, good luck :slight_smile:

Same reflexion here ! My conclusion was to use both, I will use the Magento Blog for articles on product or to talk about test or comparison and the Wordpress blog will be more general about my main subject, to federate. I think it’s the better SEO option :wink:

1 Like

I would recommend using the fishpig extension that allows wordpress and magento to work together, WP as CMS. Follow his instructions and you’ll be good to go. It is a pretty easy setup once you get to his site: https://fishpig.co.uk/magento/wordpress-integration/