Specific OS Issues > Ubuntu

htacces will not be performed

(1/2) > >>

First: Excuse my terrible english ^^
I run a Ubuntu 18.04 with EHCP force panel.
I have created a domain yyyy.ch
The htaccess file will not be processed.
I show the  /etc/apache2/sites-enabled/default
There is

--- Code: ---# this file used in Easy Hosting Control Panel (ehcp), www.ehcp.net

<VirtualHost *:80>

    RewriteEngine On
    RewriteCond %{HTTPS} off
    RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}
RewriteCond %{SERVER_NAME} =email.yyyy.ch [OR]
RewriteCond %{SERVER_NAME} =mail.yyyy.ch [OR]
RewriteCond %{SERVER_NAME} =webmail.yyyy.ch
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]

# this file used in Easy Hosting Control Panel (ehcp), www.ehcp.net

<VirtualHost *:443>

    ServerName ssl
    DocumentRoot /var/www/new
    <Directory />
        Options +FollowSymLinks
        AllowOverride None

    <Directory /var/www/vhosts/>
        Options -Indexes -FollowSymLinks -MultiViews
        AllowOverride All
        Order Allow,Deny
        Allow from All

    <FilesMatch "access_log|error_log">
        Deny from All
    <Files  ~ "\.conf$">
        Order allow,deny
        Deny from all
    <Files  ~ "\.txt$">
        Order allow,deny
        Deny from all
    <Files  ~ "\.log$">
        Order allow,deny
        Deny from all
    <Files  ~ "\.sh$">
        Order allow,deny
        Deny from all

    LogLevel debug
    ErrorLog /var/log/apache2/default.error.log
    CustomLog /var/log/apache2/default.access.log vhost_combined

    SSLEngine on
    SSLCertificateFile /etc/ssl/certs/server.crt
    SSLCertificateKeyFile /etc/ssl/private/server.key
    ProxyPassMatch ^(.*\.php)$ fcgi://$1
    ProxyFCGISetEnvIf "true" PHP_ADMIN_VALUE "open_basedir=/var/www:/tmp:/usr/share:/etc/roundcube:/etc/phpmyadmin:/var/lib/phpmyadmin:/var/lib/roundcube:/var/log/roundcube; \n upload_tmp_dir=/tmp; \n session.save_path=/var/www/php_sessions;"

--- End code ---

# a2enmod rewrite
Module rewrite already enabled

See also:

I run a Xenforo 2.1.4 on this machine and ssl is activated (certbot).
Without htaccess i have no redirects and no security :(

I do not understand that. Can someone help?

.htaccess files are a bad idea in general.

In your case, for apache2, you will need to add ProxyPassMatch rewrite rules into the domain's custom apache2 web server template since EHCP Force Edition runs on Apache versions newer than 2.4.26 using mod_proxy_fcgi (http://httpd.apache.org/docs/2.4/mod/mod_proxy_fcgi.html):

Here's the guide:


nginx syntax allows you to create try files directives placed in the custom nginx templates to make permalink structures work:


Let me know if I can be of more help.

Thank you for reply

I not understand "into the domain's custom apache2 web server template".
Where is the location of this file with content
--- Code: ---ProxyPassMatch ^/(.*\.php(/.*)?)$ fcgi://<path>/$1
--- End code ---
and what's the name of it?
Is this in the forum (domain) root a sub-folder called php-fpm?

# a2enconf php7.2-fpm
Conf php7.2-fpm already enabled

I edit /etc/apache2/sites-enabled/default

ProxyPassMatch ^(.*\.php)$ fcgi://$1
ProxyPassMatch ^(.*\.php)$ fcgi://$1

Works not.

php is already enabled from a fresh installation if you use EHCP Force Edition.

Login to the EHCP panel, select the domain that has been added to the panel that you want to customize, and then click on "Edit Apache2 Template".  This is the domain specific template which can be modified to accomplish anything custom you might need (but you could end up breaking your web server if you use invalid syntax).  If that happens, simply clear the contents of /var/www/new/ehcp/apachehcp.conf and restart the web server.  Undo your breaking changes, and then resync the domains. 

You should be using the panel to make any additions or customizations to any web server template.  Thus, you would login to the panel at http://localhost/ehcp

I hope this helps. 

Ey thx :D

--- Code: ---# ProxyPassMatch ^(.*\.php)$ fcgi://{homedir}/httpdocs/$1

<Directory {homedir}/httpdocs>
    Options -Indexes +FollowSymLinks -ExecCGI +MultiViews

    AllowOverride All

    <IfModule mod_proxy_fcgi.c>
        RewriteEngine On
        RewriteBase /
        RewriteOptions InheritBefore
        RewriteCond %{REQUEST_FILENAME} -f
        RewriteRule ^([^\.]+\.php)$ fcgi://{homedir}/httpdocs/$1 [L,P]

    Order allow,deny
    allow from all

    <IfVersion >= 2.4>
        Require all granted

--- End code ---

solve the problem.


[0] Message Index

[#] Next page

Go to full version