New installation configuration issues

Discussion in 'Installation/Configuration' started by SFN, Jun 3, 2020.

  1. SFN

    SFN New Member

    Hello all,

    A few days ago I installed ISPConfig and love it so far, but I have been having issues with a couple of things that I can't seem to fix..

    1. I created an SRV record two days ago and it still isn't working. Also, I have an A record for "ts" pointing to the IP. I've attached an image of my SRV record.

    2. My website appears in plain text! My CSS and javascript isn't working.

    3. Apache2 isn't forcing SSL on browsers, if someone goes to my site it brings them directly to http. Apparently ISPConfig doesn't allow .htaccess? How do I force this then?

    Any ideas?
     

    Attached Files:

    Last edited: Jun 3, 2020
  2. Jesse Norell

    Jesse Norell ISPConfig Developer ISPConfig Developer

    Place a period at the end of the Hostname and the Target.

    I presume you mean php isn't executing on the server side (css and javascript are just part of the page content, or files downloaded by a client). Check your website settings, ensure php is enabled, probably using php-fpm mode, and set to the correct version. Try changing to another mode, save, then change back and save. See what errors you might have in logs.

    .htaccess does work on ISPConfig apache servers (not nginx). What did you put in your .htaccess which is not working? Note also there is a setting in ISPConfig you can use for this which might be easier than editing your .htaccess file (under the website Redirect tab, click the 'Rewrite HTTP to HTTPS' checkbox).
     
    SFN likes this.
  3. SFN

    SFN New Member

    No, I truly do mean css/js. My site is literally text. I have found that it has something to do with mime 'AddType'? I also do not see anything regarding 'Addtype' in my apache2.conf or sites-available/mime.conf.

    Just so you know, I am new to Apache, I really only use NGINX.

    First off, the filesbelow are what I have in my sites-available/ folder. I am actually unsure of which I need to edit.
    • 000-default.conf
    • apps.vhost
    • default-ssl.conf
    • ispconfig.conf
    • ispconfig.vhost
    • mydomain.net.vhost <--- I assumed this was my file to edit, but please confirm if it isn't.

    So I went ahead and edited: mydomain.net.vhost, to activate .htaccess, adding the bold phrases to the file down below.
    Code:
    Options Indexes FollowSymLinks
    AllowOverride All <--- changed from None

    What I edited:

    Code:
    <Directory /var/www/mydomain.net>
                    AllowOverride ALL
                                    Require all denied
                    </Directory>
    
    <VirtualHost server_IP>
    Restarted Apache2. Then created my .htaccess in my root web folder and added rules for redirecting http to https and my hostname sub.mydomain[dot]net to point to [https]://server_address:8080/login/ to access my admin panel, which didn't work.
     
  4. till

    till Super Moderator Staff Member ISPConfig Developer

    Undo the changes in the vhost file that you made and then restart apache. Allow override is already set to all by default, the line you changed is not related to using .htaccess in that website, you allowed .htaccess in a file outside of the document root of the website, you verified that yourself by finding out that your change has no effect of course. And as a general rule NEVER edit the vhost file of an ispconfig manually, use the ispconfig settings of the website inside ISPConfig to manage the site.
     
    Th0m likes this.
  5. SFN

    SFN New Member

    I just finished adding the 'Addtype' in my apache2.conf and sites-available/mime.conf, restarted apache and it still shows my site as plain text? What gives?
    Code:
    AddType text/css .css
    AddType text/javascript .js
    I can confirm it's none of my web files because it clearly works on another host I'm using.

    'Addtype' in my apache2.conf or sites-available/mime.conf.
    So I shouldn't touch any of the config files in sites-available/ directory because it is handled by ISPConfig? What about apache2.conf in apache2/ directory?
     
  6. till

    till Super Moderator Staff Member ISPConfig Developer

    This file can be edited manually.
     
  7. Jesse Norell

    Jesse Norell ISPConfig Developer ISPConfig Developer

    Standard file types like that should be setup "out of the box" - what os are you running?
     
  8. SFN

    SFN New Member

    That's what I assumed, but I think it's because I'm using Debian 10 (buster).
     
  9. Jesse Norell

    Jesse Norell ISPConfig Developer ISPConfig Developer

    Debian 10 works out of the box, something unusual is wrong with your setup.

    You should have a mime.conf in mods-available, not sites-available; hopefully that's just a mistake. Next, try "a2enmod mime" to make sure that module is loading. Then verify mods-available/mime.conf includes:
    Code:
            TypesConfig /etc/mime.types
    
    And lastly, verify you have that /etc/mime.types file (from the mime-support package), which includes:
    Code:
    # grep -E 'css$|javascript' /etc/mime.types 
    application/javascript                          js
    text/css                                        css
    
     
  10. SFN

    SFN New Member

    Yes, sorry, I meant mods-available.

    a2enmod mime
    Code:
    Mime is enabled.
    grep -E 'css$|javascript' /etc/mime.types says the following:
    Code:
    application/javascript                          js
    text/css                                        css
    I am using a VPS not a dedicated server, so with that said I have a Debian cloud image installed, but not sure if that would change much.

    I can't even go to mydomain.com/assets/css/main.css as it shows up as a 404 error.
     
    Last edited: Jun 5, 2020
  11. till

    till Super Moderator Staff Member ISPConfig Developer

    Please check error.log of that website, maybe you just access a completely different website without noticing it.
     
  12. Jesse Norell

    Jesse Norell ISPConfig Developer ISPConfig Developer

    I don't know, but judging by https://wiki.debian.org/Cloud/SystemsComparison I wouldn't expect any differences in how apache acts.
    After you sort that out, if it's still not working, what content-type is returned for the request? And what do the corresponding access/error logs show for your request?
     
  13. SFN

    SFN New Member

    Well, I didn't see anything related to my issue in the error log, so I didn't post it.
    I visited my site and this is all it produced.
    As for content-type, using Firefox Network > Headers. My browser requests "CSS"
    /assets/css/main.css
    Request method:GET
    It responds with a 404 error by default and if I resend a request. Although I didn't see any request for JS.

    Hope this is what you wanted for content-type.
     
  14. till

    till Super Moderator Staff Member ISPConfig Developer

    You are checking the wrong logs, take a look into the error.log and access.log of the website and not in the global logs, which do not contain any website-related logging
     
  15. Jesse Norell

    Jesse Norell ISPConfig Developer ISPConfig Developer

    Sorry, I meant after you sort out your 404 error issue, if the overall problem isn't solved, what is the content-type and what do the logs show at that point?
     
  16. SFN

    SFN New Member

    From /var/www/mydomain/log is my access.log attached, however my error.log is blank.
     

    Attached Files:

  17. till

    till Super Moderator Staff Member ISPConfig Developer

    That's ok, it simply means that there were no errors.
     
  18. till

    till Super Moderator Staff Member ISPConfig Developer

    Regarding access.log, according to the log, many resources were not there (404). Please run these commands on the shell as root user and post the result:

    ls -la /var/www/yourdomain.tld/web/assets/
    ls -la /var/www/yourdomain.tld/web/assets/css/

    replace yourdomain.tld with the domain name of the website.
     
  19. SFN

    SFN New Member

    When I tried to list storage for my domain's directory it gave me this, is it suppose to be symlinked?

    ls -la /var/www/mydomain.net
    Code:
    lrwxrwxrwx 1 root root 30 Jun  3 05:57 /var/www/mydomain.net -> /var/www/clients/client0/web1/
    I also tried to list storage for assets and css within clients/client0/web1/ and I get the same response as below.

    # ls -la /var/www/mydomain.net/web/assets/
    Code:
    ls: cannot access '/var/www/mydomain.net/web/assets/': No such file or directory
    # ls -la /var/www/mydomain.net/web/assets/css/
    Code:
    ls: cannot access '/var/www/mydomain.net/web/assets/css/': No such file or directory
    Well, I do see the files when I go to those directories.
     
  20. till

    till Super Moderator Staff Member ISPConfig Developer

    Yes, that's fine.

    The output you posted shows that the files are not there when ls is not able to find them, so there is no issue with your web server or web server config. In case you altered any web server config files manually, the next step is to undo these changes as they might provide issues later. Then upload the missing files and folders to the web directory of your website and then check again with ls if these are there and when they are there, your website will start working in the browser as well.
     

Share This Page