How to listen to a certain port

Hi. I have an Apache Server with a LAMP Stack running on Ubuntu 14.04.

It’s all set up well, but I also need to monitor messages coming in from Port 22. I’ve opened the port using ufw, but I don’t know how to listen to it.

Any help will be very much appreciated.

Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

Port 22 is generally used for SSH traffic. If you configure another application besides the SSH daemon to listen on that port, make sure to configure SSH to listen on a different port first. If not, you may lose access to the server.

If you really want to configure Apache to listen to port 22, you must add or edit a VirtualHost to do so as well as configure a Listen directive. The port that Apache will respond on is configured

Listen 22

<VirtualHost *:22>
    ServerAdmin webmaster@localhost
    DocumentRoot /var/www/html
    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined

For more information on configuring Apache, check out:

To learn more about SSH, see: