Apache2 disable http


Due to security reason at any instance if you want to disable http on your apache2 webserver comment following lines in /etc/apache2/ports.conf file.

First open /etc/apache2/ports.conf file with any editor.

Then search for following line in ports.conf file.

NameVirtualHost *:80
Listen 80

Comment above mentioned lines:

#NameVirtualHost *:80
#Listen 80

After commenting restart apache2.

$ service apache2 restart

Now try to access your website with http, it should show message as unable to connect.


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s