Birmingham mumbai



Download 15,21 Mb.
Pdf ko'rish
bet472/482
Sana13.01.2022
Hajmi15,21 Mb.
#355107
1   ...   468   469   470   471   472   473   474   475   ...   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)

[
 367 
]
Just as with Apache, the 
sites-available
 directory houses configuration files for 
sites that 
can be
 enabled, while the 
sites-enabled
 directory stores configuration 
files for sites that are enabled. Unlike Apache, though, we don't have dedicated 
commands to enable these sites. We have to link them manually. Although we 
haven't even looked at NGINX configuration files yet, let's just assume that we have 
created the following configuration file:
/etc/nginx/sites-available/acmesales.com
To enable that site, we would need to create a symbolic link for it and store that link 
in the 
/etc/nginx/sites-enabled
 directory:
sudo ln -s /etc/nginx/sites-available/acmesales.com /etc/nginx/sites-
enabled/acmesales.com
Then, we can reload 
nginx
:
sudo systemctl reload nginx
As it stands right now, a site configuration file named 
default
 exists in 
/etc/nginx/
sites-available
 and a symbolic link to it is already present in 
/etc/nginx/sites-
enabled
. If all we want to do is host a single site, we only need to replace the default 
content that NGINX serves, which is located in the 
/var/www/html
 directory (the same 
as Apache) with the content for our site. After refreshing the page, we're good to go.
If we want to serve more than one site from one server, the 
default
 file is a great 
starting point for creating additional virtual hosts. We can start by copying it to a 
new name:
sudo cp /etc/nginx/sites-available/default /etc/nginx/sites-available/
acmesales.com
Now, we can edit this file and change it to serve additional content. First of all, 
only one site can be referred to as a 
default
 site. A default site in NGINX is one that 
answers if none of the other sites match a request. Therefore, we want to remove 
both occurrences of 
default_server
 from our newly copied config. Find these lines:
listen 80 default_server;
listen [::]:80 default_server;
Obviously, 
acmesales.com
 is an example, so feel free to name this 
whatever you wish.


Serving Web Content

Download 15,21 Mb.

Do'stlaringiz bilan baham:
1   ...   468   469   470   471   472   473   474   475   ...   482




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©www.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