When I enter my domain i get:

Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator at [no address given] to inform them of the time this error occurred, and the actions you performed just before this error.

More information about this error may be available in the server error log.
Apache/2.4.29 (Ubuntu) Server at www.mywebsite.net Port 443

In my error log i found this:

/var/www/html/.htaccess: Invalid command 'php_value', perhaps misspelled or defined by a module not included in the server configuration, referer: https://www.google.lv/

My PHP version running php -v

PHP 7.2.10-0ubuntu0.18.04.1 (cli) (built: Sep 13 2018 13:45:02) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
with Zend OPcache v7.2.10-0ubuntu0.18.04.1, Copyright (c) 1999-2018, by Zend Technologies

I have this in my .htaccess

RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} ^165\.227\.175\.218$
RewriteRule ^(.*)$ http://www.mywebsite.net/$1 [L,R=301]
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
# END WordPress
# Wordfence WAF
<IfModule mod_php7.c>
php_value auto_prepend_file '/var/www/html/mywebsite/public_html/wordfence-waf.php'

In /var/www/html/mywebsite/public_html/wordfence-waf.php i have this:

// Before removing this file, please verify the PHP ini setting          `auto_prepend_file` does not point to this.

 if (file_exists('/var/www/html/mywebsite/public_html/wp-content/plugins /wordfence/waf/bootstrap.php')) {
define("WFWAF_LOG_PATH", '/var/www/html/mywebsite/public_html/wp-content  /wflogs/');
include_once '/var/www/html/mywebsite/public_html/wp-content/plugins/wordfence/waf/bootstrap.php';

I tried:

sudo a2enmod rewrite && sudo service apache2 restart
/etc/host.conf: line 3: bad command `nospoof on'
Module rewrite already enabled
/etc/host.conf: line 3: bad command `nospoof on'

/usr/sbin/apache2 -V | grep MPM

[Tue Jan 08 12:05:13.506757 2019] [core:warn] [pid 6361] AH00111: Config   variabl e ${APACHE_LOCK_DIR} is not defined
[Tue Jan 08 12:05:13.506990 2019] [core:warn] [pid 6361] AH00111: Config variabl e ${APACHE_PID_FILE} is not defined
[Tue Jan 08 12:05:13.507254 2019] [core:warn] [pid 6361] AH00111: Config variabl e ${APACHE_RUN_USER} is not defined
[Tue Jan 08 12:05:13.507358 2019] [core:warn] [pid 6361] AH00111: Config variabl e ${APACHE_RUN_GROUP} is not defined
[Tue Jan 08 12:05:13.507469 2019] [core:warn] [pid 6361] AH00111: Config variabl e ${APACHE_LOG_DIR} is not defined
[Tue Jan 08 12:05:13.514596 2019] [core:warn] [pid 6361] AH00111: Config variabl e ${APACHE_RUN_DIR} is not defined
[Tue Jan 08 12:05:13.515068 2019] [core:warn] [pid 6361] AH00111: Config variabl e ${APACHE_LOG_DIR} is not defined
Server MPM: prefork

Trying to see if this link can help me.

I ran: sudo apachectl -t and got syntax ok. I can't run sudo apache2 -X -f /etc/apache2/httpd.conf since I dont have a httpd.conf file. If I run: service apachectl start I get Failed to start apachectl.service: Unit apachectl.service not found.

This is my /etc/apache2/envvars

# envvars - default environment variables for apache2ctl

# this won't be correct after changing uid
unset HOME

# for supporting multiple apache2 instances
if [ "${APACHE_CONFDIR##/etc/apache2-}" != "${APACHE_CONFDIR}" ] ; then

# Since there is no sane way to get the parsed apache2 config in     scripts, some
# settings are defined via environment variables and then used in apache2ctl,
# /etc/init.d/apache2, /etc/logrotate.d/apache2, etc.
export APACHE_RUN_USER=www-data
export APACHE_RUN_GROUP=www-data
# temporary state file location. This might be changed to /run in Wheezy 1
export APACHE_PID_FILE=/var/run/apache2$SUFFIX/apache2.pid
export APACHE_RUN_DIR=/var/run/apache2$SUFFIX
export APACHE_LOCK_DIR=/var/lock/apache2$SUFFIX
# Only /var/log/apache2 is handled by /etc/logrotate.d/apache2.
export APACHE_LOG_DIR=/var/log/apache2$SUFFIX

## The locale used by some modules like mod_dav
export LANG=C
## Uncomment the following line to use the system default locale instead:
#. /etc/default/locale

export LANG

## The command to get the status for 'apache2ctl status'.
## Some packages providing 'www-browser' need '--dump' instead of '-dump'.
#export APACHE_LYNX='www-browser -dump'

## If you need a higher file descriptor limit, uncomment and adjust the
## following line (default is 8192):
#APACHE_ULIMIT_MAX_FILES='ulimit -n 65536'

## If you would like to pass arguments to the web server, add them     below
## to the APACHE_ARGUMENTS environment.

## Enable the debug mode for maintainer scripts.
## This will produce a verbose output on package installations of web     server modules and web application
## installations which interact with Apache

Any help on how to access my website again will be greatly appreciated. I have SSH access both via WinSCP and Putty.


The upgrade to 18.04 causes the PHP modules to be disabled. For me, running these commands fixed things:

sudo a2enmod php7.2
systemctl restart apache2
| improve this answer | |

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.