Birmingham mumbai



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

[
 354 
]
The 
DocumentRoot
 setting tells Apache which directory to look for in order to find 
files to serve for connections to this virtual host. 
/var/www/html
 is the default, but 
some administrators choose to customize this. This file also contains lines for where 
to send logging information. The 
access log
 contains information relating to HTTP 
requests that come in, and by default is stored in 
/var/log/access.log
. The 
error 
log
 is stored at 
/var/log/error.log
 and contains information you can use whenever 
someone has trouble visiting your site. The 
${APACHE_LOG_DIR}
 variable equates to  
/var/log
 by default, and this is set in the 
/etc/apache2/envvars
 file, in case for some 
reason you wish to change this (for example, you wish to use a custom logging 
directory).
If you wish to host another site on the same server by creating an additional virtual 
host, you can use the same framework as the original file, with some additional 
customizations. Virtual host files are stored in the 
/etc/apache2/sites-available
 
directory, with a filename ending in 
.conf
. Here's an example for a hypothetical 
website, 
acmeconsulting.com
. A virtual host file such as this might be saved as 
 
/etc/apache2/sites-available/acmeconsulting.com.conf

 
    ServerAdmin webmaster@localhost 
    DocumentRoot /var/www/acmeconsulting 
 
    ErrorLog ${APACHE_LOG_DIR}/acmeconsulting.com-error.log 
    CustomLog ${APACHE_LOG_DIR}/acmeconsulting.com-access.log combined 
 
To save time, I'll generally copy another virtual host file, even the default one, and 
change it accordingly. In this particular example, I've emphasized some important 
differences. First, with this virtual host, I'm not listening for all connections coming 
in on port 
80
; instead, I'm specifically looking for incoming traffic going to IP address 
192.168.1.104
 on port 
80
. This works because this server has two network cards, and 
therefore two IP addresses. With virtual hosts, I'm able to serve a different website, 
depending on which IP address the request is coming in on.
Next, I set 
DocumentRoot
 to 
/var/www/acmeconsulting
. Each virtual host should 
have its own individual 
DocumentRoot
 to keep each site separate from the others. On 
my servers, I will typically disable or remove the sample virtual host (the one that 
has the default 
DocumentRoot
 of 
/var/www/html
). Instead, I use 
/var/www
 as a base 
directory, and each virtual host gets its own directory as a sub-directory of this base.


Chapter 14

Download 15,21 Mb.

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