Upload VM on Azure
In this article
To upload the VHD file to Azure
To create a new Azure virtual machine
This article explains the process of uploading Magento VM on Azure.
To create a Resource Group
- In the Azure portal, search for resource groups.
- Click Add to create a new resource group.
- Complete the required details, and click Review - Create.
To create a virtual network
- In the Azure portal, search for Virtual Network.
- Click Add, and select the resource group.
- Enter the virtual network name in Name, and select the default Region.
- Click Next.
- In the IP Address tab, add the required IP addresses.
- Click Next.
- In the Security tab, select the default security.
- Click Review - Create.
- Click Subnets to assign IP to the virtual machines.
To upload the VHD file to Azure
- Download the Magento VM VHD file from here: Magento Azure VM VHD
- In the Azure portal, select Storage Accounts.
- Select the storage account to which you want to upload the .vhd file.
- If you do not have a storage account, click Add to create one.
Note: The selected storage location dictates where subsequent images can be created and deployed. - In BLOB SERVICE, select Containers.
- Select the container to which you want to upload the .vhd file.
- If you do not have a storage container, click Add Container to create one.
- Click Upload, and select the .vhd file to upload.
- Set the Blob type to Page Blob.
Note: This process may take a long time depending on your network connection and the location of your Azure storage account.
To create a new Azure virtual machine
- In Settings - Disks, click Create managed disk.
- Select the Resource group.
- Enter the disk name in the Disk name field.
- Select the Region.
- Select Source type.
- Select Source blob. Browse to the uploaded .vhd file and select the file.
- Select the OS type.
- Select the required disk size.
- Click Review - Create.
- In Settings - Disks, click Create VM.
- Select the Resource group.
- Enter the name of the virtual machine in the Virtual machine name field.
- In the Image text box, browse and select ubuntu 18.04 LTS.
- Select the required virtual machine size.
- In the Authentication type field, select Password.
- Verify the network subnets, and click Review - Create.
Magento base URL updates
-
You have to SSH into Magento, proceed to sudo nano /etc/nginx/sites-available/ls-magento.lsretail.com.conf, and remove the SSL part :
Copyserver {
listen 443 ssl;
server_name ls-magento.lsretail.com;
#sl_certificate /etc/nginx/ssl/nginx.crt;
#ssl_certificate_key /etc/nginx/ssl/nginx.key;
ssl_certificate /etc/letsencrypt/live/ls-magento.lsretail.com/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/ls-magento.lsretail.com/privkey.pem; # managed by Certbot
location / {
proxy_pass http://127.0.0.1:8080;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto https;
proxy_set_header X-Forwarded-Port 443;
proxy_set_header Host $host;
}
- Restart Nginx service: sudo service nginx restart.
- Navigate to cd/var/www/html/ls-magento.lsretail.com/, and run these commands:Copy
find . -type f -exec chmod 644 {} \;// 644 permission for files
find . -type d -exec chmod 755 {} \;// 755 permission for folders
find . -type d -exec chmod 755 {} \;// 755 permission for folders
chmod 644 ./app/etc/*.xml
chown -R :<web server group>
chmod u+x bin/magento
php bin/magento setup:store-config:set --base-url="http://yourAzureIPAddress/"
php bin/magento setup:store-config:set --base-url-secure="https://yourAzureIPAddress/"
php bin/magento admin:user:create --admin-user=lsecommerce --admin-password=@Admin0101 --admin-email=hi@test.com --admin-firstname=lsecommerce --admin-lastname=lsecommerce
php bin/magento c:f