$ sudo apt update $ sudo apt install apache2
$ sudo adduser <user> www-data $ sudo usermod -a -G www-data <user>
/var/log/apache2
if you setup log files for the virtual hosts in sub foldersModify /etc/apache2/mods-available/mpm-prefork.conf and restart apache2
$ sudo apache2ctl -V | grep MPM vim /etc/apache2/mods-available/mpm-prefork.conf MaxRequestedWorkers 400 ServerLimit 400 $ sudo service apache2 restart
$ sudo apachectl configtest
$ sudo apt update $ sudo apt install -y curl wget gnupg2 ca-certificates lsb-release apt-transport-https software-properties-common
$ echo "deb https://packages.sury.org/php/ $(lsb_release -sc) main" | sudo tee /etc/apt/sources.list.d/sury-php.list
$ wget -qO - https://packages.sury.org/php/apt.gpg | sudo apt-key add -
$ sudo apt update $ sudo apt install phpV.v
$ sudo a2enmod ssl $ sudo a2enmod proxy $ sudo a2enmod proxy_http $ sudo a2enmod rewrite
$ sudo apt install phpV.v-{bz2 curl gd mbstring mysql xml zip} phpV.v-{bcmath}
$ sudo apt install phpV.v-{bz2 curl gd mbstring mysql xml zip} phpV.v-{sqlite3}
$ sudo apt install phpV.v-mbstring
$ sudo apt install phpV.v-{curl xml zip}
$ sudo apt install phpV.v-json
$ sudo systemctl restart apache2 $ sudo service apache2 restart
sudo a2dismod phpV.v sudo a2enmod phpV.v sudo systemctl restart apache2 sudo service apache2 restart
sudo update-alternatives --set php /usr/bin/phpV.v sudo update-alternatives --set phar /usr/bin/pharV.v sudo update-alternatives --set phar.phar /usr/bin/phar.pharV.v
php -v
php -m | grep -i mysql
<?php phpinfo();?>
php --ini
max_execution_time = 120 max_input_vars = 2000 memory_limit = 512M post_max_size = 32M sys_temp_dir = "/tmp" upload_tmp_dir = "/tmp" upload_max_filesize = 16M date.timezone = Asia/Bangkok
php -i > /var/www/html/php_info.txt
sudo apt install phpV.v-dev autoconf automake
tar -xvzf xdebug-3.1.5.tgz
within a temp folder, then change to that folder, run phpize and check it's output:cd xdebug-3.1.5 phpize Configuring for: ... Zend Module Api No: 20200930 (8.0), 20210902 (8.1) Zend Extension Api No: 420200930 (8.0), 420210902 (8.1)
./configure make
sudo cp modules/xdebug.so /usr/lib/php/{20200930, 20210902}
/etc/php/{8.0, 8.1}/apache2/conf.d/99-xdebug.ini
for Xdebug 3 and add lines:zend_extension = xdebug xdebug.remote_port = 9000 (default: 9003) xdebug.mode = debug
php -m
. This lists all loaded modules. Xdebug should appear twice there (once under 'PHP Modules' and once under 'Zend Modules').export APACHE_RUN_USER=<user> export APACHE_RUN_GROUP=<user>
/etc/init.d/apache2 restart rm /var/lib/php/sessions/*
ps -ef | egrep '(httpd|apache2|apache)' | grep -v `whoami` | grep -v root | head -n1 | awk '{print $1}'
sudo chown root:<user> /var/lib/phpmyadmin/blowfish_secret.inc.php sudo chown -R <user>:<user> /var/lib/tmp sudo chown root:<user> /etc/phpmyadmin/config-db.php
takeown /F X:\FULL_PATH_TO_FOLDER takeown /F X:\FULL_PATH_TO_FOLDER /r /d y icacls X:\FULL_PATH_TO_FOLDER /grant Administrators:F icacls X:\FULL_PATH_TO_FOLDER /grant Administrators:F /t
chrome://flags/#allow-insecure-localhost
openssl req -x509 -nodes -new -sha256 -days 1024 -newkey rsa:2048 -keyout RootCA.key -out RootCA.pem -subj "/C=US/CN=Example-Root-CA" openssl x509 -outform pem -in RootCA.pem -out RootCA.crt
authorityKeyIdentifier=keyid,issuer basicConstraints=CA:FALSE keyUsage = digitalSignature, nonRepudiation, keyEncipherment, dataEncipherment subjectAltName = @alt_names [alt_names] DNS.1 = localhost DNS.2 = localhost.yourdomain.tld DNS.3 = machine1.yourdomain.tld DNS.4 = machine2.yourdomain.tld
openssl req -new -nodes -newkey rsa:2048 -keyout localhost.key -out localhost.csr -subj "/C=US/ST=YourState/L=YourCity/O=Example-Certificates/CN=localhost.local" openssl x509 -req -sha256 -days 1024 -in localhost.csr -CA RootCA.pem -CAkey RootCA.key -CAcreateserial -extfile domains.ext -out localhost.crt
SSLEngine on SSLCertificateFile "/home/user/certs/ssl/localhost.crt" SSLCertificateKeyFile "/home/user/certs/ssl/localhost.key"
openssl x509 -text < $CERT_FILE
Follow the guide Apache Server with Proxy to setup access to proxied servers.