Specific OS Issues > Ubuntu
htacces will not be performed
spicer:
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]
</VirtualHost>
# 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>
<Directory /var/www/vhosts/>
Options -Indexes -FollowSymLinks -MultiViews
AllowOverride All
Order Allow,Deny
Allow from All
</Directory>
<FilesMatch "access_log|error_log">
Deny from All
</FilesMatch>
<Files ~ "\.conf$">
Order allow,deny
Deny from all
</Files>
<Files ~ "\.txt$">
Order allow,deny
Deny from all
</Files>
<Files ~ "\.log$">
Order allow,deny
Deny from all
</Files>
<Files ~ "\.sh$">
Order allow,deny
Deny from all
</Files>
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://127.0.0.1:9001/var/www/new/$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;"
</VirtualHost>
--- End code ---
# a2enmod rewrite
say
Module rewrite already enabled
See also:
https://www.xendach.de/threads/htaccess-wird-nicht-ausgefuehrt.6902/
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?
earnolmartin:
.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:
https://serverfault.com/questions/398834/understanding-apache-2-4-mod-proxy-fcgi-and-rewriterules-in-htaccess
nginx syntax allows you to create try files directives placed in the custom nginx templates to make permalink structures work:
https://www.nginx.com/resources/wiki/start/topics/recipes/xenforo/
Let me know if I can be of more help.
spicer:
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://127.0.0.2:9126/<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://127.0.0.1:9001/var/www/new/$1
ProxyPassMatch ^(.*\.php)$ fcgi://127.0.0.1:9001/var/www/vhosts/yyyy.ch/yyyy.ch/httpdocs/$1
Works not.
earnolmartin:
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.
spicer:
Ey thx :D
--- Code: ---# ProxyPassMatch ^(.*\.php)$ fcgi://127.0.0.1:9000{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://127.0.0.1:9000{homedir}/httpdocs/$1 [L,P]
</IfModule>
Order allow,deny
allow from all
<IfVersion >= 2.4>
Require all granted
</IfVersion>
</Directory>
--- End code ---
solve the problem.
Navigation
[0] Message Index
[#] Next page
Go to full version