Home > other >  How to rapidly build stand-alone version in the Azure Linux virtual machine LAMP web site
How to rapidly build stand-alone version in the Azure Linux virtual machine LAMP web site

Time:09-21

LAMP usually indicates the Linux + Apache + + Perl/PHP/MySQL/MariaDB Python, the components of the LAMP is not a constant, is not confined to its initial choice, as a solution suite, LAMP is very suitable for building dynamic web sites and web applications, using other components like the Zabbix do monitoring are essential to the website, if you want to get a better reading experience, here is the portal,

Install the LAMP

The LAMP of this document for Linux + Apache2 + MySQL + php5 and each sample procedure based on Linux virtual machine Azure environment, this document introduces three ways to install the LAMP: 1. Use the Azure PowerShell script; 2. Use the Azure CLI; 3. Use a SHELL script, install the LAMP on the virtual machine automatically in the process of installation of Zabbix agent,

Description:
The Azure PowerShell scripts and Azure CLI way only support CentOS (6.5, 6.6, 6.7, 7.0, 7.1, 7.2), while a SHELL script with CentOS, Ubuntu and SLES three versions,
Parameters using note:
DNSNamePrefix: must be lowercase, need to guarantee uniqueness, this parameter will be used as DNS prefix,
ZabbixServerIPAddress: options, specify the Zabbix server address,

Azure PowerShell way
PowerShell scripts run notice:
Need administrator privileges to run the PowerShell, before it can be used to run the following command:
 Set - ExecutionPolicy - ExecutionPolicy Unrestricted 

If you choose to Azure PowerShell way to install the LAMP, so please refer to how to install and configure Azure PowerShell the instructions in the installation on the local computer Azure PowerShell, then open the Azure PowerShell command prompt, run the following command and follow the prompts to Azure account login interactive experience, to use the work or school ID login:
 Login - AzureRmAccount - EnvironmentName AzureChinaCloud 

Then you need to create an Azure Resource Group (the Resource Group), and create the Azure virtual machine and install the LAMP in the Resource Group, run the following command to create Azure Resource Group:
 New AzureRmResourceGroup - Name "YOUR - RESOURCE - GROUP - the Name" - the Location "China East" 

You need to download single PowerShell script - lamp - deploy. Ps1, according to the following sample run single - lamp - deploy. Ps1 scripts that can be generated in the resource group rg1 a CentOS virtual machine, then install the lamp in the virtual machine, including rg1 is created in the previous step resource group name,
 PS C: \ & gt; ., single - lamp - deploy. Ps1 - ResourceGroupName rg1-7.0 AdminUserName CentOSVersion azureuser - AdminPassword "YOUR PASSWORD -" - MySqlPassword "YOUR MYSQL - PASSWORD" - DNSNamePrefix "YOUR - DNS - the PREFIX" 

Creation process takes about 20 minutes, after the success of the operation will appear the following tips, here we go to visit the web site under the step directly validate,
 Deploy LAMP Server successfully. 
The To veriy the lamp server deployment, following below steps:
Open the URL http:// . Chinaeast. Cloudapp. Chinacloudapi. Cn/mysql, PHP to check if PHP can connect to the mysql, if can do some insert operation, and finally it will return the result on the web page.
If you refresh the webpage, will insert another record into the mysql db table.
We strongly how you to delete the/var/WWW/HTML/mysql, PHP after you access the URL and see the successful result because mysql, PHP stores your mysql root password.
You can delete the inserted data by executing below commands:
Mysql - uroot - p
The drop database testdb;


more building, can use here to continue reading ,
  • Related