Difference between revisions of "WebServer - Basic LAMP Stack Install"
Jump to navigation
Jump to search
| (3 intermediate revisions by the same user not shown) | |||
| Line 52: | Line 52: | ||
*<code>sudo apt install apache2 libapache2-mod-php php-xml php-mbstring php-apcu php-intl imagemagick inkscape php-gd php-cli php-cgi php mysql-server mysql-client php-mysql</code> | *<code>sudo apt install apache2 libapache2-mod-php php-xml php-mbstring php-apcu php-intl imagemagick inkscape php-gd php-cli php-cgi php mysql-server mysql-client php-mysql</code> | ||
OR: | |||
*<code>sudo apt install apache2 libapache2-mod-php php-xml php-mbstring php-apcu php-intl imagemagick inkscape php-gd php-cli php-cgi php mariadb-server mariadb-client php-mysql</code> | |||
* <span style="color: rgb(22, 145, 121);">If you are using a separate database server:</span> | * <span style="color: rgb(22, 145, 121);">If you are using a separate database server:</span> | ||
**<code><span style="color: rgb(22, 145, 121);">sudo apt install apache2 libapache2-mod-php php-xml php-mbstring php-apcu php-intl imagemagick inkscape php-gd php-cli php-cgi php mysql-client php-mysql</span></code> | **<code><span style="color: rgb(22, 145, 121);">sudo apt install apache2 libapache2-mod-php php-xml php-mbstring php-apcu php-intl imagemagick inkscape php-gd php-cli php-cgi php mysql-client php-mysql</span></code> | ||
| Line 62: | Line 65: | ||
<span style="color: rgb(255, 0, 0);">'''[[Now Do A Backup!{{!}}Now Do A Backup!]]'''</span> | <span style="color: rgb(255, 0, 0);">'''[[Now Do A Backup!{{!}}Now Do A Backup!]]'''</span> | ||
==== Configure MySQL ==== | ==== Configure MySQL (MariaDB) ==== | ||
*<code>sudo mysql_secure_installation</code> | *<span style="text-decoration: line-through;"><code>sudo mysql_secure_installation</code></span> | ||
*<code>sudo mariadb-secure-installation</code> # The sequence following is changed somewhat... (WIP) | |||
**<u>Would you like to setup VALIDATE PASSWORD component?</u> | **<u>Would you like to setup VALIDATE PASSWORD component?</u> | ||
***I select <span style="color: rgb(22, 145, 121);">No</span> (because I'd rather manage my own password policies, thanks...) | ***I select <span style="color: rgb(22, 145, 121);">No</span> (because I'd rather manage my own password policies, thanks...) | ||
| Line 87: | Line 91: | ||
*<code>sudo vi /var/www/html/info.php</code> | *<code>sudo vi /var/www/html/info.php</code> | ||
<pre><nowiki> | <pre><nowiki> | ||
<?php | |||
phpinfo(); | |||
?> | |||
</nowiki></pre> | </nowiki></pre> | ||
Latest revision as of 13:18, 12 September 2025
| 11 (bullseye) |
| |
| 4 |
| |
| 19.3 / 20.3 |
| |
| 20.04.3 |
| |
| 5.11 |
|
As always...
Start with:
sudo apt updatesudo apt upgrade
Install the LAMP Stack
- If you are running Mint 19.3
- If you are running a Debian based Linux
Install the packages
Big change(s) incomming...
Likely fully replacing MySQL with MariaDB.
(Really, boils down to replacing mysql-server & mysql-client with mariadb-server & mariadb-client in the next command...)
sudo apt install apache2 libapache2-mod-php php-xml php-mbstring php-apcu php-intl imagemagick inkscape php-gd php-cli php-cgi php mysql-server mysql-client php-mysql
OR:
sudo apt install apache2 libapache2-mod-php php-xml php-mbstring php-apcu php-intl imagemagick inkscape php-gd php-cli php-cgi php mariadb-server mariadb-client php-mysql
- If you are using a separate database server:
sudo apt install apache2 libapache2-mod-php php-xml php-mbstring php-apcu php-intl imagemagick inkscape php-gd php-cli php-cgi php mysql-client php-mysql- & skip any reference to configuring mysql server
- Say Yes to Continue
- Configuring mysql-community-server (Doesn't happen on Mint but DOES happen on LMDE)
- Pick a good root password...
- I tend to select Use Legacy Authentication Method because Use Strong Password Encryption is annoying as hell. (Your choice here...)
- Configuring mysql-community-server (Doesn't happen on Mint but DOES happen on LMDE)
Configure MySQL (MariaDB)
sudo mysql_secure_installationsudo mariadb-secure-installation# The sequence following is changed somewhat... (WIP)- Would you like to setup VALIDATE PASSWORD component?
- I select No (because I'd rather manage my own password policies, thanks...)
- root password
- Please set the password for root here.
- Pick a good root password...
- Please set the password for root here.
- or... (depends on install...)
- Using existing password for root.
- Say No (Which actually means yes... The question being asked is "Change the password for root?")
- Using existing password for root.
- Remove anonymous users?
- Duh... Yes
- Disallow root login remotely?
- Your choice, but I tend to say No.
- Remove test database and access to it?
- Duh... Yes again.
- Reload privilege tables now?
- Yes
- Would you like to setup VALIDATE PASSWORD component?
- (Extra Instructions if you've never configured MySQL before)
& Test it
sudo vi /var/www/html/info.php
<?php phpinfo(); ?>
Browse to http://ServerAddress/ & you should see the default page.
Browse to http://ServerAddress/info.php & you should see a whole bunch of info about your PHP subsystem.
Notice that those 2 addresses are HTTP, and NOT HTTPS. This is important and Chrome will mess with you.
Set up at least one user in mysql
sudo mysql -u root -p
CREATE USER 'USERNAME'@'localhost' IDENTIFIED BY 'PASSWORD'; FLUSH PRIVILEGES; EXIT;
(Hint: This'd be a good time to create yourself as that user with your non-admin password of choice...)