I'm working on Debian Testing. I see local http sites at localhost/~myhome/... To this end I made the classic change to /etc/apache2/mods-available/php8.2.conf
To re-enable php in user directories comment the following lines
...
However I have an https site in which .htaccess I added
RewriteEngine on
RewriteCond %{HTTP_HOST} ^sito.net$ [OR]
RewriteCond %{HTTP_HOST} ^sito.it$ [OR]
RewriteCond %{HTTP_HOST} ^www.sito.it$
RewriteRule ^/?$ "http\:\/\/www\.site\.net" [R=301,L]`
and still from local I cannot see it, receiving:
Internal Server Error
The server encountered an internal error or misconfiguration
and was unable to complete your request.`
Please contact the server administrator at webmaster@localhost
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.58 (Debian) Server at localhost Port 80`
I followed some (old) instructions found in this thread: How do I allow HTTPS for Apache on localhost?
I did the following steps:
# openssl req -x509 -newkey rsa:2048 -keyout mykey.key -out mycert.pem -days 365 -nodes
#cp mycert.pem mykey.key /etc/ssl/private/
#a2enmod ssl
#a2ensite default-ssl.conf
#systemctl restart apache2
but receiving:
root@debian:~# systemctl restart apache2
Job for apache2.service failed because the control process exited with error code.
See "systemctl status apache2.service" and "journalctl -xeu apache2.service" for details.
And after:
root@debian:~# systemctl status apache2.service
× apache2.service - The Apache HTTP Server
Loaded: loaded (/lib/systemd/system/apache2.service; enabled; preset: enabled)
Active: failed (Result: exit-code) since Mon 2023-12-04 21:35:15 CET; 8s ago
Docs: https://httpd.apache.org/docs/2.4/
Process: 4216 ExecStart=/usr/sbin/apachectl start (code=exited, status=1/FAILURE)
CPU: 93ms
dic 04 21:35:15 debian systemd[1]: Starting apache2.service - The Apache HTTP Server...
dic 04 21:35:15 debian apachectl[4218]: AH00526: Syntax error on line 227 of /etc/apache2/apache2.conf:
dic 04 21:35:15 debian apachectl[4218]: Cannot define multiple Listeners on the same IP:port
dic 04 21:35:15 debian systemd[1]: apache2.service: Control process exited, code=exited, status=1/FAILURE
dic 04 21:35:15 debian systemd[1]: apache2.service: Failed with result 'exit-code'.
dic 04 21:35:15 debian systemd[1]: Failed to start apache2.service - The Apache HTTP Server.
The line referring to that error:
# Include the virtual host configurations:
IncludeOptional sites-enabled/*.conf
Listen 80
NameVirtualHost *:80
<VirtualHost *:443>
DocumentRoot "/home/samiel/public_html" #your wamp www root dir
ServerName debian
SSLEngine on
SSLCertificateFile "/etc/ssl/certs/mycert.pem"
SSLCertificateKeyFile "/etc/ssl/certs/mykey.key"
I am unable to make any further attempts...
apachectl -S