0

What I am going to ask is probably a simple problem but I can't figure out solution. I have installed apache2 on Debian server and updated php to version 7.3. I think that I have made a mistake when disabling/enabling some modules but I am not sure.

Since that moment, text formatting/styles are not shown at all. See the image please, it is a result of pure phpinfo()

What do I do?

Error log shows nothing

[Tue May 25 23:33:51.759710 2021] [mpm_prefork:notice] [pid 27142] AH00163: Apache/2.4.38 (Debian) OpenSSL/1.1.1d configured -- resuming normal operations [Tue May 25 23:33:51.759811 2021] [core:notice] [pid 27142] AH00094: Command line: '/usr/sbin/apache2'

apache2.conf

#ServerRoot "/etc/apache2"

#
# The accept serialization lock file MUST BE STORED ON A LOCAL DISK.
#
#Mutex file:${APACHE_LOCK_DIR} default

#
# The directory where shm and other runtime files will be stored.
#

DefaultRuntimeDir ${APACHE_RUN_DIR}

#
# PidFile: The file in which the server should record its process
# identification number when it starts.
# This needs to be set in /etc/apache2/envvars
#
PidFile ${APACHE_PID_FILE}

#
# Timeout: The number of seconds before receives and sends time out.
#
Timeout 300

#
# KeepAlive: Whether or not to allow persistent connections (more than
# one request per connection). Set to "Off" to deactivate.
#
KeepAlive On

#
# MaxKeepAliveRequests: The maximum number of requests to allow
# during a persistent connection. Set to 0 to allow an unlimited amount.
# We recommend you leave this number high, for maximum performance.
#
MaxKeepAliveRequests 100

#
# KeepAliveTimeout: Number of seconds to wait for the next request from the
# same client on the same connection.
#
KeepAliveTimeout 5


# These need to be set in /etc/apache2/envvars
User ${APACHE_RUN_USER}
Group ${APACHE_RUN_GROUP}


HostnameLookups Off


ErrorLog ${APACHE_LOG_DIR}/error.log


LogLevel warn

# Include module configuration:
IncludeOptional mods-enabled/*.load
IncludeOptional mods-enabled/*.conf

Include ports.conf


<Directory />
    Options FollowSymLinks
    AllowOverride None
    Require all denied
</Directory>

<Directory /usr/share>
    AllowOverride None
    Require all granted
</Directory>

<Directory /var/www/>
    Options Indexes FollowSymLinks
    AllowOverride None
    Require all granted
</Directory>


AccessFileName .htaccess

<FilesMatch "^\.ht">
    Require all denied
</FilesMatch>


LogFormat "%v:%p %h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" vhost_combined
LogFormat "%h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" combined
LogFormat "%h %l %u %t \"%r\" %>s %O" common
LogFormat "%{Referer}i -> %U" referer
LogFormat "%{User-agent}i" agent

IncludeOptional conf-enabled/*.conf

# Include the virtual host configurations:
IncludeOptional sites-enabled/*.conf


<IfModule mod_ssl.c>
SSLStaplingCache shmcb:/var/run/apache2/stapling_cache(128000)
<VirtualHost *:443>


    ServerAdmin webmaster@localhost
    DocumentRoot /var/www/html


    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined



Header always set X-Content-Type-Options "nosniff"
Header always set X-Xss-Protection "1; mode=block"
Header always set X-Frame-Options "sameorigin"
Header always set Referrer-Policy "same-origin"
Header set Content-Security-Policy "default-src 'self';"
Header always set Permissions-Policy "geolocation=(),midi=(),sync-xhr=(),microphone=(),camera=(),magnetometer=(),gyroscope=(),fullscreen=(self),payment=()"
ServerName CENSORED
Include /etc/letsencrypt/options-ssl-apache.conf
SSLCertificateFile /etc/letsencrypt/live/CENSORED/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/CENSORED/privkey.pem
Header always set Strict-Transport-Security "max-age=31536000"
SSLUseStapling on
</VirtualHost>
</IfModule>

Modules:
    Loaded Modules:
     core_module (static)
     so_module (static)
     watchdog_module (static)
     http_module (static)
     log_config_module (static)
     logio_module (static)
     version_module (static)
     unixd_module (static)
     access_compat_module (shared)
     alias_module (shared)
     auth_basic_module (shared)
     authn_core_module (shared)
     authn_file_module (shared)
     authz_core_module (shared)
     authz_host_module (shared)
     authz_user_module (shared)
     autoindex_module (shared)
     deflate_module (shared)
     dir_module (shared)
     env_module (shared)
     filter_module (shared)
     headers_module (shared)
     mime_module (shared)
     mpm_prefork_module (shared)
     negotiation_module (shared)
     php7_module (shared)
     proxy_module (shared)
     proxy_fcgi_module (shared)
     proxy_http_module (shared)
     reqtimeout_module (shared)
     rewrite_module (shared)
     setenvif_module (shared)
     slotmem_shm_module (shared)
     socache_shmcb_module (shared)
     ssl_module (shared)
     status_module (shared)

If it comes to the modules there might be actually some mistakes; i tried to install php7.3 fpm bud ended up using the "not fpm" version. Thank you so much for your time.

2
  • 2
    Hi Maty, and welcome to ServerFault. Please share your complete apache2 config (apart from Debian's defaults of course) to give us any chance of helping you.
    – fuero
    May 26, 2021 at 0:32
  • I have added some configs of Apache. What others would you like to see? Thx
    – Maty
    May 26, 2021 at 7:37

1 Answer 1

1

Ok so I resolved the problem. The only thing I had to do was removing the CSP header from SSL apache config file. Since then it works normally. TIP for everyone: Check developers console

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.