This forum is no longer active. Please post your questions to our new community site

Forums LAMPStack

LAMPStack. Unable to run/etc/init.d/apache restart

Subscribe to LAMPStack. Unable to run/etc/init.d/apache restart 3 post(s), 2 voice(s)

 
Avatar demonllama 6 post(s)

Ok. So here’s the story.

Installed bitnamy LAMPStack and a couple of other things. After installing it worked absolutely fine. However, when I restarted ubuntu I was no longer able to get the standard bitnami page and the other pages I’d created.

1. I tried to find /etc/init.d/apache to do apache restart but it doesn’t exist.
2. I ran /home/christian/WebInstall/ctlscript.sh restart This got apache up and running by the looks of it.
3. When I navigate to my dbconnect.php page I got: Can’t connect to local MySQL server through socket ’/home/christian/WebInstall/mysql/tmp/mysql.sock’ (2) So, the SQL server isn’t running.

Q: What command do I use to get SQL running?
Q: How can I put all of the above commands in a shortcut so I don’t have to repeatedly do them on restart?

 
Avatar Beltrán Rueda Administrator 3,714 post(s)

Hi,

Try the following. Go to your installation directory and runs the main control script:

$ ./ctlscript.sh status

Is MySQL running? Take into account that if you have installed the Stack as non root user, you should run this script using the same user who installed the Stack. Then try to start all servers or only MySQL database:

$ ./ctlscript.sh start
$ ./ctlscript.sh start mysql

You can find more information about how to start automatically the servers when you start your system at http://bitnami.org/article/how-to-install-services-on-linux or http://bitnami.org/article/how-to-install-services-on-osx

I hope it helps.

 
Avatar demonllama 6 post(s)

It turns out that by running $ ./ctlscript.sh status (after a reboot) I get:

Apache not running
MySQL not running

On attempting to run $ ./ctlscript.sh start mysql I get:

/home/christian/WebInstall/mysql/bin/mysqld_safe: 545: cannot create /home/christian/WebInstall/mysql/data/mysqld.log: Permission denied

So, I changed the permissions on that file: chown christian mysqld.log

As an extra note. I carried on having problems with apache starting up. It turned out that I needed to be sudo to start apache. So my entry was $ sudo /home/christian/WebInstall/ctlscript.sh start

Hope this helps someone else. Now to make shortcuts or add them to startup…

Thanks to Beltran.

Forums LAMPStack