Use Raspberry Pi to build your own web server (I) install LAMP and raspberry lamp
1. Adjust pi GPU memoryOccupiedSize
As a web server, you do not need to output video signals. Therefore, reduce GPU memory usage to maximize pi performance.
1 sudo raspi-config
Select Advanced Options-> Memory Split, enter 16, and restart after saving.
2. Update your pi
1 sudo apt-get update2 sudo apt-get upgrade
Restart the instance after the update is completed.
3. Install server software
Install the most commonly used LAMP, namely Linux, Apache, MySql, and PHP.
3.1 install Apache and PHP
1 sudo apt-get install apache2 php5 libapache2-mod-php5
3.2 install MySql (set the Database Password during installation)
1 sudo apt-get install mysql-server mysql-client php5-mysql
3.3 After installation, restart apache.
1 sudo service apache2 restart
4. Test
After all the required software is installed, the server is basically set up. In this case, open your browser and enter 127.0.0.1 to see a page like this:
The root directory of the website is/var/www/html by default.