# service apache2 start
* Starting web server apache2
AH00112: Warning: DocumentRoot [<removed>/public_html] does not exist
*
* The apache2 instance did not start within 20 seconds. Please read the log files to discover problems
/var/apache2/error.log:
[Sun Mar 19 15:15:41.234542 2017] [ssl:warn] [pid 6491] AH02292: Init: Name-based SSL virtual hosts only work for clients with TLS server name indication support (RFC 4366)
[Sun Mar 19 15:15:41.272641 2017] [ssl:warn] [pid 6492] AH02292: Init: Name-based SSL virtual hosts only work for clients with TLS server name indication support (RFC 4366)
[Sun Mar 19 15:15:41.272744 2017] [core:error] [pid 6492] (13)Permission denied: AH00099: could not create /var/run/apache2/apache2.pid
[Sun Mar 19 15:15:41.272765 2017] [core:error] [pid 6492] AH00100: apache2: could not log pid to file /var/run/apache2/apache2.pid
I've just upgraded Ubuntu (Server) from 12.04 LTS to 14.04 LTS, and thus Apache from 2.2 to 2.4. I've updated much of the configuration, but for some reason Apache seems not to be able to write its own pid file, despite my having tried all combinations of permissions that would make any sense:
drwxrwxr-x 2 root www-data 40 Mar 19 14:55 /var/run/apache2
Apache isn't chrooting, and SELinux is disabled. I've logged in as www-data and tested that it has permissions to create the pid file, and it does.
The line about the document root not existing is I think the same problem, as www-data has access to it through acls. I also have turned off a Mutex directive which caused Apache to complain about not being able to create a mutex file, in exactly the same way as this pid file, but a completely different place.
I can't think of anything that could be causing this, and would appreciate some help.
apache group
?www-data
group,sudo gpasswd -a <your-username> www-data
and see if it changes anything. I operate with me in groupwww-data