If the PHP 7 was working why mess with it?
It was working in HTTP or in cli only (terminal)
As far as your paths;
You need to add 80,443
and what is needed for TLS (SSL HTTPS)
Code:
<VirtualHost *>
ServerAdmin [email protected]
ServerName example.com
ServerAlias www.example.com
# Indexes + Directory Root.
DirectoryIndex index.html index.shtml index.php index.cgi index.xhtml
DocumentRoot /home/[your path]/public_html
# CGI Directory
ScriptAlias /cgi-bin/ /home/[your path]/public_html
<Location /cgi-bin>
Options +ExecCGI
AddHandler server-parsed .shtml .xhtml
</Location>
#rewrites
RewriteEngine on
# Logfiles
ErrorLog /home/[your path]/logs/error.log
CustomLog /home/[your path]/logs/access.log combined
<IfModule security2_module>
SecRuleEngine Off
</IfModule>
<Directory /home/[your path]/public_html>
Order allow,deny
Allow from all
# New directive needed in Apache 2.4.3:
Require all granted
</Directory>
#IMPORTANT TO ADD^^^!
</VirtualHost>
#a2ensite example.com
#/etc/init.d/apache2 restart