Last active
November 3, 2016 09:14
-
-
Save joonassandell/1ce6196a3c2f8fc768519be00893b40d to your computer and use it in GitHub Desktop.
Random Apache/MySQL commands I usually forget
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
**Update latest settings and install apache w/ MySQL**: | |
``` | |
apt-get update | |
apt-get install apache2 | |
apt-get install php5-mysql | |
apt-get install php5 | |
apt-get install php5-gd # (if gd needed) | |
apt-get install mysql-server | |
``` | |
**Remove MySQL**: | |
``` | |
apt-get remove --purge mysql-server mysql-client mysql-common | |
apt-get autoremove | |
apt-get autoclean | |
rm -rf /var/lib/mysql | |
dpkg --purge mysql-client-core-5.5 # or alternative version | |
dpkg --purge mysql-client | |
dpkg --purge mysql-server-core-5.5 # or alternative version | |
dpkg --purge mysql-common | |
``` | |
**Enable mod_rewrite**: | |
``` | |
a2enmod rewrite | |
service apache2 restart | |
``` | |
**MySQL status**: | |
`ps aux | grep mysql` | |
**Disable apache module**: | |
`a2dismod module_name` | |
**Show modules**: | |
`apache2ctl -M` | |
**Enale some site**: | |
`sudo a2ensite <siteName>` | |
**Make a config test**: | |
`apachectl configtest` | |
**Test errors**: | |
`apache2ctl -t | |
**Restart apache**: | |
`service apache2 restart` | |
**Show modules**: | |
`apache2ctl -M` | |
**Some usual locations**: | |
Error log: `/var/log/apache2/error.log` | |
Php ini: `/etc/php5/apache2/php.ini` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment