docs / https / lamp-install
LAMP install
APACHE INSTALL && CONFIG
textcopy
apt update && apt-get full-upgrade -ytextcopy
apt install apache2textcopy
mkdir /var/www/domain.tldtextcopy
chown -R www-data:www-data /var/www/domain.tldtextcopy
nano /etc/apache2/sites-available/domain.tld.conftextcopy<VirtualHost *:80> ServerName domain.tld ServerAlias www.domain.tld ServerAdmin webmaster@localhost DocumentRoot /var/www/domain.tld ErrorLog ${APACHE_LOG_DIR}/error.log CustomLog ${APACHE_LOG_DIR}/access.log combined </VirtualHost>
textcopy
a2ensite domain.tldtextcopy
a2dissite 000-defaulttextcopy
a2enmod headerstextcopy
systemctl reload apache2textcopy
apache2ctl configtestSyntax OK
IF
textcopy
apache2ctl configtestAH00558: apache2: Could not reliably determine the server’s fully qualified domain name, using 127.0.1.1. Set the ‘ServerName’ directive globally to suppress this message Syntax OK
THEN
textcopy
nano /etc/apache2/apache2.conf#add last line ServerName localhost
textcopy
systemctl restart apache2&& recheck
NEXT WE INSTALL CERTBOT
textcopy
apt install certbot python3-certbot-apache -ytextcopy
certbot –apache
#make sure all the domain names you are requiring certificates have rDNSMYSQL / MARIADB INSTALL && CONFIG
textcopy
apt install mariadb-server mariadb-client -ytextcopy
mysql_secure_installationtextcopy
-mariadb -u root -ptextcopy
CREATE USER ‘username’@’localhost’ IDENTIFIED BY ‘password’;textcopy
CREATE DATABASE IF NOT EXISTS nextcloud CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;textcopy
GRANT ALL PRIVILEGES ON nextcloud.* TO ‘username’@’localhost’;textcopy
FLUSH PRIVILEGES;textcopy
quit;INSTALL PHP && PHP MODULES
FOR UBUNTU :
textcopy
add-apt-repository ppa:ondrej/phptextcopy
apt updatetextcopy
apt install php8.4 php8.4-cli php8.4-mysql php8.4-fpm php8.4-gd php8.4-mbstring php8.4-xml php8.4-curl php8.4-zip php8.4-curl php8.4-cgi php8.4-xmlrpc==For DEBIAN:==
textcopy
apt-get install software-properties-commontextcopy
apt-get install -y lsb-release apt-transport-https ca-certificatestextcopy
wget -O /etc/apt/trusted.gpg.d/php.gpg https://packages.sury.org/php/apt.gpgtextcopy
echo “deb https://packages.sury.org/php/ $(lsb_release -sc) main” | sudo tee /etc/apt/sources.list.d/php.listtextcopy
apt install php8.4 php8.4-cli php8.4-mysql php8.4-fpm php8.4-gd php8.4-mbstring php8.4-xml php8.4-curl php8.4-zip php8.4-curl php8.4-cgi php8.4-xmlrpc