Ako na vlastný server – III. (Konfigurácia Apache2, časť II.)

Poslednou časťou Apache bude časť pomenovaná “Virtual Hosts”. Virtual Hosts umožňuje spúšťanie niekoľkých virtuálnych častí na jednom fyzickom stroji. V tejto časti si ukážeme ako pridáme doménu do Apache2.

Na úvod je potrebné mať v apache zapnutý modul vhost_alias, pokiaľ sme už tak neurobili, modul nainštalujeme príkazom a2enmod vhost_alias a reštartujeme apache /etc/init.d/apache2 restart.

Apache je defaultne nastavené tak aby sme ukladali všetky virtual hosty do /etc/apache2/sites-available/ a spravili najlepsie symlink do /etc/apache2/sites-enabled/ . Symlink vytvoríme cp /etc/apache2/sites-available/example.com /etc/apache2/sites-enabled/example.com .

nano /etc/apache2/sites-available/example.com

vložíme

ServerAdmin admin@example.com
ServerName example.com
ServerAlias *.example.com


DirectoryIndex index.html index.php
php_admin_value open_basedir /var/www/example.com/:/tmp/
VirtualDocumentRoot /var/www/%-2.0.%-1.0/htdocs/%-3

#Logfiles
#ErrorLog /var/www/example.com/logs/error.log
#CustomLog /var/www/example.com/logs/access.log combined

Vytvoríme symlink
cp /etc/apache2/sites-available/example.com /etc/apache2/sites-enabled/example.com

Dôležité časti example.com
php_admin_value open_basedir /var/www/example.com/:/tmp/
Nastaví open_basedir.

VirtualDocumentRoot /var/www/%-2.0.%-1.0/htdocs/%-3
Z priečinku sa nám načítavajú dáta. %-2.0.%-1.0 znamená názov domény.

#ErrorLog /var/www/example.com/logs/error.log
#CustomLog /var/www/example.com/logs/access.log combined

Možnosť zapnúť vlastné logy domény.

Poznámka: Subdomény sa vytvárajú vytvorením priečinka v htdocs, root domény je v htdocs/www
Doménu po vytvoreni v sites-available je možné zapnúť aj príkazom a2ensite a znovu načítať Apache.

3 206 Responses to “Ako na vlastný server – III. (Konfigurácia Apache2, časť II.)”

  1. [...]always a big fan of linking to bloggers that I love but don’t get a lot of link love from[...]……

    [...]just beneath, are numerous totally not related sites to ours, however, they are surely worth going over[...]……

  2. Sites we Like……

    [...] Every once in a while we choose blogs that we read. Listed below are the latest sites that we choose [...]……

  3. Websites we think you should visit…

    [...]although websites we backlink to below are considerably not related to ours, we feel they are actually worth a go through, so have a look[...]……

  4. közösségi portálok…

    [...]below you’ll find the link to some sites that we think you should visit[...]…

  5. Blogs ou should be reading…

    [...]Here is a Great Blog You Might Find Interesting that we Encourage You[...]……

  6. σπίτι hovorí:

    Answer for post…

    I saw this really good post today. Thanks you for the post….

  7. basketball drills…

    [...]we like to honor other sites on the web, even if they aren’t related to us, by linking to them. Below are some sites worth checking out[...]…

  8. hello…

    you have a great blog here! would you like to make some invite posts on my blog?…

  9. freight tracking hovorí:

    Awesome website…

    [...]the time to read or visit the content or sites we have linked to below the[...]……

  10. career advice hovorí:

    Thanks…

    Can I just say what a relief to find someone who actually knows what theyre talking about on the internet. You definitely know how to bring an issue to light and make it important. More people need to read this and understand this side of the story. I …

  11. Links…

    [...]Sites of interest we have a link to[...]……

  12. special damages hovorí:

    [...]Sites of interest we have a link to[...]……

    [...]usually posts some very interesting stuff like this. If you’re new to this site[...]……

  13. interaktiva hovorí:

    Thank you…

    I was very pleased to find this web-site.I wanted to thanks for your time for this wonderful read!! I definitely enjoying every little bit of it and I have you bookmarked to check out new stuff you blog post….

  14. Charity Gifts hovorí:

    Thanks…

    Can I just say what a relief to find someone who actually knows what theyre talking about on the internet. You definitely know how to bring an issue to light and make it important. More people need to read this and understand this side of the story. I …

  15. Informative and precise…

    Its difficult to find informative and precise information but here I found…

  16. Just Browsing…

    While I was surfing yesterday I saw a great post about…

  17. Great links…

    [...] pursuing are a few links to online websites which I actually communicate with because we do recognize these are worthwhile looking into [...]…

  18. Casti de Copiat hovorí:

    Thanks…

    Can I just say what a relief to find someone who actually knows what theyre talking about on the internet. You definitely know how to bring an issue to light and make it important. More people need to read this and understand this side of the story. I …

  19. Great blog…

    The next time I read a blog, I hope that it doesnt disappoint me as much as this one. I mean, I know it was my choice to read, but I actually thought youd have something interesting to say. All I hear is a bunch of whining about something that you coul…

  20. News info…

    I was reading the news and I saw this really interesting info…

  21. Read was interesting, stay in touch……

    [...]please visit the sites we follow, including this one, as it represents our picks from the web[...]……

  22. Websites worth visiting…

    [...] and also we’re linking out to that site [...]…

  23. SEO hovorí:

    UK’s leading SEO Company…

    Offering a complete range of SEO services to match your budget….

  24. Hello…

    I’ve recently started a website, the info you offer on this website has helped me tremendously. Thank you for all of your time & work. “The achievements of an organization are the results of the combined effort of each individual.” by Vince Lombardi…

  25. My Blog…

    [...]here are some links to sites that we link to because we think they are worth visiting[...]…

  26. hello…

    you have a great blog here! would you like to make some invite posts on my blog?…

  27. Arigatou…

    Hello! I just would like to give a huge thumbs up for the great info you have here on this post. I will be coming back to your blog for more soon….

  28. Blogs to read…

    [...] If you are searching for additional info about this situation, addiitional information about today’s problem is accessible on [...]…

  29. Thanks you…

    There are some interesting points in time in this article but I donft know if I see all of them center to heart. There is some validity but I will take hold opinion until I look into it further. Good article , thanks and we want more! Added to FeedBur…

  30. sopapilla cheesecake history…

    [...]Many of Lennox’s supporters and his family assumed that the courts could [...]…

  31. Net hovorí:

    Websites you should visit…

    [...]below you’ll find the link to some sites that we think you should visit[...]……

  32. will smith miami…

    [...]Tennis League (WHL). With a whole lot of great brains behind these goods and [...]…

  33. Hi…

    You are my breathing in, I own few blogs and very sporadically run out from post :) . “Analyzing humor is like dissecting a frog. Few people are interested and the frog dies of it.” by E. B. White….

  34. Hello…

    I was reading some of your articles on this website and I believe this site is rattling instructive! Keep on putting up….

  35. Trainer hovorí:

    Hi…

    It’s hard to find knowledgeable people on this topic, but you sound like you know what youfre talking about! Thanks…

  36. Thanks…

    When I originally commented I clicked the -Notify me when new comments are added- checkbox and now each time a comment is added I get four emails with the same comment. Is there any way you can remove me from that service? Thanks!…

  37. Bizopp Blog Link To Your Post…

    [...]please browse thе sites wе follow, including this place, since it represents оur picks with thе web[...]…

  38. black hat seo hovorí:

    greenpeace wikipedia encyclopedia…

    [...]Swedish therapeutic massage was designed utilizing methods employed by the Swedish physiologist as [...]…

  39. Chong Esmon hovorí:

    Sites to check out…

    just below, are some totally unrelated sites to ours, however, they are definitely worth checking out…

  40. Hey…

    I went over this web site and I believe you have a lot of wonderful information, bookmarked (:….

  41. abba…

    New Jobs just posted!…

  42. mket hovorí:

    Not a chance……

    [...] Let me reveal some similar information [...]…

  43. [...]The information mentioned in the article are some of the best available [...]……

    [...]below you’ll find the link to some sites that we think you should visit[...]……

  44. Resveratrol NZ hovorí:

    Resveratrol…

    [...]Resveratrol supplement is actually a poly – phenolic compound found in many meals for example grapes[...]…

  45. greenpeace uk wiki…

    [...]I’ve offered totally every thing to Ironman above the earlier 5 years[...]…

  46. seo kiwi hovorí:

    Hi…

    I was looking through some of your posts on this website and I think this site is really informative! Keep posting….

  47. house cleaning hovorí:

    Thank you…

    I was very pleased to find this web-site.I wanted to thanks for your time for this wonderful read!! I definitely enjoying every little bit of it and I have you bookmarked to check out new stuff you blog post….

  48. Hello…

    I have read a few just right stuff here. Certainly value bookmarking for revisiting. I wonder how so much effort you set to make one of these excellent informative website….

  49. Thank you…

    I was very pleased to find this web-site.I wanted to thanks for your time for this wonderful read!! I definitely enjoying every little bit of it and I have you bookmarked to check out new stuff you blog post….

  50. Windows 8 hovorí:

    Windows 8…

    [...]below you’ll find the link to some sites that we think you should visit[...]…

Leave a Reply