• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer navigation

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • VCS
  • Interview Questions
  • Database
    • MariaDB
  • DevOps
    • Docker
    • Shell Scripting
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

a2disconf Command Examples in Linux

by admin

The a2disconf command in Ubuntu or debian-based systems is used to disable an Apache2 configuration file. Apache2 is a popular web server that is commonly used to host websites on a Linux server.

The a2disconf command is used to disable a specific configuration file in the Apache2 configuration directory, which is usually located at /etc/apache2/conf-enabled/. This directory contains configuration files that are included in the main Apache2 configuration.

To use the a2disconf command, you will need to specify the name of the configuration file that you want to disable. For example, to disable the example.conf configuration file, you would use the following command:

$ sudo a2disconf example.conf

This command will disable the specified configuration file by creating a symbolic link to the file in the /etc/apache2/conf-disabled/ directory. This will effectively remove the file from the Apache2 configuration.

After running the a2disconf command, you will need to restart Apache2 for the changes to take effect. You can do this using the “service apache2 restart” command. It’s important to note that the a2disconf command only works on configuration files that are located in the /etc/apache2/conf-enabled/ directory. Configuration files that are located in other directories will not be affected by this command.

a2disconf Command Examples

Here are some examples of using the a2disconf command in Linux:

1. Disable a configuration file:

sudo a2disconf {{configuration_file}}

2. Don’t show informative messages:

$ sudo a2disconf --quiet {{configuration_file}}

3. To disable multiple configuration files at once, specify the names of the files separated by a space:

$ sudo a2disconf file1.conf file2.conf file3.conf

4. To disable all configuration files in the /etc/apache2/conf-enabled/ directory:

$ sudo a2disconf *

5. To check which configuration files are currently enabled, use the ls command to list the contents of the /etc/apache2/conf-enabled/ directory:

$ ls /etc/apache2/conf-enabled/

6. To check which configuration files are currently disabled, use the ls command to list the contents of the /etc/apache2/conf-disabled/ directory:

$ ls /etc/apache2/conf-disabled/

Remember to restart Apache2 after using the a2disconf command for the changes to take effect. You can do this using the service apache2 restart command.

Filed Under: Linux

Some more articles you might also be interested in …

  1. jigsaw Command Examples
  2. conky: command not found
  3. rpmbuild Command Examples in Linux
  4. grub-mkconfig Command Examples in Linux
  5. husky Command Examples
  6. How to use “yum downloadonly” to download a package without installing it
  7. toilet: command not found
  8. Interview Questions : Linux Package Manager (RPM)
  9. How to effectively use Man Pages under Linux
  10. Configure Network Bonding in Ubuntu Server

You May Also Like

Primary Sidebar

Recent Posts

  • Vanilla OS 2 Released: A New Era for Linux Enthusiasts
  • mk Command Examples
  • mixxx Command Examples
  • mix Command Examples

© 2025 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright