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

Unable to load style.css file #1283

Closed
qosobrin opened this issue Nov 28, 2021 · 12 comments
Closed

Unable to load style.css file #1283

qosobrin opened this issue Nov 28, 2021 · 12 comments
Labels

Comments

@qosobrin
Copy link
Contributor

qosobrin commented Nov 28, 2021

Version

sympa-6.2.66
debian 11
apache 2.4.51

Installation method

From source
./configure --build=x86_64-linux-gnu --prefix=/usr --includedir=${prefix}/include --mandir=${prefix}/share/man --infodir=${prefix}/share/info --sysconfdir=/etc --localstatedir=/var --disable-option-checking --disable-silent-rules --libdir=${prefix}/lib/x86_64-linux-gnu --libexecdir=${prefix}/lib/x86_64-linux-gnu --runstatedir=/run --disable-maintainer-mode --disable-dependency-tracking --enable-fhs --sysconfdir=/etc/sympa --sbindir=/usr/lib/sympa/bin --libexecdir=/usr/lib/sympa/bin --with-cgidir=/usr/lib/cgi-bin/sympa --with-staticdir=/usr/share/sympa/static_content --with-cssdir=/var/lib/sympa/css --with-picturesdir=/var/lib/sympa/pictures --datadir=/usr/share --localedir=/usr/share/locale --mandir=/usr/share/man --with-unitsdir=/usr/lib/systemd/system --without-initdir --docdir=/usr/share/doc/sympa --with-piddir=/run/sympa --with-perl=/usr/bin/perl --with-user=sympa --with-group=sympa --with-aliases_file=/etc/mail/sympa/aliases --disable-setuid-fcgi

Expected behavior

Web interface should be correctly displayed

Actual behavior

Web interface shows the content but not the desired style

Additional information

I followed the source code installation instructions detailed in the documentation https://sympa-community.github.io/manual/install/install-sympa-distribution-source.html The configuration of my testing machine is as detailed in the documentation (DB=maria-db, web server=apache, mail server=postfix, single domain sympa configuration, WWSympa FCGI)

I configured my installation using similar values to the debian package (except that I decided to get rid of the init.d scripts and used the Systemd scripts instead). After installation I noticed that the web interface could not load the style.css file; it was trying to load it from the $STATICDIR (/usr/share/sympa/static_content in my case) when they were actually installed in the $CSSDIR (/var/lib/sympa/css in my case).

I understand that this is a correct behavior given my installation configuration, so I created a soft link in $STATICDIR pointing to the $CSSDIR that solved the issue:

cd /usr/share/sympa/static_content
ln -s /var/lib/sympa/css css

I am writing this in order to ask if this could be treated as an bug to be corrected (during installation, when $STATICDIR != $CSSDIR create soft link) and to serve for others to be aware of the problem and the solution.

Thank you very much.
Regards,

@ikedas
Copy link
Member

ikedas commented Nov 29, 2021

Hi @qosobrin ,
By any chance have you added css_path parameter in sympa.conf?

@qosobrin
Copy link
Contributor Author

Well, I initially forgot that variable but I have just tried and it didn't help much. My browser is trying to download the style.css file using the url http://192.168.0.12/static-sympa/css/VIRTUAL_DOMAIN/style.css?h=511e21957d2d76df34669c0a93b8e5a0.

First I added this line to sympa.conf file:

css_path /var/lib/sympa/css

because I thought that sympa would automatically add the VIRTUAL_DOMAIN part, but it didn't work. Then I changed the sympa.conf line to:

css_path /var/lib/sympa/css/VIRTUAL_DOMAIN

but it didn't work either.

The only solution I could find, without reading the configuration instructions (sorry for this, guys), was adding the soft link that I mentioned in my first post. Maybe there is another solution related to adding some any other variables to sympa.conf but I was not able to come along with it.

@ikedas
Copy link
Member

ikedas commented Nov 30, 2021

Could you please show the configuration for httpd?

@Salo15
Copy link

Salo15 commented Nov 30, 2021

Hello,

We have a similar problem after installing the of sympa (6.2.60dfsg-4) as a Debian package (Debian 11) with Apache 2.4.51-1deb11u1:

When accessing the page https://lists-test.scc.kit.edu/sympa, the page is loaded, but it does not run properly.
According to the net log, it tries to load the following non-existent URL: https://lists-test.scc.kit.edu/css-sympa/lists-test.scc.kit.edu/style.css?h=bd2b0c909269bcae2ec25147fa216a05.

The values in the sympa config look like this:
root@lists-test:/usr/share/info# grep -e static -e css -e wws -e http -e pic /etc/sympa/sympa.conf | grep -v ^#
static_content_path /usr/share/sympa/static_content
css_path /var/lib/sympa/css
css_url /css-sympa
pictures_path /var/lib/sympa/pictures
pictures_url /pictures-sympa
wwsympa_url https://lists-test.scc.kit.edu/sympa

The Apache config looks like this:
root@lists-test:/usr/share/info# grep -v ^# /var/www/conf/sympa.conf | grep -v ^$
RewriteEngine On
RewriteRule ^/$ /sympa [R=permanent,L]
RedirectPermanent /wws /sympa
ProxyErrorOverride On
ProxyTimeout 120
<location /sympa>
SetHandler "proxy:unix:/run/sympa/wwsympa.socket|fcgi://"
Require all granted

Alias /static-sympa /usr/share/sympa/static_content
<Directory /usr/share/sympa/static_content>
Require all granted

Alias /logo /var/www/htdocs/logo
<location /sympa/sso_login/kit_shibboleth>
Include /etc/apache2/include/auth_shibboleth
Require shibboleth

I wonder if this is a configuration error?
Do we need to define an alias from css-sympa to /var/lib/sympa/css in Apache config?
Or is this otherwise a bug in sympa or a bug in the debian package for bullseye?

Kind regards,
Sabine

@qosobrin
Copy link
Contributor Author

Could you please show the configuration for httpd?

Hi, @ikedas. By "configuration fot httpd", do you mean the apache site created for the web interface of sympa? I used the standard configuration suggested in the documentation:

<Location /sympa>
    SetHandler "proxy:unix:/run/sympa/wwsympa.socket|fcgi://"
      # Don't forget to edit lines below!
    #Require local
    Require all granted
</Location>

<Location /static-sympa>
      # Don't forget to edit lines below!
    #Require local
    Require all granted
</Location>
Alias /static-sympa /usr/share/sympa/static_content

Take into account that in debian you can enable the required modules with:

a2enmod proxy_fcgi
a2enmod alias
a2enmod proxy

Thank you very much.
Regards.

@racke
Copy link
Contributor

racke commented Nov 30, 2021

Hello,

We have a similar problem after installing the of sympa (6.2.60dfsg-4) as a Debian package (Debian 11) with Apache 2.4.51-1deb11u1:

When accessing the page https://lists-test.scc.kit.edu/sympa, the page is loaded, but it does not run properly. According to the net log, it tries to load the following non-existent URL: https://lists-test.scc.kit.edu/css-sympa/lists-test.scc.kit.edu/style.css?h=bd2b0c909269bcae2ec25147fa216a05.

The values in the sympa config look like this: root@lists-test:/usr/share/info# grep -e static -e css -e wws -e http -e pic /etc/sympa/sympa.conf | grep -v ^# static_content_path /usr/share/sympa/static_content css_path /var/lib/sympa/css css_url /css-sympa pictures_path /var/lib/sympa/pictures pictures_url /pictures-sympa wwsympa_url https://lists-test.scc.kit.edu/sympa

The Apache config looks like this: root@lists-test:/usr/share/info# grep -v ^# /var/www/conf/sympa.conf | grep -v ^$ RewriteEngine On RewriteRule ^/$ /sympa [R=permanent,L] RedirectPermanent /wws /sympa ProxyErrorOverride On ProxyTimeout 120 <location /sympa> SetHandler "proxy:unix:/run/sympa/wwsympa.socket|fcgi://" Require all granted Alias /static-sympa /usr/share/sympa/static_content <Directory /usr/share/sympa/static_content> Require all granted Alias /logo /var/www/htdocs/logo <location /sympa/sso_login/kit_shibboleth> Include /etc/apache2/include/auth_shibboleth Require shibboleth

I wonder if this is a configuration error? Do we need to define an alias from css-sympa to /var/lib/sympa/css in Apache config? Or is this otherwise a bug in sympa or a bug in the debian package for bullseye?

Kind regards, Sabine

You need to define aliases for /pictures-sympa and /css-sympa in your Apache configuration.

Regards
Racke

@ikedas ikedas added the question label Dec 1, 2021
@Salo15
Copy link

Salo15 commented Dec 1, 2021 via email

@racke
Copy link
Contributor

racke commented Dec 1, 2021 via email

@ikedas
Copy link
Member

ikedas commented Dec 1, 2021

@qosobrin ,

<Location /sympa>
    SetHandler "proxy:unix:/run/sympa/wwsympa.socket|fcgi://"
      # Don't forget to edit lines below!
    #Require local
    Require all granted
</Location>

<Location /static-sympa>
      # Don't forget to edit lines below!
    #Require local
    Require all granted
</Location>
Alias /static-sympa /usr/share/sympa/static_content

If you want to separate path for the CSS from static_content, you you need these settings:

  • css_path in sympa.conf (its default value is CSSDIR) for the directory in which CSS files will be stored.
  • css_url in sympa.conf for the URL path where the browser will access to the CSS.
  • An Alias directive in httpd conf file to link the directory and the URI above.

Whitout these settings, default locations will be used: the css subdirectory of static content URL path.

@qosobrin qosobrin closed this as completed Dec 1, 2021
@qosobrin qosobrin reopened this Dec 1, 2021
@qosobrin
Copy link
Contributor Author

qosobrin commented Dec 3, 2021

Thank you, @ikedas, for your information. I was able to make it work as expected after adding these two lines to my sympa.conf file:

css_path            /var/lib/sympa/css
css_url             http://192.168.0.12/css

and these other to my apache site configuration file:

<Location /css>
    Require all granted
</Location>
Alias /css /var/lib/sympa/css

Maybe a note could be added to the installation documentation but, meanwhile, let this issue serve as help for all those having this problem.

You can close this issue whenever you want.
Best regards and thank you for your help.

@Salo15
Copy link

Salo15 commented Dec 7, 2021

Hi Racke,

thanks for your answer,

the suggested solution also worked for me and after adding the aliases to the apache configuration the website can now be accessed without errors.

Also from my side the ticket can be closed with it.

Should I open a debian bug report, because the apache configuration file /etc/apache2/conf-available/sympa.conf in the sympa debian package for bullseye is outdated and still contains an entry for wwsympa-wrapper.fcgi?
Or have you already fixed this bug in the meantime?

Kind regards,
Sabine

@racke
Copy link
Contributor

racke commented Dec 7, 2021

Hello Sabine,

there is already a Debian bug filed for that: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=986395.

However, I also need to add the corresponding WWSympa FCGI instance to the package (probably with multiwatch as described on https://sympa-community.github.io/manual/install/configure-http-server-systemdsocket.html).

Regards,
Racke

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

No branches or pull requests

4 participants