Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Please provide more support for apache #25

Open
YvarRavy opened this issue May 23, 2024 · 1 comment
Open

Please provide more support for apache #25

YvarRavy opened this issue May 23, 2024 · 1 comment

Comments

@YvarRavy
Copy link
Collaborator

i see i can only work with nginx but i would like to have access to apache also

@YvarRavy YvarRavy changed the title Please provide support for apache Please provide more support for apache May 23, 2024
@SanderT2001
Copy link
Owner

Thanks for the suggestion.

I've created two possible Apache Configuration files, one as a .htaccess and one as a virtualhost. I don't have an Apache configuration up-and-running at the moment, can you test it?

Apache VirtualHost

<VirtualHost *:80>
    ServerName fryske_oranjekoeke_dev
    DocumentRoot /var/www/fo_test/app/public
    DirectoryIndex index.php

    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined

    <Directory /var/www/fo_test/app/public>
        Options Indexes FollowSymLinks
        AllowOverride All
        Require all granted

        # If the request was made to a JS/CSS File, don't rewrite.
        <If "%{REQUEST_URI} =~ /\.(css|js|map|jpe?g|png)$/">
            RewriteEngine Off
        </If>
        RewriteEngine On
        RewriteCond %{REQUEST_FILENAME} !-f
        RewriteRule ^(.*)$ /index.php [L]
    </Directory>

    # For every request with a PHP File, let the PHP Engine handle this request.
    <FilesMatch \.php{{Message.content}}gt;
        SetHandler "proxy:unix:/var/run/php/php7.4-fpm.sock|fcgi://localhost"
    </FilesMatch>

    # Deny requests to .ht(access) & the .github directory.
    <DirectoryMatch "^/.*/(\.ht|\.github)">
        Require all denied
    </DirectoryMatch>
</VirtualHost>

Apache .htaccess

# Enable the rewrite engine
RewriteEngine On

# If the request was made to a JS/CSS File, don't rewrite.
RewriteCond %{REQUEST_URI} !\.(css|js|map|jpe?g|png)$ [NC]
RewriteRule ^(.*)$ /index.php [L]

# For every request with a PHP File, let the PHP Engine handle this request.
<FilesMatch \.php{{Message.content}}gt;
    SetHandler "proxy:unix:/var/run/php/php7.4-fpm.sock|fcgi://localhost"
</FilesMatch>

# Deny requests to .ht(access) & the .github directory.
<FilesMatch "^(\.ht|\.github)">
    Require all denied
</FilesMatch>

Thanks in advance!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants