Birmingham mumbai



Download 15,21 Mb.
Pdf ko'rish
bet453/482
Sana13.01.2022
Hajmi15,21 Mb.
#355107
1   ...   449   450   451   452   453   454   455   456   ...   482
Bog'liq
Mastering Ubuntu Server Gain expertise in the art of deploying, configuring, managing, and troubleshooting Ubuntu Server by Jay LaCroix (z-lib.org)

[
 352 
]
Enabling virtual hosts is handled a bit differently in Debian and Ubuntu than in 
other platforms. In fact, there are two specific commands to handle this purpose: 
a2ensite
 for enabling a site and 
a2dissite
 for disabling a site. You won't find these 
commands on distributions such as CentOS, for example. Configuration files for each 
site are stored in the 
/etc/apache2/sites-available/
 directory and we would use 
the 
a2ensite
 command to enable each configuration. Assuming a site with the URL 
acmeconsulting.com
 is to be hosted on our Ubuntu server, we would create the  
/etc/apache2/sites-available/acmeconsulting.com.conf
 configuration file, and 
enable the site with the following commands:
sudo a2ensite acmeconsulting.com.conf 
sudo systemctl reload apache2 
If we wanted to disable the site for some reason, we would execute the 
a2dissite
 
command 
against the site's configuration file:
sudo a2dissite acmeconsulting.com.conf 
sudo systemctl reload apache2 
If you're curious about how this works behind the scenes, when the 
a2ensite
 
command is run against a configuration file, it basically creates a symbolic link to 
that file and stores it in the 
/etc/apache2/sites-enabled
 directory. When you run 
a2dissite
 to disable a site, this symbolic link is removed. Apache, by default, will 
use any configuration files it finds in the 
/etc/apache2/sites-enabled
 directory. 
After enabling or disabling a site, you'll need to refresh Apache's configuration, 
which is where the 
reload
 option comes in. This command won't restart Apache 
itself (so users who are using your existing sites won't be disturbed) but it does give 
Apache a chance to reload its configuration files. If you replace 
reload
 with 
restart
 
in the preceding commands, Apache will perform a full restart. You should only 
need to do that if you're having an issue with Apache or enabling a new plugin, but 
in most cases the 
reload
 option is preferred on a production system.
The main configuration file for Apache is located at 
/etc/apache2/apache2.conf
. Feel 
free to view the contents of this file; the comments contain a good overview of how 
Apache's configuration is laid out. The following lines in this file are of special interest:
# Include the virtual host configurations: 
IncludeOptional sites-enabled/*.conf 
I'm not using absolute paths in my examples; as long as you've 
copied the configuration file to the correct place, the 
a2ensite
 and 
a2dissite
 commands will know where to find it.


Chapter 14

Download 15,21 Mb.

Do'stlaringiz bilan baham:
1   ...   449   450   451   452   453   454   455   456   ...   482




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©hozir.org 2024
ma'muriyatiga murojaat qiling

kiriting | ro'yxatdan o'tish
    Bosh sahifa
юртда тантана
Боғда битган
Бугун юртда
Эшитганлар жилманглар
Эшитмадим деманглар
битган бодомлар
Yangiariq tumani
qitish marakazi
Raqamli texnologiyalar
ilishida muhokamadan
tasdiqqa tavsiya
tavsiya etilgan
iqtisodiyot kafedrasi
steiermarkischen landesregierung
asarlaringizni yuboring
o'zingizning asarlaringizni
Iltimos faqat
faqat o'zingizning
steierm rkischen
landesregierung fachabteilung
rkischen landesregierung
hamshira loyihasi
loyihasi mavsum
faolyatining oqibatlari
asosiy adabiyotlar
fakulteti ahborot
ahborot havfsizligi
havfsizligi kafedrasi
fanidan bo’yicha
fakulteti iqtisodiyot
boshqaruv fakulteti
chiqarishda boshqaruv
ishlab chiqarishda
iqtisodiyot fakultet
multiservis tarmoqlari
fanidan asosiy
Uzbek fanidan
mavzulari potok
asosidagi multiservis
'aliyyil a'ziym
billahil 'aliyyil
illaa billahil
quvvata illaa
falah' deganida
Kompyuter savodxonligi
bo’yicha mustaqil
'alal falah'
Hayya 'alal
'alas soloh
Hayya 'alas
mavsum boyicha


yuklab olish