Web server
sudo apt install acl wget curl vim git tree php php-common libapache2-mod-php \
php-cli php-fpm php-json php-pdo php-mysql php-zip php-gd php-mbstring \
php-curl php-xml php-pear php-bcmath php-cgi zip unzip certbot \
python3-certbot-apache mariadb-server
sudo a2enmod rewrite
sudo a2enmod ssl
Apache
sudo vim /etc/apache2/sites-available/000-default.conf
<VirtualHost *:80>
ServerAdmin webmaster@localhost
DocumentRoot /var/www/html
RewriteEngine on
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
<Directory /var/www/html>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
</Directory>
RewriteCond %{SERVER_NAME} =example.com [OR]
RewriteCond %{SERVER_NAME} =www.exaple.com
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
</VirtualHost>
sudo vim /etc/apache2/sites-available/default-ssl.conf
<IfModule mod_ssl.c>
<VirtualHost _default_:443>
ServerAdmin webmaster@localhost
DocumentRoot /var/www/html
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
RewriteEngine on
<Directory /var/www/html>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
</Directory>
SSLEngine on
SSLCertificateFile /etc/ssl/certs/snake-oil.crt
SSLCertificateKeyFile /etc/ssl/private/snake-oil.key
<FilesMatch "\.(cgi|shtml|phtml|php)$">
SSLOptions +StdEnvVars
</FilesMatch>
<Directory /usr/lib/cgi-bin>
SSLOptions +StdEnvVars
</Directory>
</VirtualHost>
</IfModule>
PHP
sudo php -i | grep -i "upload\_max\_filesize\|post\_max\_size\|max\_file\_uploads\|memory\_limit"
Change values in sudo vim /etc/php/7.4/apache2/php.ini
and
sudo vim /etc/php/7.4/cli/php.ini
to:
max_file_uploads => 20 => 20
post_max_size => 8M => 40M
upload_max_filesize => 2M => 30M
memory_limit=>128=>512
Certificate
openssl genrsa -out pki/private/server.key
openssl req -new -key pki/private/server.key -out pki/reqs/server.req
./easyrsa sign-req server server
bash
export OSH="$HOME/.config/oh-my-bash"; bash -c "$(curl -fsSL https://raw.githubusercontent.com/ohmybash/oh-my-bash/master/tools/install.sh)"
Node.js
Download and install
sudo su
curl -fsSL https://deb.nodesource.com/setup_18.x | bash - &&\
apt-get install -y nodejs
npm install -g npm@9.6.3
npm install --global yarn
Save, exit and reload profile
. ~/.profile
Continue reading Mastering VIM