« Nginx and Ubuntu » : différence entre les versions

De Banane Atomic
Aller à la navigationAller à la recherche
Ligne 12 : Ligne 12 :
<kode lang='bash'>
<kode lang='bash'>
# enable a web site
# enable a web site
sudo ln -s /etc/nginx/sites-available/phpinfo.net /etc/nginx/sites-enabled/phpinfo.net
sudo ln -s /etc/nginx/sites-available/phpinfo.conf /etc/nginx/sites-enabled/phpinfo.conf
</kode>
</kode>



Version du 8 août 2023 à 21:44

Install

Bash.svg
ai nginx php-fpm

# check nginx and php-fpm are running
sc-status nginx
sc-status php8.2-fpm

Site configuration

Bash.svg
# enable a web site
sudo ln -s /etc/nginx/sites-available/phpinfo.conf /etc/nginx/sites-enabled/phpinfo.conf

phpinfo

/etc/nginx/sites-available/phpinfo.conf
server {
    listen 80;
    root /var/www/php;
    index phpinfo.php;
    server_name phpinfo.net;

    location ~ \.php$ {
        include snippets/fastcgi-php.conf;

        # With php-fpm (or other unix sockets):
        fastcgi_pass unix:/run/php/php8.2-fpm.sock;
    }
}