Apache, MySQL,PHP
Instalace:
sudo apt update
sudo apt install apache2
sudo ufw app list sudo ufw allow in "Apache"
sudo ufw status
http://your_server_ip(localhost)
sudo apt install mysql-server
sudo mysql
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'password';
exit
sudo mysql_secure_installation
VALIDATE PASSWORD PLUGIN can be used to test passwords
and improve security. It checks the strength of password
and allows the users to set only those passwords which are
secure enough. Would you like to setup VALIDATE PASSWORD plugin?
Press y|Y for Yes, any other key for No: Y
There are three levels of password validation policy:
LOW Length >= 8
MEDIUM Length >= 8, numeric, mixed case, and special characters
STRONG Length >= 8, numeric, mixed case, special characters and dictionary file
Please enter 0 = LOW, 1 = MEDIUM and 2 = STRONG: 1
Spustit s Apache2 jako virtual host
# /etc/apache2/conf.d/example.com.conf
<virtualhost *:80>
ServerName example.com
ServerAlias www.example.com
# Uncomment the following line to force Apache to pass the Authorization
# header to PHP: required for "basic_auth" under PHP-FPM and FastCGI
#
# SetEnvIfNoCase ^Authorization$ "(.+)" HTTP_AUTHORIZATION=$1
DocumentRoot /var/www/project/public
<directory /var/www/project/public>
AllowOverride None
Require all granted
FallbackResource /index.php
</directory>
# uncomment the following lines if you install assets as symlinks
# or run into problems when compiling LESS/Sass/CoffeeScript assets
# <directory /var/www/project>
# Options FollowSymlinks
# </directory>
ErrorLog /var/log/apache2/project_error.log
CustomLog /var/log/apache2/project_access.log combined
</virtualhost>
Zbytek nastavení v How To Install Linux, Apache, MySQL, PHP (LAMP) Stack on Ubuntu | DigitalOcean
Instalace PHP verze, FPM a modulů
sudo LC_ALL=C.UTF-8 add-apt-repository ppa:ondrej/php # Press enter to confirm.
sudo apt update
apt install php8.4 php7.4 php8.2
apt install php7.4-fpm php8.4-fpm php8.2-fpm
sudo apt install php7.4-cli libapache2-mod-php7.4
sudo apt install php8.2-cli libapache2-mod-php8.2
sudo apt install php8.4-cli libapache2-mod-php8.4
a2enmod proxy_fcgi setenvif
a2enconf php7.4-fpm
a2enconf php8.2-fpm
a2enconf php8.4-fpm
systemctl reload apache2
sudo apt install php4.4-common php7.4-{apcu,imagick,mcrypt,bcmath,bz2,intl,mysql,curl,gd,gmp,intl,mbstring,opcache,readline,xml,xmlwriter,soap,gettext,iconv,zip,xdebug,dom,dev,tokenizer,xlswriter}
sudo apt install php8.2-common php8.2-{apcu,imagick,mcrypt,bcmath,bz2,intl,mysql,curl,gd,gmp,intl,mbstring,opcache,readline,xml,xmlwriter,soap,gettext,iconv,zip,xdebug,dom,dev,tokenizer,xlswriter}
sudo apt install php8.4-common php8.4-{apcu,imagick,mcrypt,bcmath,bz2,intl,mysql,curl,gd,gmp,intl,mbstring,opcache,readline,xml,xmlwriter,soap,gettext,iconv,zip,xdebug,dom,dev,tokenizer,xlswriter}
php -v
sudo systemctl status php8.4-fpm
sudo a2enconf php8.4-fpm
sudo a2dismod php8.3 # Change to the current PHP version
sudo a2enmod php8.4
Instalace NodeJS
https://www.digitalocean.com/community/tutorials/how-to-install-node-js-on-ubuntu-22-04
Instalace Symfony CLI
curl -1sLf ‚https://dl.cloudsmith.io/public/symfony/stable/setup.deb.sh‘ | sudo -E bash
sudo apt install symfony-cli
Instalace a nastavení GIT
# apt-get install git
For Ubuntu, this PPA provides the latest stable upstream Git version
# add-apt-repository ppa:git-core/ppa
# apt update; apt install git
Git Client (desktop app nepotřebujeme budeme fungovat s VSCode ,nebo z terminalu)
Nastavení:
git config list (seznam nastavení)
git config –global user.name „Your Name“ (jmeno na gitHub)
git config –global user.email „user@example.com“
Instalace Composer
Apt-get install composer
Instalace VSCode IDE
sudo snap install –classic code # or code-insiders
Instalace yarn
sudo apt install curl gnupg -y
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
sudo apt update
sudo apt install yarn
yarn --version