How do I enable/disable a website hosted with Apache?
Stack How?
Stackorigin – The Community of Question and Answers Latest Articles
Read More About Python List Comprehension with examples
Python List Comprehension: Python List comprehension provides a much more short syntax for creating a new list based on the values of an existing list. Advantages of List Comprehension in Python: Time Efficient than loop Space Efficient than loop Needs ...
Do not accept an offer letter from companies.
Do not accept an offer letter from companies without verifying the following points. Designation Salary Details & CTC Distribution Leave Policies Working Hours & Days Medical Coverage/Insurance Probation Period Notice Period Benefits and Perks Bonus F&F Policy
How to call API using Ajax
AJAX stands for Asynchronous JavaScript and XML and its used for to make calls to the server to fetch some data. In this article, we will learn how to implement a simple API call using AJAX technology. How to use GET ...
Use the Apache Utilities: a2dissite and a2ensite
The
a2dissite
anda2ensite
tools greatly simplify the process of disabling and enabling a website. The following commands are geared towards Ubuntu but are similar to other versions of Linux.a2dissite
command followed by the site name. Enter the name used for the virtual host.conf
file, without the extension.To enable or disable a site hosted with Apache, you can use the ‘a2ensite’ and ‘a2dissite’ commands, respectively. Both commands use essentially the same syntax:
a2ensite <site>
a2dissite <site>
where ‘<site>’ is the name of your site’s Virtual Host configuration file, located in ‘/etc/apache2/sites-available/’, minus the ‘.conf’ extension. For example, if your site’s Virtual Host configuration file is called ‘example.com.conf’, then the commands would look like</site>
a2ensite example.com
a2dissite example.com
There are other, more complicated ways to do this, but these commands basically just automate those processes anyway, so my advice is to use these commands to ensure that everything is always configured correctly. Also, remember to 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
To enable or disable a site hosted with Apache, you can use the ‘a2ensite’ and ‘a2dissite’ commands, respectively. Both commands use essentially the same syntax:
a2ensite <site>
a2dissite <site>
where ‘<site>’ is the name of your site’s Virtual Host configuration file, located in ‘/etc/apache2/sites-available/’, minus the ‘.conf’ extension. For example, if your site’s Virtual Host configuration file is called ‘example.com.conf’, then the commands would look like</site>
a2ensite example.com
a2dissite example.com
There are other, more complicated ways to do this, but these commands basically just automate those processes anyway, so my advice is to use these commands to ensure that everything is always configured correctly. Also, remember to 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