K
K
kiranananda2020-04-01 11:06:07
PHP
kiranananda, 2020-04-01 11:06:07

Apache php-fpm site isolation?

Good afternoon.

How can you isolate sites located on the same server from each other? Interested in both php-fom and apache. For example, if one site is broken, so that they would not have access to another nearby.

Now only one thought, each site in its own docker, but I don’t know how good it is.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sanes, 2020-04-01
@kiranananda

apache+php-fpm. Perfectly isolated by pools running from different users.

<VirtualHost 127.0.0.1:8080>
    ServerName {{ username }}.loc
    ServerAlias {{ domains }}
    # ServerAlias example.*.xip.io

    DocumentRoot /home/{{ username }}/www

    <Directory /home/{{ username }}/www>
        Options -Indexes +FollowSymLinks +MultiViews
        AllowOverride All
        Require all granted
    </Directory>

    <FilesMatch \.php$>
        # 2.4.10+ can proxy to unix socket
        SetHandler "proxy:unix:/var/run/php/php{{ php }}-fpm-{{ username }}.sock|fcgi://localhost/"

        # Else we can just use a tcp socket:
        # SetHandler "proxy:fcgi://127.0.0.1:9000"
    </FilesMatch>

    ErrorLog ${APACHE_LOG_DIR}/{{ username }}-error.log

    # Possible values include: debug, info, notice, warn, error, crit,
    # alert, emerg.
    LogLevel warn

    # CustomLog ${APACHE_LOG_DIR}/example.com-access.log combined

</VirtualHost>

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question