In this project, I setup a application for serving PHP websites and applications to website visitors, using LAMP Stack which make use a Linux server, Apache, an open source software for serving web pages; as web server and MySQL as database management system.
-
Run command (sudo apt install apache2) for apache installation.
-
Verify successful installtion (run sudo systemctl status apache2).
-
run command (curl http://127.0.0.1:80 or http://localhost:80) to Check how to access the webserver locally.
Second Step: Installed mysql server
Thrid Step: Installing PHP
-
Run sudo apt install php libapache2-mod-php php-mysql to Install PHP, PHP-mysql and libapache2-mod-php.
Forth Step: Setup Apache Virtual Host for websites
-
Create and open a new configuration file (for projectlamp) in Apache’s sites-available directory.
-
Enabled the new virtual host (with sudo a2ensite projectlamp )
-
Disable default apache website, ensure config file is void of syntax error and reload Apache to save changes.
Fifth Step: Enable PHP on the website