D
D
Dinar Garipov2013-11-20 16:39:17
linux
Dinar Garipov, 2013-11-20 16:39:17

Apache autostart in Ubuntu

Good afternoon
After I installed every LAMP, I noticed that Apache does not start automatically when it starts. There are no errors in the logs. If you start by hand - it starts.
I was looking for a solution, they say this is due to the fact that MySQL starts later, so Apache cannot start.
How to solve this problem?
Or maybe the problem is somewhere else?

Answer the question

In order to leave comments, you need to log in

8 answer(s)
A
Andrey Unger, 2013-11-20
@Cobalt

sudo update-rc.d apache2 default
or httpd - depending on what the service is called

E
Evgeny Elizarov, 2013-11-20
@KorP

they say it is because MySQL starts up later

and you do not listen to what they say, or ask to explain where apache is connected with mysql

A
Alexander Shurygin, 2013-11-20
@duderu

what do they write in the logs? It's probably some kind of error...

E
eaa, 2013-11-20
@eaa

they say it's because MySQL starts up later, so apache can't start.
How to solve this problem?

Stop Apache. Stop MySQL. Try running apache. If it does, that's not the problem. If it happens again, then change the Apache priority accordingly, so that it starts after mysql

C
Chromium58, 2013-11-20
@Chromium58

update-rc.d is no longer used in ubuntu, it is now customary to add daemons to autostart via insserv -v /etc/init.d/apache2

M
Maxim Vasiliev, 2013-11-21
@qmax

Patch the autorun script so that it writes all stdout/stderr from apachectl to the log file.

N
Nadz Goldman, 2013-11-23
@nadz

cp your-apache-init.d.sh /etc/init.d
chkconfig --help
Well, or a stupid symlink in /etc/init.d/apache

I
Igor, 2013-11-26
@leotop

sometimes the usual reinstallation
sudo apt-get install apache2 --reinstall helps
for development, it is better to use virtual environments or virtual machines, for example, the same lightweight LXC, there will be many times less problems.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question