Share via

PHP with Multiple Domains

Jassim Al Rahma 26 Reputation points
2023-10-11T22:19:18+00:00

Hi,

I am starting with PHP on Azure and want to know the following..

I have multiple domains and i need to host them on azure. All domains they use PHP backed as (we services for my app).

What is the best way to do this on Azure and which service I should choose?

Thanks,

Jassim

Azure App Service
Azure App Service

Azure App Service is a service used to create and deploy scalable, mission-critical web apps.

0 comments No comments

1 answer

Sort by: Most helpful
  1. Dillon Silzer 60,926 Reputation points Volunteer Moderator
    2023-10-12T03:15:52.1266667+00:00

    Hi Jassim,

    A possible solution is to create an Azure Linux VM an install PHP (Apache).

    Quickstart: Create a Linux virtual machine in the Azure portal

    https://learn.microsoft.com/en-us/azure/virtual-machines/linux/quick-create-portal?tabs=ubuntu

    Install and Configure Apache

    https://ubuntu.com/tutorials/install-and-configure-apache#1-overview

    Once you have done this, you should create a vHost for each domain you want to host:

    How To Set Up Apache Virtual Hosts on Ubuntu 20.04

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

    You can create a vHost per directory you have created (meaning each directory is its own domain root). Then of course, point your DNS (domain) to the Azure VM's Public Static IP address.


    If this is helpful please accept answer.

    Was this answer helpful?


Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.