Local Drupal MultiSite Set-up
-
Upload
manuel-felix-g-abejo-jr -
Category
Technology
-
view
316 -
download
3
description
Transcript of Local Drupal MultiSite Set-up
![Page 1: Local Drupal MultiSite Set-up](https://reader035.fdocuments.in/reader035/viewer/2022062705/556411e9d8b42a080c8b5221/html5/thumbnails/1.jpg)
Drupal MultiSites
Jun Abejo
Site-Admin, http://fpdphils.org
Education and Learning Specialist
Foundations for People Dev, Inc. (FPD)
Drupal User since 2008
![Page 2: Local Drupal MultiSite Set-up](https://reader035.fdocuments.in/reader035/viewer/2022062705/556411e9d8b42a080c8b5221/html5/thumbnails/2.jpg)
Instruction on Multisite Set-up can be found in INSTALL.txt
MULTISITE CONFIGURATION-----------------------
A single Drupal installation can host several Drupal-powered sites, each with its own individual configuration.
Additional site configurations are created in subdirectories within the 'sites'directory. Each subdirectory must have a 'settings.php' file, which
specifiesthe configuration settings. The easiest way to create additional sites is tocopy the 'default' directory and modify the 'settings.php' file as
appropriate.The new directory name is constructed from the site's URL. The
configuration for www.example.com could be in 'sites/example.com/settings.php' (note that 'www.' should be omitted if users can access your site at http://example.com/).
Drupal MultiSites
![Page 3: Local Drupal MultiSite Set-up](https://reader035.fdocuments.in/reader035/viewer/2022062705/556411e9d8b42a080c8b5221/html5/thumbnails/3.jpg)
Sites do not have to have a different domain. You can also use subdomains and subdirectories for Drupal sites. For example, example.com, sub.example.com, and sub.example.com/site3 can all be defined as independent Drupal sites. The setup for a configuration such as this would look like the following:
sites/default/settings.php sites/example.com/settings.php sites/sub.example.com/settings.php sites/sub.example.com.site3/settings.php
When searching for a site configuration (for example www.sub.example.com/site3), Drupal will search for configuration files in the following order, using the first configuration it finds:
Drupal MultiSites
![Page 4: Local Drupal MultiSite Set-up](https://reader035.fdocuments.in/reader035/viewer/2022062705/556411e9d8b42a080c8b5221/html5/thumbnails/4.jpg)
sites/www.sub.example.com.site3/settings.php sites/sub.example.com.site3/settings.php sites/example.com.site3/settings.php sites/www.sub.example.com/settings.php sites/sub.example.com/settings.php sites/example.com/settings.php sites/default/settings.php
If you are installing on a non-standard port, the port number is treated as the deepest subdomain. For example: http://www.example.com:8080/ could be loaded from sites/8080.www.example.com/. The port number will be removed according to the pattern above if no port-specific configuration is found, just like a real subdomain.
Drupal MultiSites
![Page 5: Local Drupal MultiSite Set-up](https://reader035.fdocuments.in/reader035/viewer/2022062705/556411e9d8b42a080c8b5221/html5/thumbnails/5.jpg)
Each site configuration can have its own site-specific modules and themes in addition to those installed in the standard 'modules' and 'themes' directories. To use site-specific modules or themes, simply create a 'modules' or 'themes' directory within the site configuration directory. For example, if sub.example.com has a custom theme and a custom module that should not be accessible to other sites, the setup would look like this:
sites/sub.example.com/ settings.php themes/custom_theme modules/custom_module
NOTE: for more information about multiple virtual hosts or the configuration settings, consult http://drupal.org/getting-started/6/install/multi-site
For more information on configuring Drupal's file system path in a multisite configuration, see step 6 above.
Drupal MultiSites
![Page 6: Local Drupal MultiSite Set-up](https://reader035.fdocuments.in/reader035/viewer/2022062705/556411e9d8b42a080c8b5221/html5/thumbnails/6.jpg)
Each site configuration can have its own site-specific modules and themes in addition to those installed in the standard 'modules' and 'themes' directories. To use site-specific modules or themes, simply create a 'modules' or 'themes' directory within the site configuration directory. For example, if sub.example.com has a custom theme and a custom module that should not be accessible to other sites, the setup would look like this:
sites/sub.example.com/ settings.php themes/custom_theme modules/custom_module
NOTE: for more information about multiple virtual hosts or the configuration settings, consult http://drupal.org/getting-started/6/install/multi-site
For more information on configuring Drupal's file system path in a multisite configuration, see step 6 above.
Drupal MultiSites
![Page 7: Local Drupal MultiSite Set-up](https://reader035.fdocuments.in/reader035/viewer/2022062705/556411e9d8b42a080c8b5221/html5/thumbnails/7.jpg)
Drupal Multi-Site
![Page 8: Local Drupal MultiSite Set-up](https://reader035.fdocuments.in/reader035/viewer/2022062705/556411e9d8b42a080c8b5221/html5/thumbnails/8.jpg)
Why?
●For easy updating
●Ease in setting up many sandboxes
●Ease in trying out distros
![Page 9: Local Drupal MultiSite Set-up](https://reader035.fdocuments.in/reader035/viewer/2022062705/556411e9d8b42a080c8b5221/html5/thumbnails/9.jpg)
Drupal Multi-Site
![Page 10: Local Drupal MultiSite Set-up](https://reader035.fdocuments.in/reader035/viewer/2022062705/556411e9d8b42a080c8b5221/html5/thumbnails/10.jpg)
Drupal Multi-Site
A single Drupal installation can host several Drupal-powered
sites, each with its own individual configuration.
![Page 11: Local Drupal MultiSite Set-up](https://reader035.fdocuments.in/reader035/viewer/2022062705/556411e9d8b42a080c8b5221/html5/thumbnails/11.jpg)
Outline of this talk
● installing a local webserver
● setting-up a local virtual host
● setting-up several Drupal sites
![Page 12: Local Drupal MultiSite Set-up](https://reader035.fdocuments.in/reader035/viewer/2022062705/556411e9d8b42a080c8b5221/html5/thumbnails/12.jpg)
Webserver
A computer software that could make available data, info, files
for downloading by a web browser, another computer
software.
![Page 13: Local Drupal MultiSite Set-up](https://reader035.fdocuments.in/reader035/viewer/2022062705/556411e9d8b42a080c8b5221/html5/thumbnails/13.jpg)
Webserver
Tim Berners-Lee invented the first web server software.
![Page 14: Local Drupal MultiSite Set-up](https://reader035.fdocuments.in/reader035/viewer/2022062705/556411e9d8b42a080c8b5221/html5/thumbnails/14.jpg)
Webserver
Apache is the most used webserver
![Page 15: Local Drupal MultiSite Set-up](https://reader035.fdocuments.in/reader035/viewer/2022062705/556411e9d8b42a080c8b5221/html5/thumbnails/15.jpg)
Webserver
Webservers most of the time run in Linux machines.
![Page 16: Local Drupal MultiSite Set-up](https://reader035.fdocuments.in/reader035/viewer/2022062705/556411e9d8b42a080c8b5221/html5/thumbnails/16.jpg)
Webserver
XAMPP is one of the most popular portable webserver package.
![Page 17: Local Drupal MultiSite Set-up](https://reader035.fdocuments.in/reader035/viewer/2022062705/556411e9d8b42a080c8b5221/html5/thumbnails/17.jpg)
Webserver
DEMO
![Page 18: Local Drupal MultiSite Set-up](https://reader035.fdocuments.in/reader035/viewer/2022062705/556411e9d8b42a080c8b5221/html5/thumbnails/18.jpg)
Webserver
● Download a copy from https://www.apachefriends.org/
● Read instructions available in Apachefriends.
● Install
![Page 19: Local Drupal MultiSite Set-up](https://reader035.fdocuments.in/reader035/viewer/2022062705/556411e9d8b42a080c8b5221/html5/thumbnails/19.jpg)
Outline of this talk
● installing a local webserver
● setting-up a local virtual host
● setting-up several Drupal sites
![Page 20: Local Drupal MultiSite Set-up](https://reader035.fdocuments.in/reader035/viewer/2022062705/556411e9d8b42a080c8b5221/html5/thumbnails/20.jpg)
Virtual Host
Advantages
●Freedom to try out different domain names●Freedom to designate any folder as
DocumentRoot●Freedom to designate as many folder as
DocumentRoot
![Page 21: Local Drupal MultiSite Set-up](https://reader035.fdocuments.in/reader035/viewer/2022062705/556411e9d8b42a080c8b5221/html5/thumbnails/21.jpg)
Virtual Host in XAMPP
1.“httpd-vhosts.conf” found inWindows=>C:\xampp\apache\conf\extra\Linux=>/opt/lampp/etc/extra/
2.“hosts” found inWindows=>C:\Windows\System32\drivers\etc\Linux=>/etc/
Files to Edit
![Page 22: Local Drupal MultiSite Set-up](https://reader035.fdocuments.in/reader035/viewer/2022062705/556411e9d8b42a080c8b5221/html5/thumbnails/22.jpg)
Virtual Host in XAMPP
NameVirtualHost *:80
<VirtualHost *:80> DocumentRoot "C:/xampp/htdocs" ServerName localhost</VirtualHost>
httpd-vhosts.confComment out (#) all the default text in the file and Input the following right after the last commented line (#).
![Page 23: Local Drupal MultiSite Set-up](https://reader035.fdocuments.in/reader035/viewer/2022062705/556411e9d8b42a080c8b5221/html5/thumbnails/23.jpg)
Virtual Host in XAMPP
<VirtualHost *:80> DocumentRoot "C:Documents and Settings\junabejo\My Documents\Demosites" ServerName demo.local ServerAlias *.demo.local <Directory "C:Documents and Settings\junabejo\My Documents\Demosites"> Options Indexes FollowSymLinks Includes ExecCGI AllowOverride All Allow from all Require all granted </Directory></VirtualHost>
httpd-vhosts.conf
Then, Input the following ...
![Page 24: Local Drupal MultiSite Set-up](https://reader035.fdocuments.in/reader035/viewer/2022062705/556411e9d8b42a080c8b5221/html5/thumbnails/24.jpg)
Virtual Host in XAMPP
127.0.0.1 localhost127.0.0.1 domainname.loc127.0.0.1 domainname.local127.0.0.1 domainname.dev127.0.0.1 domainname.ass127.0.0.1 domainname.build127.0.0.1 subdomain1.domainname.loc127.0.0.1 subdomain2.domainname.loc127.0.0.1 subdomain3.domainname.loc127.0.0.1 subdomain4.domainname.loc127.0.0.1 subdomain5.domainname.loc127.0.0.1 subdomain6.domainname.loc
hostsEdit hosts file by adding all the local subdomain names you wanted to setup.Examples of site names are as follows....
![Page 25: Local Drupal MultiSite Set-up](https://reader035.fdocuments.in/reader035/viewer/2022062705/556411e9d8b42a080c8b5221/html5/thumbnails/25.jpg)
Virtual Host in XAMPP
After editing httpd-vhosts.conf and/or hosts, restart webserver
![Page 26: Local Drupal MultiSite Set-up](https://reader035.fdocuments.in/reader035/viewer/2022062705/556411e9d8b42a080c8b5221/html5/thumbnails/26.jpg)
●Extract one Drupal package in your “DocumentRoot” of the Virtual Host
●Copy and rename “default” folder found in “sites” folder to
names of your local site-names●Change permission of “default” folder to writable by all or
chmod 777.●Read instructions in example.sites.php●Rename example.sites.php to sites.php●Edit accordingly sites.php●Input in sites.php all the site-names and aliases.
Drupal MultiSites
![Page 27: Local Drupal MultiSite Set-up](https://reader035.fdocuments.in/reader035/viewer/2022062705/556411e9d8b42a080c8b5221/html5/thumbnails/27.jpg)
Drupal MultiSites
![Page 28: Local Drupal MultiSite Set-up](https://reader035.fdocuments.in/reader035/viewer/2022062705/556411e9d8b42a080c8b5221/html5/thumbnails/28.jpg)
●Run in the Browser URL box http://local-domain-name/install.php to install a Drupal site.
Drupal MultiSites
![Page 29: Local Drupal MultiSite Set-up](https://reader035.fdocuments.in/reader035/viewer/2022062705/556411e9d8b42a080c8b5221/html5/thumbnails/29.jpg)
DEMO
Drupal MultiSites