VirtualMin Apache Failed to Start

sure you can

After adding a new domain ,Apache2 stopped

root@hosts:/etc/apache2# service apache2 restart
Job for apache2.service failed because the control process exited with error code.
See “systemctl status apache2.service” and “journalctl -xe” for details.
root@hosts:/etc/apache2#
● apache2.service - The Apache HTTP Server
Loaded: loaded (/lib/systemd/system/apache2.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Thu 2023-12-14 14:02:18 IST; 53s ago
Docs: Apache HTTP Server Version 2.4 Documentation - Apache HTTP Server Version 2.4
Process: 3155669 ExecStart=/usr/sbin/apachectl start (code=exited, status=1/FAILURE)

Dec 14 14:02:18 hosts.tag4track.com systemd[1]: Starting The Apache HTTP Server

Dec 14 14:02:18 hosts.tag4track.com apachectl[3155679]: AH00526: Syntax error on line 30 of /etc/apache2/sites-enabled/tag4track.com.conf:
Dec 14 14:02:18 hosts.tag4track.com apachectl[3155679]: Invalid command ‘RewriteEngine’, perhaps misspelled or defined by a module not included in the server configuration
Dec 14 14:02:18 hosts.tag4track.com systemd[1]: apache2.service: Control process exited, code=exited, status=1/FAILURE
Dec 14 14:02:18 hosts.tag4track.com systemd[1]: apache2.service: Failed with result ‘exit-code’.
Dec 14 14:02:18 hosts.tag4track.com systemd[1]: Failed to start The Apache HTTP Server.

as the error is on line 30 of the above file you need to fix that but I guess you don’t have rewrite enabled
use

a2enmod rewrite

to enable it & restart apache 
 as you effectively destroyed the apache configuration by your reinstall you are going to work through all the errors that popup 
 there is no ‘magic wand’ to fix it in this case

Done but php is not working

start a new thread as I said earlier you will get loads of errors unless you restore the domain from a backup. You did make a backup ?

1 Like

backup of /home/user-directory backup I made

using the virtualmin backup utility or something else 
 if you didn’t use the virtualmin backup system you will not have all the configuration files you need 
 please start a new thread with this new issue

Thankyou everyone , the issue is resolved now ,
<3 community ,

This topic was automatically closed 8 days after the last reply. New replies are no longer allowed.