meta data for this page
  •  

Różnice

Różnice między wybraną wersją a wersją aktualną.

Odnośnik do tego porównania

Nowa wersja
Poprzednia wersja
linux:lamp [2020/08/05 08:28] – utworzono Paweł Grygorczuklinux:lamp [2025/12/09 08:08] (aktualna) Paweł Grygorczuk
Linia 6: Linia 6:
 Od wersji Debian 10 MySQL'a nie ma w standardowym repozytorium. Dodanie repozytorium: Od wersji Debian 10 MySQL'a nie ma w standardowym repozytorium. Dodanie repozytorium:
 <code bash> <code bash>
-apt-get install gnupg wget +apt-get install gnupg wget lsb-release 
-wget http://repo.mysql.com/mysql-apt-config_0.8.15-1_all.deb +wget http://repo.mysql.com/mysql-apt-config_0.8.36-1_all.deb 
-dpkg -i mysql-apt-config_0.8.15-1_all.deb+dpkg -i mysql-apt-config_0.8.36-1_all.deb
 </code> </code>
 Sprawdź jakie jest najnowsze repozytorium na stronie https://dev.mysql.com/downloads/repo/apt/. Sprawdź jakie jest najnowsze repozytorium na stronie https://dev.mysql.com/downloads/repo/apt/.
Linia 36: Linia 36:
 </WRAP> </WRAP>
  
-Wrzucamy pliki strony do ''/home/dak/httpdocs/'', gdzie ''dak'' to nazwa [[linux:użytkownicy|użytkownika]] (zamień wszędzie na swoją stosowną nazwę).+Wrzucamy pliki strony do ''/home/page/httpdocs/'', gdzie ''page'' to nazwa [[linux:użytkownicy|użytkownika]] (zamień wszędzie na swoją stosowną nazwę).
  
 <code bash> <code bash>
-useradd --create-home --shell /bin/bash dak +useradd --create-home --shell /bin/bash page 
-cd /home/dak +cd /home/page 
-sudo -u dak mkdir httpdocs install logs backup+sudo -u page mkdir httpdocs install logs backup
 </code> </code>
  
-Teraz tworzymy konfigurację serwera Apache w ''/etc/apache2/sites-available'', np. ''/etc/apache2/sites-available/dak.conf'' (patrz [[lamp#przykladowa-konfiguracja-apache|Przykładowa konfiguracja Apache]]). +Teraz tworzymy konfigurację serwera Apache w ''/etc/apache2/sites-available'', np. ''/etc/apache2/sites-available/page.conf'' (patrz [[lamp#przykladowa-konfiguracja-apache|Przykładowa konfiguracja Apache]]). 
-W CentOS wystarczy utworzyć konfigurację w ''/etc/httpd/conf.d/dak.conf'' - zostanie ona automatycznie zainkludowana.+W CentOS wystarczy utworzyć konfigurację w ''/etc/httpd/conf.d/page.conf'' - zostanie ona automatycznie zainkludowana.
  
 <code bash> <code bash>
-a2ensite dak+a2ensite page
 </code> </code>
  
Linia 77: Linia 77:
  
 <code bash> <code bash>
-chown -R www-data:www-data /home/dak/httpdocs/ # W CentOS użytkownik ten nazywa się apache+chown -R www-data:www-data /home/page/httpdocs/ # W CentOS użytkownik ten nazywa się apache
 </code> </code>
  
-W [[MySQL]] tworzymy bazę danych dla naszej strony, przykładowo (''dak'' to nazwa naszej bazy):+W [[MySQL]] tworzymy bazę danych dla naszej strony, przykładowo (''page'' to nazwa naszej bazy):
  
 <code mysql> <code mysql>
 mysql -u root -p mysql -u root -p
-CREATE DATABASE IF NOT EXISTS dak CHARACTER SET 'utf8' COLLATE utf8_polish_ci; +CREATE DATABASE IF NOT EXISTS page CHARACTER SET 'utf8' COLLATE utf8_polish_ci; 
-GRANT ALL PRIVILEGES ON dak.* TO 'dak'@'localhost' IDENTIFIED BY 'dak';+GRANT ALL PRIVILEGES ON page.* TO 'page'@'localhost' IDENTIFIED BY 'xxx';
 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;
 +</code>
 +
 +W sekcji ''[mysqld]'' dopisujemy do ''/etc/mysql/mysql.conf.d/mysqld.cnf'':
 +
 +<code cnf>
 +default-storage-engine=InnoDB
 </code> </code>
  
 ===== Przykładowa konfiguracja Apache ===== ===== Przykładowa konfiguracja Apache =====
  
-<file apache dak.conf>+<file apache page.conf>
 <VirtualHost *:443> <VirtualHost *:443>
- DocumentRoot /home/dak/httpdocs + DocumentRoot /home/page/httpdocs 
- ServerName dak.uwb.edu.pl + ServerName yourdomain.pl 
- ServerAdmin p.grygorczuk@uwb.edu.pl+ ServerAdmin youremail@yourdomain.pl
  Header always set Strict-Transport-Security "max-age=63072000; includeSubdomains;"  Header always set Strict-Transport-Security "max-age=63072000; includeSubdomains;"
   
Linia 106: Linia 112:
  SSLCertificateChainFile /etc/apache2/ssl/certs/chain.crt  SSLCertificateChainFile /etc/apache2/ssl/certs/chain.crt
   
- ErrorLog /home/dak/logs/ssl_error.log + ErrorLog /home/page/logs/ssl_error.log 
- CustomLog /home/dak/logs/ssl_access.log combined+ CustomLog /home/page/logs/ssl_access.log combined
   
- <Directory /home/dak/httpdocs>+ <Directory /home/page/httpdocs>
  AddType application/x-httpd-php .php .php3 .php4 .inc  AddType application/x-httpd-php .php .php3 .php4 .inc
  DirectoryIndex index.php index.php3 index.html  DirectoryIndex index.php index.php3 index.html
- Options Indexes FollowSymLinks Includes ExecCGI+ Options -Indexes +FollowSymLinks +Includes -ExecCGI
  AllowOverride All  AllowOverride All
  Require all granted  Require all granted
  #Require all denied  #Require all denied
- #Require ip 10.9.5+ #Require ip xxx
  </Directory>  </Directory>
-  
- <Directory /home/wiki-dak/httpdocs/docs> 
- AddType application/x-httpd-php .php .php3 .php4 .inc 
- 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 
- </Directory> 
-  
 </VirtualHost> </VirtualHost>
  
  
 <VirtualHost *:80> <VirtualHost *:80>
- DocumentRoot /home/dak/httpdocs + DocumentRoot /home/page/httpdocs 
- ServerName dak.uwb.edu.pl + ServerName yourdomain.pl 
- ServerAdmin p.grygorczuk@uwb.edu.pl + ServerAdmin youremail@yourdomain.pl 
- Redirect permanent / https://dak.uwb.edu.pl+ Redirect permanent / https://yourdomain.pl
  
- ErrorLog /home/dak/logs/error.log + ErrorLog /home/page/logs/error.log 
- CustomLog /home/dak/logs/access.log combined+ CustomLog /home/page/logs/access.log combined
   
- <Directory /home/dak/httpdocs>+ <Directory /home/page/httpdocs>
  AddType application/x-httpd-php .php .php3 .php4 .inc  AddType application/x-httpd-php .php .php3 .php4 .inc
  DirectoryIndex index.php index.php3 index.html  DirectoryIndex index.php index.php3 index.html
- Options Indexes FollowSymLinks Includes ExecCGI+ Options -Indexes +FollowSymLinks +Includes -ExecCGI
  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 
- </Directory> + </Directory>
-  +
- <Directory /home/wiki-dak/httpdocs/docs> +
- AddType application/x-httpd-php .php .php3 .php4 .inc +
- 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 +
- </Directory> +
- +
 </VirtualHost> </VirtualHost>
 </file> </file>