Apache, MySQL, PHP auf Ubuntu 18.04 installieren
1. Install Apache
sudo apt update && sudo apt install apache2
2. Configure Firewall
sudo ufw allow OpenSSH
sudo ufw allow in "Apache Full"
sudo ufw enable
sudo ufw status
3. Test Apache
sudo service apache2 status
4. Install MySQL
sudo apt update && sudo apt install mysql-server
sudo service mysql status
5. MySQL Security
sudo mysql_secure_installation
-> ENTER | Y | Y | Y | Y
sudo mysqladmin -p -u root version
6. Install PHP
sudo apt update && sudo apt install php libapache2-mod-php php-mysql
php -version
7. Installing phpMyAdmin
sudo apt update && sudo apt install phpmyadmin
sudo ln -s /etc/phpmyadmin/apache.conf /etc/apache2/conf-available/phpmyadmin.conf
sudo a2enconf phpmyadmin.conf
sudo service apache2 reload
wenn du beim password probleme hast starte am besten erneut.
8. Create MySQL User
sudo mysql
CREATE USER 'newuser'@'localhost' IDENTIFIED BY 'password';
GRANT ALL PRIVILEGES ON * . * TO 'newuser'@'localhost';
FLUSH PRIVILEGES;
exit
9. Secure PhpMyAdmin
sudo nano /etc/apache2/conf-available/phpmyadmin.conf
Alias /your_url /usr/share/phpmyadmin
sudo service apache2 reload
10. Install ZIP/Unzip
sudo apt-get update
sudo apt-get install zip unzip
11. Enable .htaacess
sudo apt-get update
sudo a2enmod rewrite
sudo nano /etc/apache2/sites-enabled/000-default.conf
nach DocumentRoot /var/www/html einfügen
<Directory "/var/www/html">
AllowOverride All
</Directory>
12. Configure Apache File
sudo nano /etc/apache2/apache2.conf
Wo das untere steht von AllowOverride None auf AllowOverride all ändern
<Directory /var/www/>
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>
den unteren code unter dem oberen code nach </Directory> eingeben
<Directory /var/www/html>
Options -Indexes
</Directory>
Den unteren Code ganz unten eingeben
ServerSignature Off
ServerTokens Prod
13. Install CURL
sudo apt-get install curl
sudo service apache2 restart
sudo apt-get install php7.2-curl
sudo service apache2 restart
14. install SSL Certificate
sudo apt-get update
sudo add-apt-repository ppa:certbot/certbot
sudo apt-get update
sudo apt-get install python-certbot-apache
sudo apachectl stop
letsenletsencrypt –authenticator standalone –installer apache -d example.com
sudo service apache2 start
service apache2 restart