How to enable or disable a site, hosted with Apache


Enable or disable a site, hosted with Apache

In Apache web server different virtual host can be created to host different sites. These virtual hosts/sites can be disabled or enabled as required. To enable or disable a site hosted with Apache, you can use the ‘a2ensite’ and ‘a2dissite’ commands, respectively. Both these commands are almost same in syntax:

a2ensite <site>
a2dissite <site>

In this the ‘<site>’ is the name of the site’s Virtual Host configuration file, which is located in ‘/etc/apache2/sites-available/’, without the ‘.conf’ extension.

For example, if your site’s Virtual Host configuration file is called ‘your-website.com.conf’, then the commands would look like</site>

a2ensite your-website.com
a2dissite your-website.com

These commands work perfectly and ensure that everything is always configured correctly.

Always restart Apache after running those commands. The exact command will depend on which Linux distribution you are using, but will most likely be one of the following 2 commands:

sudo systemctl restart apache2
sudo service apache2 restart 

Share on: Share YogiRaj B.Ed Study Notes on twitter Share YogiRaj B.Ed Study Notes on facebook Share YogiRaj B.Ed Study Notes on WhatsApp

Related Posts

Reflective Teaching

Introduction.
Reflective teaching means looking at what you do in the classroom, thinking about why you do it, and thinking about if it works – a process of self-observation and self-evaluation.

Read full article
Jurisprudential Inquiry Model

(Learning to think about social policy).
Assumptions:.
Social values legitimately conflict with one another.
Negotiations of Difference can help to resolve complex and controversial issues.

Read full article
Characteristics of constitution of India

Constitution of India is a scared document. It includes the characteristics of main Constitutions of World. Indian Constitution is a result of continues attempt, study, discussion, thinking and hard work of drafting committee during the period of 2 years 11 month and 18 days.

Read full article
Advanced Organiser Model and its education implication

Introduction
If we connect new information/knowledge to previous knowledge then it helps to understand easily and also to remember for a long time. To prevent introduction in terms of statement or to present material before teaching a lesson is called ‘Advanced Organizer’.

Read full article

Some important study notes