- Google Cloud Platform for Architects
- Vitthal Srinivasan Janani Ravi Judy Raj
- 170字
- 2021-06-25 20:48:33
Deploying LAMP stack using GCE
Let's explore how we would set up a LAMP stack on a VM instance. LAMP is a stack of Linux, Apache, MySQL, and PHP:
- Connect to your Linux VM instance using SSH and update it. We will follow Debian 9 commands throughout this example:
sudo apt-get update
- Install Apache 2's PHP module:
sudo apt-get install libapache2-mod-php php
- To test the installation, enter your external IP address and you should see the Apache test page. You can copy the external IP from the list on the console page of VM instances. It should show the Apache starting page:
http://[EXTERNAL_IP]

- To verify that PHP and Apache are working together, edit the phpinfo.php file and access it with your VM instance external IP:
sudo sh -c 'echo "[YOUR_PHP_CODE]" > /var/www/html/phpinfo.php' http://[YOUR_EXTERNAL_IP_ADDRESS]/phpinfo.php
- If it fails, you will receive a 404 error.
- Finally, to install MySQL and relevant components, use the following command:
sudo apt-get install mysql-server php5-mysql php-pear
- You now have a complete Linux, Apache, MySQL, PHP (LAMP) stack.
推薦閱讀
- 在你身邊為你設(shè)計(jì)Ⅲ:騰訊服務(wù)設(shè)計(jì)思維與實(shí)戰(zhàn)
- 正則表達(dá)式必知必會(huì)
- InfluxDB原理與實(shí)戰(zhàn)
- 云計(jì)算服務(wù)保障體系
- iOS and OS X Network Programming Cookbook
- Hadoop大數(shù)據(jù)實(shí)戰(zhàn)權(quán)威指南(第2版)
- 數(shù)據(jù)驅(qū)動(dòng):從方法到實(shí)踐
- INSTANT Cytoscape Complex Network Analysis How-to
- 跟老男孩學(xué)Linux運(yùn)維:MySQL入門(mén)與提高實(shí)踐
- 數(shù)字媒體交互設(shè)計(jì)(初級(jí)):Web產(chǎn)品交互設(shè)計(jì)方法與案例
- “互聯(lián)網(wǎng)+”時(shí)代立體化計(jì)算機(jī)組
- SQL優(yōu)化最佳實(shí)踐:構(gòu)建高效率Oracle數(shù)據(jù)庫(kù)的方法與技巧
- LabVIEW 完全自學(xué)手冊(cè)
- 大數(shù)據(jù)精準(zhǔn)挖掘
- 數(shù)字IC設(shè)計(jì)入門(mén)(微課視頻版)