List loaded modules in Apache web server

One of the tasks that almost every web master need to check form time to time is to list loaded modules in Apache web server, fortunetly standard Apache installation in Linux distributions comes with useful tool called apachectl.

in Debian and Ubuntu you can use the following

apache2ctl -t -D DUMP_MODULES

it will print all loaded modules :

Loaded Modules:
 core_module (static)
 log_config_module (static)
 logio_module (static)
 mpm_prefork_module (static)
 http_module (static)
 so_module (static)
 alias_module (shared)
 auth_basic_module (shared)
 authn_file_module (shared)
 authz_default_module (shared)
 authz_groupfile_module (shared)
 authz_host_module (shared)
 authz_user_module (shared)
 autoindex_module (shared)
 cgi_module (shared)
 deflate_module (shared)
 dir_module (shared)
 env_module (shared)
 mime_module (shared)
 negotiation_module (shared)
 php5_module (shared)
 reqtimeout_module (shared)
 rewrite_module (shared)
 setenvif_module (shared)
 ssl_module (shared)
 status_module (shared)
 vhost_alias_module (shared)
Syntax OK


Please note some Linux distribution uses apachectl instead of apache2ctl

SSH restrict access to user or group

When you have a public Linux server with Open SSH installed you will often find in you security logs failed login attempts from deferent ip’s most of them are hackers trying to brute force user accounts, one of security measures that can be added to Open SSH server is to restrict access to a specific user or specific group for example to allow user roger only to login to ssh you add the following line to /etc/ssh/sshd_config

AllowUsers roger

to restrict access to admin group add the following line

AllowGroups admin

Mysqldump over SSH

I often transfer production MySql databases to my local machine for development and testing purposes, usually I do this over SSH for security reasons.
to automate the process I combined all the commands in one line.

ssh -C {ssh.user}@{remote_host} mysqldump -u {remote_dbuser} --password={remote_dbpassword} {remote_dbname} | mysql -u {local_dbuser} --password={local_dbpassword} -D {local_dbname}

How does it work ?
I run mysqldump command remotely using ssh than I pass the output to a local mysql command using the pipe, to speed up the transfer I passed -C to ssh to compress the data.

please note this method works good on fast connections and small databases , I didn’t test it with big database, as you need to have your in a remote machine’s authorized_keys.