Page 1 of 1

command to start n stop apache/phpmyadmin

Posted: Sun Sep 27, 2020 3:19 am
by justpraveen
I am using mx linux since 2 months now and this seems to be much better supported than ubuntu.

I am very new to linux env.

I installed phpmyadmin from test software repo.

It did install successfully. But how do I run it?

Unable to find any steps, doc or info on it.

I did not install apache, php separately. However, when I selected phpmyadmin in test repo. The dependency also got installed.

I dont know how to stop and start phpmyadmin. I mean I know i have to stop and start apache. But not sure of commands.

Irony is the steps to install is there at a billion places on the net however, nowhere anything on how to start n stop apache.

Re: command to start n stop apache/phpmyadmin

Posted: Sun Sep 27, 2020 3:46 am
by LiD
A year ago I made these notes for myself, but I can't remember anything about them. :(

mysql -u root -p

GRANT ALL PRIVILEGES ON * . * TO 'phpmyadmin'@'localhost';
CREATE DATABASE demo;
SHOW CREATE DATABASE demo;
USE demo;

a2enmod rewrite

/etc/apache2/sites-available/000-default.conf
<VirtualHost *:80>
<Directory /var/www/html>
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>
. . .
</VirtualHost>



/etc/init.d/apache2 restart



/etc/dbconfig-common/phpmyadmin.conf
dbc_dbuser='phpmyadmin'
dbc_dbpass='2019'



https://help.ubuntu.com/community/phpMyAdmin
https://www.mysqltutorial.org/mysql-show-databases/
https://www.mysqltutorial.org/mysql-show-users/

Re: command to start n stop apache/phpmyadmin

Posted: Sun Sep 27, 2020 5:05 am
by JayM
Apache (actually apache2) runs as a service so you start and stop it as you would any other service in SysV init:

Code: Select all

service apache2 start

Code: Select all

service apache2 stop
You can do the same for the mysql service. Note that both of these services autostart at bootup if these apps are installed. See https://www.2daygeek.com/sysvinit-vs-sy ... and-usage/ for more info.

PHP is an web application preprocessor that only runs when you run a PHP-based web app such as phpMyAdmin, phpBB forum software, the Joomla! content management system, etc. Neither PHP nor phpMyAdmin are running unless you run them so they don't need to be started and stopped. Close your phpMyAdmin web browser tab and both will stop. Open a tab and visit localhost/phpmyadmin and both will start (as long as apache2 is running. That's why Apache was a dependency of phpMyAdmin: it's a web-based app so you need a web server running to use it.)

HTH.
:happy: