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

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • Solaris
    • Oracle Linux
    • VCS
  • Interview Questions
  • Database
    • oracle
    • oracle 12c
    • ASM
    • mysql
    • MariaDB
  • DevOps
    • Docker
    • Shell Scripting
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

a2disconf: command not found

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.

If you encounter the below error while running the apache2ctl command:

apache2ctl: command not found

you may try installing the below package as per your choice of distribution:

OS Distribution Command
Debian apt-get install apache2
Ubuntu apt-get install apache2
Alpine apk add apache2
Kali Linux apt-get install apache2
Raspbian apt-get install apache2

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. Basic Master Cups Server and Clients Configuration for Browsing in CentOS/RHEL 7
  2. manpath Command Examples in Linux
  3. UNIX / Linux : Examples of bash history command to repeat last commands
  4. RCRON – Setup High Availability of cron Jobs
  5. OpenLDAP Server and Client Utilities list
  6. pacaur Command Examples in Linux
  7. bpftool: command not found
  8. CentOS / RHEL : How to remove a mirror with mdadm
  9. makepkg: command not found
  10. apache2ctl: command not found

You May Also Like

Primary Sidebar

Recent Posts

  • protonvpn-cli Command Examples in Linux
  • protonvpn-cli connect Command Examples
  • procs Command Examples in Linux
  • prlimit: command not found

© 2023 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright