Not able to restart apache2.

checking sudo netstat -tulpn | grep :80 got this result:

tcp        0      0 0.0.0.0:80              0.0.0.0:*               LISTEN      1627/nginx: master  
tcp6       0      0 127.0.0.1:8005          :::*                    LISTEN      4486/java           
tcp6       0      0 :::8080                 :::*                    LISTEN      4486/java           
tcp6       0      0 :::80                   :::*                    LISTEN      1627/nginx: master

after trying to reload apache2 with systemctl reload apache2got this message:

==== AUTHENTICATING FOR org.freedesktop.systemd1.manage-units ===   
Authentication is required to reload 'apache2.service'.  
Authenticating as: Name Surname,,, (Username)  
Password:   
==== AUTHENTICATION COMPLETE ===  
apache2.service is not active, cannot reload.

Trying several Time to reload the Services, installed / updates services:

  • OpenSSH Server
  • PHP7
  • MySQL
  • phpMyAdmin
  • Apache Tomcat8
  • FTP (vsftpd)

Other messages that could help solve out my issue checking Status
systemctl status apache2.service:

apache2.service - The Apache HTTP Server  
   Loaded: loaded (/lib/systemd/system/apache2.service; enabled; vendor preset: enabled)  
  Drop-In: /lib/systemd/system/apache2.service.d  
           └─apache2-systemd.conf
   Active: failed (Result: exit-code) since Mon 2017-04-24 20:03:47 CEST; 29min ago   
  Process: 6623 ExecStart=/usr/sbin/apachectl start (code=exited, status=1/FAILURE)<br><br>
Apr 24 20:03:47 mcServer apachectl[6623]: AH00526: Syntax error on line 1 of /etc/apache2/sites-enabled/mysite.conf:  
Apr 24 20:03:47 mcServer apachectl[6623]: Invalid command 'ServerAdmin=gianni.alagna@modular.codes', perhaps misspelled or defined by a module not included in the server configuration  
Apr 24 20:03:47 mcServer apachectl[6623]: Action 'start' failed.  
Apr 24 20:03:47 mcServer apachectl[6623]: The Apache error log may have more information.  
Apr 24 20:03:47 mcServer systemd[1]: apache2.service: Control process exited, code=exited status=1  
Apr 24 20:03:47 mcServer systemd[1]: Failed to start The Apache HTTP Server.  
Apr 24 20:03:47 mcServer systemd[1]: apache2.service: Unit entered failed state.  
Apr 24 20:03:47 mcServer systemd[1]: apache2.service: Failed with result 'exit-code'.  
Apr 24 20:18:33 mcServer systemd[1]: apache2.service: Unit cannot be reloaded because it is inactive.  
Apr 24 20:18:35 mcServer systemd[1]: apache2.service: Unit cannot be reloaded because it is inactive.

Additional Note
I'm trying to setup a WebHost server for own Webbased (php) Applications.

share|improve this question
    
Isn't nginx listening on port 80? try systemctl stop nginx then start apache. – Ravexina Apr 24 '17 at 19:09
    
systemctl stop nginxis stopping the service as expected, but after starting sudo systemctl reload apache2.service still got error message: apache2.service is not active, cannot reload. – Gianni Apr 24 '17 at 19:14
    
systemctl status nginx.service ... Active: failed (Result: exit-code) since Mon 2017-04-24 21:21:10 CEST; 15s ago... Process: 25502 ExecStop=/sbin/start-stop-daemon --quiet --stop --retry QUIT/5 --pidfile /run/nginx.pid (code=exited, status=0/SUCCESS) Process: 25662 ExecStart=/usr/sbin/nginx -g daemon on; master_process on; (code=exited, status=1/FAILURE) Process: 25659 ExecStartPre=/usr/sbin/nginx -t -q -g daemon on; master_process on; (code=exited, status=0/ – Gianni Apr 24 '17 at 19:24
    
@Ravexina: Update: Apache2 finally startet with sudo systemctl restart apache2.service and after stopping nginx with systemctl stop nginx but nginx won't restart now.. – Gianni Apr 24 '17 at 19:28
    
It's because both of them wants to listen on port 80 which is not possible, you should change one of them to listen somewhere else like 8080. – Ravexina Apr 24 '17 at 19:31

Solution by working around with support by @Nadav Tasher:

Nginx won't work properly! Two services (nginx-apache2) won't work same timely! Running Apache2 has fixed the issue permanently!

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.