Projekt

Általános

Profil

A leírás egy frissen telepített Ubuntu 24.04 LTS ből indul ki.

Figyelmesen olvasd a leírást, ha az utasításokat követed és hibát észlelsz, írj a fórum fülön!

  • Apache2
    sudo apt install apache2
    
    
  • PHP Csomagok és Apache2 csomag ( Értelemszerűen a számok a verziót jelentik )
    sudo apt install php8.1-fpm php8.1-common php8.1-mysql php8.1-xml php8.1-xmlrpc php8.1-curl php8.1-gd php8.1-imagick php8.1-cli php8.1-dev php8.1-imap php8.1-mbstring php8.1-soap php8.1-zip php8.1-bcmath libapache2-mod-php8.3
    
    
  • Ha régebbi php verziót kell installálni, akkor Ondřej Surý PHP repoját hozzá kell adni.
    sudo apt install -y software-properties-common
    sudo add-apt-repository ppa:ondrej/php
    sudo apt update
    
  • Ha a telepítések megvannak, ellenőrizni kell, hogy a servicek futnak-e
    sudo systemctl status php8.1-fpm.service
    sudo systemctl status apache2.service
    

Így néz ki a lekérdezésnél

root@vps-0002:~# systemctl status php8.1-fpm.service
● php8.1-fpm.service - The PHP 8.1 FastCGI Process Manager
     Loaded: loaded (/usr/lib/systemd/system/php8.1-fpm.service; enabled; preset: enabled)
     Active: active (running) since Wed 2026-02-04 23:41:15 UTC; 1 day 3h ago                <Ez kell, ha running, akkor jó
       Docs: man:php-fpm8.1(8)
   Main PID: 1277 (php-fpm8.1)
     Status: "Processes active: 0, idle: 2, Requests: 0, slow: 0, Traffic: 0req/sec" 
      Tasks: 3 (limit: 2262)
     Memory: 11.7M (peak: 26.1M)
        CPU: 4.444s
     CGroup: /system.slice/php8.1-fpm.service
             ├─1277 "php-fpm: master process (/etc/php/8.1/fpm/php-fpm.conf)" 
             ├─1465 "php-fpm: pool www" 
             └─1466 "php-fpm: pool www" 

Feb 04 23:41:14 vps-0002.esxi1 systemd[1]: Starting php8.1-fpm.service - The PHP 8.1 FastCGI Process Manager...
Feb 04 23:41:15 vps-0002.esxi1 systemd[1]: Started php8.1-fpm.service - The PHP 8.1 FastCGI Process Manager.

Ezzel az alap webszerver telepítése kész

Minták

  • Apache2 mintakonfig
    <VirtualHost *:80>
         ServerAdmin admin@site1.your_domain #admin emailcíme
         ServerName site1.your_domain        #domain
         DocumentRoot /var/www/site1.your_domain   #weboldal könyvtárja
         DirectoryIndex info.php                   
    
         <Directory /var/www/site1.your_domain>    #weboldal könyvtárja
            Options Indexes FollowSymLinks MultiViews
            AllowOverride All
            Order allow,deny
            allow from all
         </Directory>
    
        <FilesMatch .php$>
            # From the Apache version 2.4.10 and above, use the SetHandler to run PHP as a fastCGI process server
             SetHandler "proxy:unix:/run/php/php8.1-fpm.sock|fcgi://localhost"                                       #PHP Verziót ne felejtsd el átírni!
        </FilesMatch>
    
         ErrorLog ${APACHE_LOG_DIR}/site1.your_domain_error.log
         CustomLog ${APACHE_LOG_DIR}/site1.your_domain_access.log combined
    </VirtualHost>