Apache is a popular web server application you can install on the Raspberry Pi to allow it to serve web pages. On its own, Apache can serve HTML files over HTTP, and with additional modules can serve dynamic web pages using scripting languages such as PHP.

Webserver in raspberry
Webserver in raspberry

Install Apache

To install the next layer of the stack, the Apache web server, version 2, type the following command, answering “Y” when prompted to confirm.

If everything went well, you should now have a working web server. You can test this by opening a browser from another computer on your network, and navigating to the address of the Raspberry Pi. You should see a generic “It Works!” message.
Install Apache

Install MySQL

Next up is the MySQL database engine, which applications will use to store their information. Type the following to install MySQL:

You’ll be prompted multiple times during the install to provide a password for the root user. It should look like this
Install MySQL
This is not the same “root” as Linux itself. This is a MySQL database account that will own the server. Whatever password you/u assign, make sure you write it down somewhere, or put it in a password safe program. You will eventually need it.
When the installation has completed, check to see that MySQL is working by typing the following:

This says to start the MySQL command-line interface, as the Linux user “root” and log in as the MySQL user “root”, prompting for the root password.
To get a list of databases on the new MySQL server, type “show databases;” (don’t forget the semicolon). You should see a list similar to this
Install MySQL 2
Note: If you do somehow forget the semicolon (even though I specifically mentioned it), you can always type a single semicolon on a line by itself and press enter to complete the command.
Type “exit” to get out of the MySQL command line and back to the regular Linux command line. Now that MySQL is installed, there is some security configuration that needs to be done. Fortunately, a script exists that will take care of it for you. Type the following to run the script that will lock down the MySQL installation, providing the password you chose above when prompted.

If you didn’t assign the root user a password, then just hit enter when prompted for it, and “n” when prompted to set one.

Install PHP

So far you have the L, A, and M layers installed. Last up, you need PHP. Actually, you need a few different PHP components. Install them all in one shot by passing all of their names to apt-get at once like this

This installation will take a little while. I don’t have a simple test for you to verify the PHP installation, but you’ll know if it works soon enough.

https://i1.wp.com/nvtienanh.com/wp-content/uploads/2015/11/maxresdefault.jpg?fit=640%2C360https://i1.wp.com/nvtienanh.com/wp-content/uploads/2015/11/maxresdefault.jpg?resize=150%2C150Nguyễn Văn Tiến AnhBlogLinuxLAMP server,RaspberryApache is a popular web server application you can install on the Raspberry Pi to allow it to serve web pages. On its own, Apache can serve HTML files over HTTP, and with additional modules can serve dynamic web pages using scripting languages such as PHP. Install Apache To install the...Tien Anh Nguyen Van