| Author |  | 
| budy 
 
 
 Joined: 18 Feb 2023
 Posts: 4
 Location: USA
 
 | 
|  Posted: Sat 18 Feb '23 21:03    Post subject: Syntax errors on restart |   |  
| 
 |  
| I've been trying to restart apache ("sudo service apache2 restart") and I keep getting this error: "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." so then i typed in "× apache2.service - The Apache HTTP Server
 Loaded: loaded (/lib/systemd/system/apache2.service; enabled; vendor preset: enabled)
 Active: failed (Result: exit-code) since Sat 2023-02-18 18:56:44 UTC; 26s ago
 Docs: https://httpd.apache.org/docs/2.4/
 Process: 1523 ExecStart=/usr/sbin/apachectl start (code=exited, status=1/FAILURE)
 CPU: 35ms
 
 Feb 18 18:56:44 laptopstorage systemd[1]: Starting The Apache HTTP Server...
 Feb 18 18:56:44 laptopstorage systemd[1]: apache2.service: Control process exited, code=exited, status=1/FAILURE
 Feb 18 18:56:45 laptopstorage apachectl[1526]: apache2: Syntax error on line 225 of /etc/apache2/apache2.conf: Syntax error on line 15 of /etc/apache2/sites-enabled/000-default.conf: Expected </Di>
 Feb 18 18:56:44 laptopstorage systemd[1]: apache2.service: Failed with result 'exit-code'.
 Feb 18 18:56:45 laptopstorage apachectl[1523]: Action 'start' failed.
 Feb 18 18:56:45 laptopstorage apachectl[1523]: The Apache error log may have more information.
 Feb 18 18:56:44 laptopstorage systemd[1]: Failed to start The Apache HTTP Server."
 
 I cant get any off them to work.
 The first one this is the line "IncludeOptional sites-enabled/*.conf"
 The second one is "</Directory>"
 
 the second set of errors is much longer and ill post it later.
 
 (very new to this kind of thing so I hope I did it right)
 |  | 
| Back to top |  | 
| James Blond Moderator
 
  
 Joined: 19 Jan 2006
 Posts: 7442
 Location: EU, Germany, Next to Hamburg
 
 | 
|  Posted: Mon 20 Feb '23 12:17    Post subject: |   |  
| 
 |  
| A syntax check without restart works like 
 
  	  | Code: |  	  | source /etc/apache2/envvars
 /usr/sbin/apache2ctl -S
 
 | 
 
 For the config files you may use  http://apaste.info/ or http://hastebin.com/ so we can take a look at it.
 |  | 
| Back to top |  | 
| budy 
 
 
 Joined: 18 Feb 2023
 Posts: 4
 Location: USA
 
 |  | 
| Back to top |  | 
| budy 
 
 
 Joined: 18 Feb 2023
 Posts: 4
 Location: USA
 
 | 
|  Posted: Tue 21 Feb '23 2:18    Post subject: |   |  
| 
 |  
|  	  | James Blond wrote: |  	  | A syntax check without restart works like 
 
  	  | Code: |  	  | source /etc/apache2/envvars
 /usr/sbin/apache2ctl -S
 
 | 
 | 
 
 the first one came back with nothing the second one came back with a syntax error identical to the last one other than it said "Action '-S' failed" before kicking me off the ssh.
 |  | 
| Back to top |  | 
| James Blond Moderator
 
  
 Joined: 19 Jan 2006
 Posts: 7442
 Location: EU, Germany, Next to Hamburg
 
 | 
|  Posted: Tue 21 Feb '23 10:43    Post subject: |   |  
| 
 |  
| Found it 
 
  	  | Code: |  	  | <Directroy /var/www/nextcloud/>
 
 | 
 
 "Directroy" is a typo. Change it to Directory
 |  | 
| Back to top |  | 
| budy 
 
 
 Joined: 18 Feb 2023
 Posts: 4
 Location: USA
 
 | 
|  Posted: Wed 22 Feb '23 18:05    Post subject: |   |  
| 
 |  
| it worked thank you |  | 
| Back to top |  |