Birmingham mumbai



Download 15,21 Mb.
Pdf ko'rish
bet454/482
Sana13.01.2022
Hajmi15,21 Mb.
#355107
1   ...   450   451   452   453   454   455   456   457   ...   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)

[
 353 
]
As you can see, this is how Ubuntu has configured Apache to look for enabled sites 
in the 
/etc/apache2/sites-enabled
 directory. Any file stored there with the 
.conf
 
file extension is read by Apache. If you wish, you could actually remove those lines 
and Apache would then behave as it does on other platforms, and the 
a2ensite
 and 
a2dissite
 commands would no longer have any purpose. However, it's best to keep 
the framework of Ubuntu's implementation intact, as separating the configuration 
files makes logical sense and helps simplify the configuration. This chapter will go 
along with the Ubuntu way of managing configuration.
An additional virtual host is not required if you're only hosting a single site. The 
contents of 
/var/www/html
 are served by the default virtual host if you make no 
changes to Apache's configuration. This is where the example site that ships with 
Apache comes from. If you only need to host one site, you could remove the default 
index.html
 file stored in this directory and replace it with the files required by your 
website. If you wish to test this for yourself, you can make a backup copy of the 
default 
index.html
 file and create a new one with some standard HTML. You should 
see the default page change to feature the content you just added to the file.
The 
000-default.conf
 file is special, in that it's basically the configuration file that 
controls the default Apache sample website. If you look at the contents of the 
/etc/
apache2/sites-available
 and 
/etc/apache2/sites-enabled
 directories, you'll see 
the 
000-default.conf
 configuration file stored in 
sites-available
 and 
symlinked
 in 
sites-enabled
. This shows you that, by default, this site was included with Apache, 
and its configuration file was enabled as soon as Apache was installed. For all 
intents and purposes, the 
000-default.conf
 configuration file is all you need if you 
only plan on hosting a single website on your server. The contents of this file are as 
follows, but I've stripped the comments out of the file in order to save space on this 
page:
 
    ServerAdmin webmaster@localhost 
    DocumentRoot /var/www/html 
 
    ErrorLog ${APACHE_LOG_DIR}/error.log 
    CustomLog ${APACHE_LOG_DIR}/access.log combined 
 
As you can see, this default virtual host is telling Apache to listen on port 
80
 for 
requests and to serve content from 
/var/www/html
 as soon as requests come in. The 

 declaration at the beginning is listening to everything (the asterisk 
is a 
wildcard
) on port 
80
, so this is basically handling all web traffic that comes into 
the server from port 
80
. The 
ServerAdmin
 clause specifies the email address that is 
displayed in any error messages shown if there is a problem with the site.


Serving Web Content

Download 15,21 Mb.

Do'stlaringiz bilan baham:
1   ...   450   451   452   453   454   455   456   457   ...   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