meta data for this page
Różnice
Różnice między wybraną wersją a wersją aktualną.
| Nowa wersja | Poprzednia wersja | ||
| linux:lamp [2020/08/05 08:28] – utworzono Paweł Grygorczuk | linux:lamp [2025/12/09 08:08] (aktualna) – Paweł Grygorczuk | ||
|---|---|---|---|
| Linia 6: | Linia 6: | ||
| Od wersji Debian 10 MySQL' | Od wersji Debian 10 MySQL' | ||
| <code bash> | <code bash> | ||
| - | apt-get install gnupg wget | + | apt-get install gnupg wget lsb-release |
| - | wget http:// | + | wget http:// |
| - | dpkg -i mysql-apt-config_0.8.15-1_all.deb | + | dpkg -i mysql-apt-config_0.8.36-1_all.deb |
| </ | </ | ||
| Sprawdź jakie jest najnowsze repozytorium na stronie https:// | Sprawdź jakie jest najnowsze repozytorium na stronie https:// | ||
| Linia 36: | Linia 36: | ||
| </ | </ | ||
| - | Wrzucamy pliki strony do ''/ | + | Wrzucamy pliki strony do ''/ |
| <code bash> | <code bash> | ||
| - | useradd --create-home --shell / | + | useradd --create-home --shell / |
| - | cd /home/dak | + | cd /home/page |
| - | sudo -u dak mkdir httpdocs install logs backup | + | sudo -u page mkdir httpdocs install logs backup |
| </ | </ | ||
| - | Teraz tworzymy konfigurację serwera Apache w ''/ | + | Teraz tworzymy konfigurację serwera Apache w ''/ |
| - | W CentOS wystarczy utworzyć konfigurację w ''/ | + | W CentOS wystarczy utworzyć konfigurację w ''/ |
| <code bash> | <code bash> | ||
| - | a2ensite | + | a2ensite |
| </ | </ | ||
| Linia 77: | Linia 77: | ||
| <code bash> | <code bash> | ||
| - | chown -R www-data: | + | chown -R www-data: |
| </ | </ | ||
| - | W [[MySQL]] tworzymy bazę danych dla naszej strony, przykładowo ('' | + | W [[MySQL]] tworzymy bazę danych dla naszej strony, przykładowo ('' |
| <code mysql> | <code mysql> | ||
| mysql -u root -p | mysql -u root -p | ||
| - | CREATE DATABASE IF NOT EXISTS | + | CREATE DATABASE IF NOT EXISTS |
| - | GRANT ALL PRIVILEGES ON dak.* TO 'dak' | + | GRANT ALL PRIVILEGES ON page.* TO 'page' |
| FLUSH PRIVILEGES; | FLUSH PRIVILEGES; | ||
| SELECT host, user, password FROM mysql.user ORDER BY user, host; # sprawdzenie | SELECT host, user, password FROM mysql.user ORDER BY user, host; # sprawdzenie | ||
| - | use dak; | + | use page; |
| exit; | exit; | ||
| + | </ | ||
| + | |||
| + | W sekcji '' | ||
| + | |||
| + | <code cnf> | ||
| + | default-storage-engine=InnoDB | ||
| </ | </ | ||
| ===== Przykładowa konfiguracja Apache ===== | ===== Przykładowa konfiguracja Apache ===== | ||
| - | <file apache | + | <file apache |
| < | < | ||
| - | DocumentRoot /home/dak/httpdocs | + | DocumentRoot /home/page/httpdocs |
| - | ServerName | + | ServerName |
| - | ServerAdmin | + | ServerAdmin |
| Header always set Strict-Transport-Security " | Header always set Strict-Transport-Security " | ||
| Linia 106: | Linia 112: | ||
| SSLCertificateChainFile / | SSLCertificateChainFile / | ||
| - | ErrorLog /home/dak/ | + | ErrorLog /home/page/ |
| - | CustomLog /home/dak/ | + | CustomLog /home/page/ |
| - | < | + | < |
| AddType application/ | AddType application/ | ||
| DirectoryIndex index.php index.php3 index.html | DirectoryIndex index.php index.php3 index.html | ||
| - | Options Indexes FollowSymLinks Includes ExecCGI | + | Options |
| AllowOverride All | AllowOverride All | ||
| Require all granted | Require all granted | ||
| #Require all denied | #Require all denied | ||
| - | #Require ip 10.9.5 | + | #Require ip xxx |
| </ | </ | ||
| - | |||
| - | < | ||
| - | AddType application/ | ||
| - | DirectoryIndex index.php index.php3 index.html | ||
| - | Options Indexes FollowSymLinks Includes ExecCGI | ||
| - | AllowOverride All | ||
| - | #Require all granted | ||
| - | Require all denied | ||
| - | Require ip 10.9.5 | ||
| - | Require ip 212.33.72 | ||
| - | Require ip 91.145.135.39 | ||
| - | </ | ||
| - | |||
| </ | </ | ||
| < | < | ||
| - | DocumentRoot /home/dak/httpdocs | + | DocumentRoot /home/page/httpdocs |
| - | ServerName | + | ServerName |
| - | ServerAdmin | + | ServerAdmin |
| - | Redirect permanent / https://dak.uwb.edu.pl | + | Redirect permanent / https://yourdomain.pl |
| - | ErrorLog /home/dak/ | + | ErrorLog /home/page/ |
| - | CustomLog /home/dak/ | + | CustomLog /home/page/ |
| - | < | + | < |
| AddType application/ | AddType application/ | ||
| DirectoryIndex index.php index.php3 index.html | DirectoryIndex index.php index.php3 index.html | ||
| - | Options Indexes FollowSymLinks Includes ExecCGI | + | Options |
| AllowOverride All | AllowOverride All | ||
| Require all granted | Require all granted | ||
| Linia 152: | Linia 145: | ||
| #Require not ip 212 | #Require not ip 212 | ||
| #Require all denied | #Require all denied | ||
| - | #Require ip 10.9.5 | + | #Require ip xxx |
| - | </ | + | </ |
| - | + | ||
| - | < | + | |
| - | AddType application/ | + | |
| - | DirectoryIndex index.php index.php3 index.html | + | |
| - | Options Indexes FollowSymLinks Includes ExecCGI | + | |
| - | AllowOverride All | + | |
| - | #Require all granted | + | |
| - | Require all denied | + | |
| - | Require ip 10.9.5 | + | |
| - | Require ip 212.33.72 | + | |
| - | Require ip 91.145.135.39 | + | |
| - | </ | + | |
| - | + | ||
| </ | </ | ||
| </ | </ | ||