Jump to content

Tunde

Members
  • Posts

    3
  • Joined

  • Last visited

Profile Information

  • Location
    HostJane

Tunde's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. There is no need to alter anything in the htaccess file that ships with Blesta.
  2. This is now resolved if anyone else encounters this apache server issue, here's some help troubleshooting it: The issue in the subdomain case described above (blesta.domain.com) where the Blesta installation is in the Public_html, was that Let's Encrypt creates a secondary httpd.conf for HTTPS connections with <VirtualHost *:443> editable at: sudo nano /etc/apache2/sites-available/blesta.domain.com-le-ssl.conf Update the virtual hosts file on 443 port with the <directory /var/www/> info below: (I found that both Options Indexes FollowSymLinks works on Ubuntu 20.04 as well as Options +FollowSymLinks) <VirtualHost *:443> ServerName blesta.domain.com ServerAlias www.blesta.domain.com ServerAdmin webmaster@localhost DocumentRoot /var/www/html/blesta.domain.com/public_html <Directory /var/www/> Options Indexes FollowSymLinks AllowOverride All Order allow,deny Allow from all </Directory> Then reload Apache so the changes take effect: sudo systemctl reload apache2 If everything else is configured correctly, the site should then start working without Index.php Check your virtual hosts file doesn't have any errors inside it by running: sudo apache2ctl configtest You should get a Syntax OK returned On Ubuntu 20.04, check apache is running normally by using: sudo systemctl status apache2 Then hit q to exit
  3. Hey all, I have a question about the htaccess that ships in latest Blesta (4.12.2). On a correctly configured Ubuntu 20.04 apache server, we're seeing a bunch of 404s on all pages. I'm wondering if something has changed in 20.04 because the exact same htaccess configuration works fine in Ubuntu 18.04. In the site in question, Blesta is configured to run in /public_html/. There is nothing else on the server. No other directories except Blesta are contained in public_html. However the site is a subdomain (blesta.domain.com) by A-record. With htaccess deleted, all URLs on site load normally with /index.php. When the shipped htaccess is uploaded (to try to remove index.php), 404 error occurs on all pages except the public_html root which loads fine. - PHP Version 7.4.3 - Apache/2.4.41 (Ubuntu) - Site is using lets encrypt which has inserted ReWriteEngine On into the httpd.conf file (see below) - Module rewrite is enabled - cache/1/ is deleted - Apache status is normal. <VirtualHost *:80> # The ServerName directive sets the request scheme, hostname and port that # the server uses to identify itself. This is used when creating # redirection URLs. In the context of virtual hosts, the ServerName # specifies what hostname must appear in the request's Host: header to # match this virtual host. For the default virtual host (this file) this # value is not decisive as it is used as a last resort host regardless. # However, you must set it for any further virtual host explicitly. #ServerName www.example.com ServerName blesta.domain.com ServerAlias www.blesta.domain.com ServerAdmin webmaster@localhost DocumentRoot /var/www/html/blesta.domain.com/public_html/ <Directory /var/www/html/blesta.domain.com/public_html/> Options +FollowSymLinks AllowOverride All Order allow,deny Allow from all </Directory> </Directory> # Available loglevels: trace8, ..., trace1, debug, info, notice, warn, # error, crit, alert, emerg. # It is also possible to configure the loglevel for particular # modules, e.g. #LogLevel info ssl:warn ErrorLog /var/www/html/blesta.domain.com/logs/error.log CustomLog /var/www/html/blesta.domain.com/logs/access.log combined # For most configuration files from conf-available/, which are # enabled or disabled at a global level, it is possible to # include a line for only one particular virtual host. For example the # following line enables the CGI configuration for this host only # after it has been globally disabled with "a2disconf". #Include conf-available/serve-cgi-bin.conf RewriteEngine on RewriteCond %{SERVER_NAME} =blesta.domain.com [OR] RewriteCond %{SERVER_NAME} =www.blesta.domain.com RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent] </VirtualHost> # vim: syntax=apache ts=4 sw=4 sts=4 sr noet Here's a copy of the htaccess file (from 4.12.2) that I uploaded to public_html: ######################################################## # package: minPHP # filename: .htaccess ######################################################## # Do not allow direct access to templates # or an unauthorized backdoor from CE <Files ~ "blesta2ce.php|\.(pdt)$"> order deny,allow deny from all </Files> # Protect against Clickjacking #Header append X-Frame-Options "SAMEORIGIN" RewriteEngine on # Disable Apache MultiViews since it # may conflict with the GUI installer <IfModule mod_negotiation.c> Options -MultiViews </IfModule> # Force HTTPS #RewriteCond %{HTTPS} !=on #RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [R=307,NE,L] RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.*)$ index.php RewriteCond %{REQUEST_URI} ^(.*)/install.php$ RewriteRule install.php %1/install/ [R=301,L] I don't think anything needs to be changed in the shipped htaccess. Can anyone give a hint please what could be modified in the httpd.conf or something else to get the URLs to load normally using the above htaccess file? Incidentally, the LAMP Ubuntu 20.04 server was installed using Tasksel and this DO tutorial: https://www.digitalocean.com/community/tutorials/how-to-install-linux-apache-mysql-php-lamp-stack-on-ubuntu-20-04 Any help appreciated. Cheers Tunde
×
×
  • Create New...