Jump to content
sleed

Cum sa ti setezi un host virtual pe serverul tau ?

Recommended Posts

In acest tutorial va v-oi arata cum sa setati un host virtual pe apache, Debian/Ubuntu.

In I rand, sa aveti apache2 instalat :

sudo apt-get install apache2

II.Creati un nou director :

sudo mkdir -p /var/www/jepele.com/web

III.Garantati permisiile necesare :

sudo chown -R $USER:$USER /var/www/jepele.com/webl

IV.

sudo chmod -R 755 /var/www
, pentru a avea acces la folderu web din exterior.

V.Apoi cu urmatoarea comanda

sudo nano /var/www/jepele.com/web/index.html
, v-om edita si v-om crea indexul.. Aici ve-ti scrie ce doriti.

VI.Configuram o noua parte a Virtual Hostului :

sudo cp /etc/apache2/sites-available/default /etc/apache2/sites-available/jepele.com

VII. Cu comanda aceasta, v-om porni virtual hostul :

sudo nano /etc/apache2/sites-available/jepele.com

VIII. Sub ServerAdmin , adaugam linia aceasta :

ServerName jepele.com

IX.Va arata cam asa :

<VirtualHost *:80>

ServerAdmin webmaster@jepele.com

ServerName jepele.com

ServerAlias www.jepele.com......

X.Sa fie adaugat Document Root, sub server alias : Exemplu :

DocumentRoot /var/www/jepele.com/web

XI.Actiam modulul prin :

sudo a2ensite jepele.com

XII. Restart Apache : service apache2 restart & /etc/init.d/apache2 restart

Sursa :

+ tastata , dezvoltata de mine. Merge 100 %. Va multumesc!

P.S. in loc de jepele.com , puteti adauga ce vrei voi.

Link to comment
Share on other sites

Pentru development, cred ca v-ar 'coafa' si asta: https://rstforums.com/forum/47252-mass-virtual-hosting-cu-rewrite.rst

Ontopic:

Este bine sa specificati si directivele pentru logging (separate):


ErrorLog ${APACHE_LOG_DIR}/yourwebsite.com-error_log
CustomLog ${APACHE_LOG_DIR}/yourwebsite.com-access_log combined

Edited by aelius
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...