Jump to content

Recommended Posts

Posted

Daca aveti un domeniu pe care faceti multe subdomenii pentru development sau mai multe domenii pe doriti sa le mapati ca hosturi virtuale fara sa fie necesar sa dati reload la apache sau sa fiti nevoiti sa adaugati vhost-ul in fisierul de configurare, atunci tutorialul acesta va este de folos.

Sa prespupunem ca aveti un domeniu, de exemplu, "rstcenter.com" iar in home user aveti un director www.

Structura directoare:


/home
/home/tex
/home/tex/www
/home/tex/www/devel1.rstcenter.com
/home/tex/www/devel2.rstcenter.com
/home/tex/www/devel3.rstcenter.com
/home/tex/www/books.rstcenter.com
/home/tex/www/tools.rstcenter.com
.............

Aveti de facut un singur virtual host in apache, apoi orice director creat dupa structura de mai sus, va putea fi utilizat ca virtual host, fara sa fiti nevoiti sa dati restart/reload sau sa adaugati ceva in apache.

Virtual host:


<VirtualHost>
DocumentRoot /home/tex/www
ServerAdmin webmaster@stfu.ro
ServerName rstcenter.com
ServerAlias *.rstcenter.com
CustomLog logs/access_log combined
ErrorLog logs/error_log
RewriteEngine On
RewriteMap lowercase int:tolower
RewriteRule ^/(.*)$ /home/tex/www/${lowercase:%{SERVER_NAME}}/$1
</VirtualHost>

Imi era lene sa tot adaug vhost-uri si sa dau reload pentru un amic cu un buncar de subdomenii utilizate la development. Cu asta, imi pot bea linistit cafelele :D

  • Upvote 1

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...