Instructions on multi-site configuration (also known as "multisite" and "single code base" installations) can be found within the installation instructions.
Here we go:
开始:
[login via ssh / PuTTY]
用ssh/putty远程登录
LINUX系统为:Debian (Ubuntu)
Installation
Assumption: apache2 and mysql are already installed. If not, use apt-get install to install and configure them.
安装
假设:apache2,mysql已经安装。(如果没有,上网搜吧)
# apt-get install drupal6
该命令是安装drupal6
Answer the questions. This will install everything necessary to run drupal and do the basic configuration, including creating an empty database for drupal.
回答以下问题。以下将安装运行drupal所有必要的文件,进行基本的配置 ,并创建一个空数据库。
* Configure database for drupal6 with dbconfig-common? [YES] 是否配置drupal6的数据库
* Database type to be used by drupal6: [mysql] 选择数据库
* Password of your database's administrative user: [enter mysql root password] MYSQL数据库密码
* MySQL application password for drupal6: [create a password for your drupal6 db] 为DRUPAL数据库设密码
* (enter the password again for verification) 确认密码
You now have a basic unconfigured Drupal6 installation using the database drupal6 and accessible at http://www.example.com/drupal6. Do not use it. This is the "prototype" installation that we will use to create the sites we really want to use.
你现在有一个基本的未配置的drupal6安装程序,使用数据库drupal6,可用http://www.example.com/drupal6进行安装。但先不使用。这是一个安装原型,我们要用它来创建我们要用的站点。
The easiest way to create databases for your sites is to use dpkg-reconfigure and answer the questions.
# dpkg-reconfigure drupal6
* Re-install database for drupal6? [YES]
* Database type to be used by drupal6: [mysql]
* Connection method for MySQL database of drupal6: [unix socket]
* Name of your database's administrative user: [root]
* Password of your database's administrative user: [enter mysql root password]
* username for drupal6: [ENTER YOUR DB SITE *USERNAME* HERE (e.g. mysite)]
* database name for drupal6: [ENTER YOUR DB *SITE* NAME HERE (e.g. mysite)]
1. Repeat the above for each site you want to support.
2. I used the same name for the database and the site. KISS.
3. Don't use periods (e.g. mysite.com is a bad choice). If you want to spell out the whole name, use underscores instead of periods (e.g. mysite_com).
4. The above method ends up using the same site database password for all the sites you create. Advice: use mysql-admin (or mysql) to use different passwords for each site.
Configure Apache2 for Sites
Apache2 needs to be configured to support vhost access to your new sites.
Create vhost site configuration files in /etc/apache2/sites-available/
配置apache2
apache2 需要配置来支持虚拟主机 连接你的新站点。
将创建虚拟主机的配置文件 放在/etc/apache2/sites-available/
DocumentRoot /usr/share/drupal6/ ServerName [your vhost#1 name] ServerAlias [if you want to support www.example.com and example.com] RewriteEngine On RewriteOptions inherit </VirtualHost>
DocumentRoot /usr/share/drupal6/ ServerName [your vhost#2 name] ServerAlias [if you want to support www.example1.com and example1.com] RewriteEngine On RewriteOptions inherit </VirtualHost>
[...repeat for all your vhosts]
Notes:
* Modify the above items that are in [square brackets].
* You likely will want to support port 443 (https) as well. See Apache documentation for detailed instructions.
* I've chosen to put all the vhosts in one file named drupal. You may want to use one file per vhost.
注意:
1 修改在 方括号[ ] 中 的内容
2 如果要支持443端口(https),参考apache的文档。
3 我把所有的虚拟主机放在一个文件中,名为drupal.你也可以为不同的虚拟主机创建不同的文件
Sym-link the drupal file in the sites-enabled directory to enable it in your site:
# cd /etc/apache2/sites-enabled # ln -s ../sites-available/drupal .
...and reload Apache2 to pick up your configuration changes...
Create Drupal Site Configurations
创建drupal站点的配置
We need to create Drupal configurations for each site by copying the default configuration to the Drupal site subdirectory.
我们需要为每个站点创建drupal配置,在drupal的 site 文件夹下复制默认的配置文件
# cd /etc/drupal/6/sites/ # cp -a default [site1.com] # cp -a default [site2.com] : :
...and edit the configurations to use the right database, MySQL user name, and password...
然后 编辑配置文件 使用相对应的数据库,mysql的用户名,密码
# vi site1.com/dbconfig.php # vi site2.com/dbconfig.php : :
Notes:
* Modify the above items that are in [square brackets].
修改在 方括号中 的内容。
Run Drupal and Configure Your Sites
Browse to your sites, running install.php (e.g. http://www.example.com/install.php) to configure them.
安装drupal和配置
在浏览器访问 install.php 配置
Manual
手册
Get to location where Drupal core will be located:
到站点的主文件夹
[/]# cd /var/www
Upload Drupal core:
上传代码
"x.x" should be replaced with the version of Drupal you're installing, e.g. "5.2"
"x.x"代表drupal的版本号,用具体的值代替。
Change permission of "settings.php" per Drupal instructions and copy "settings.php" in default to www.mydomain.tld:
每一个drupal的安装,都 要 更改 settings.php的权限,复制默认的settings.php
* Make changes to "settings.php" in www.mydomain.tld? I've read that it's not necessary to make changes to setting.php.
* Make changes to "httpd.conf" in /usr/local/apache/conf?
I've been using WHM to create accounts, putting Drupal in public_html and having no problems. But when it comes to parting from the WHM abstraction and getting multisite set-up correctly this is the end of the proverbial road for me.
哪位大哥给翻译下吧
哪位大哥给翻译下吧。写个教程啥的。
__________________________
我要减肥螺旋藻
__________________________
天然螺旋藻,健康好生活
翻译下
Instructions on multi-site configuration (also known as "multisite" and "single code base" installations) can be found within the installation instructions.
Here are some useful links:
多站点的配置(包括“多站点”和“基于单一代码”)操作指南可以在安装指南中找到。以下一些有帮助的链接:
* Search results
* 4.6 Multi-Site from single code base
* Multi-Site .htaccess configuration
* multi-site, single installation, shared db, single sign on. is this possible?
* Automatic Multi-site registration
* Using Multi-Site
* Multihosting Off Single Codebase
* Multisite and symlinks doesn't work
* Sharing tables between installations
10 Minute Multisite Install & Configuration
10分钟多站点的安装和配置
Multisite 10 minute Install:
* Server: LAMP
* SSH (telnet) Client: ssh (PuTTY if you are using Windows to access your LAMP host)
* Must have root access to your server.
10分钟安装多站点:
1 服务器环境:LAMP
2 SSH(远程连接)客户端:ssh(windows 用 PUTTY 连接)
3 有root权限
If website in question is an addon domain, i.e., addon.mydomain.tld, then substitute "addon" for "www" in steps below.
For list of Linux commands visit: http://www.oreillynet.com/linux/cmd/ or http://www.ss64.com/bash/
如果站点是 附加域,即 addom.mydomain.tld 形式,那么子站点域名附加在"www"后。
LINUX的命行参看http://www.oreillynet.com/linux/cmd/ 或 http://www.ss64.com/bash/
Here we go:
开始:
[login via ssh / PuTTY]
用ssh/putty远程登录
LINUX系统为:Debian (Ubuntu)
Installation
Assumption: apache2 and mysql are already installed. If not, use apt-get install to install and configure them.
安装
假设:apache2,mysql已经安装。(如果没有,上网搜吧)
# apt-get install drupal6该命令是安装drupal6
Answer the questions. This will install everything necessary to run drupal and do the basic configuration, including creating an empty database for drupal.
回答以下问题。以下将安装运行drupal所有必要的文件,进行基本的配置 ,并创建一个空数据库。
* Configure database for drupal6 with dbconfig-common? [YES] 是否配置drupal6的数据库
* Database type to be used by drupal6: [mysql] 选择数据库
* Password of your database's administrative user: [enter mysql root password] MYSQL数据库密码
* MySQL application password for drupal6: [create a password for your drupal6 db] 为DRUPAL数据库设密码
* (enter the password again for verification) 确认密码
You now have a basic unconfigured Drupal6 installation using the database drupal6 and accessible at http://www.example.com/drupal6. Do not use it. This is the "prototype" installation that we will use to create the sites we really want to use.
你现在有一个基本的未配置的drupal6安装程序,使用数据库drupal6,可用http://www.example.com/drupal6进行安装。但先不使用。这是一个安装原型,我们要用它来创建我们要用的站点。
研博专业课资料库--淘宝店
--------------------------------------------------------------------------------------------------------
翻译中
Create Site Databases
The easiest way to create databases for your sites is to use dpkg-reconfigure and answer the questions.
# dpkg-reconfigure drupal6* Re-install database for drupal6? [YES]
* Database type to be used by drupal6: [mysql]
* Connection method for MySQL database of drupal6: [unix socket]
* Name of your database's administrative user: [root]
* Password of your database's administrative user: [enter mysql root password]
* username for drupal6: [ENTER YOUR DB SITE *USERNAME* HERE (e.g. mysite)]
* database name for drupal6: [ENTER YOUR DB *SITE* NAME HERE (e.g. mysite)]
创建站点数据库
为你的站点创建数据库,最简单的方法是用 dpkg-reconfigure命令并回答以下问题.
省略中......
Notes:
1. Repeat the above for each site you want to support.
2. I used the same name for the database and the site. KISS.
3. Don't use periods (e.g. mysite.com is a bad choice). If you want to spell out the whole name, use underscores instead of periods (e.g. mysite_com).
4. The above method ends up using the same site database password for all the sites you create. Advice: use mysql-admin (or mysql) to use different passwords for each site.
注意:
1 重复上面(指 创建站点数据库)为你想要的每一个站点。
2 站点和数据库名称一致
3 不要使用periods(比如 mysite.com是一个坏选择)。如果你真想用全名,用下划线代替periods(比如 mysite_com). //这里可能指数据库名。
4 以上方法都失效,如果你所有的网站数据库都用相同的密码。建议:用mysql-admin 为每个站点使用不同的密码。
Configure Apache2 for Sites
Apache2 needs to be configured to support vhost access to your new sites.
Create vhost site configuration files in /etc/apache2/sites-available/
配置apache2
apache2 需要配置来支持虚拟主机 连接你的新站点。
将创建虚拟主机的配置文件 放在/etc/apache2/sites-available/
#
# Virtual hosting configuration for Drupal
#
<VirtualHost *:80>
ServerAdmin [your email address]
DocumentRoot /usr/share/drupal6/
ServerName [your vhost#1 name]
ServerAlias [if you want to support www.example.com and example.com]
RewriteEngine On
RewriteOptions inherit
</VirtualHost>
<VirtualHost *:80>
ServerAdmin [your email address]
DocumentRoot /usr/share/drupal6/
ServerName [your vhost#2 name]
ServerAlias [if you want to support www.example1.com and example1.com]
RewriteEngine On
RewriteOptions inherit
</VirtualHost>
[...repeat for all your vhosts]
Notes:
* Modify the above items that are in [square brackets].
* You likely will want to support port 443 (https) as well. See Apache documentation for detailed instructions.
* I've chosen to put all the vhosts in one file named drupal. You may want to use one file per vhost.
注意:
1 修改在 方括号[ ] 中 的内容
2 如果要支持443端口(https),参考apache的文档。
3 我把所有的虚拟主机放在一个文件中,名为drupal.你也可以为不同的虚拟主机创建不同的文件
Sym-link the drupal file in the sites-enabled directory to enable it in your site:
# cd /etc/apache2/sites-enabled# ln -s ../sites-available/drupal .
...and reload Apache2 to pick up your configuration changes...
# /etc/init.d/apache2 reload为文件 drupal 创建符号链接 到sites-enabled文件夹,使你的站点可用。重启apache2
研博专业课资料库--淘宝店
--------------------------------------------------------------------------------------------------------
翻译上
Create Drupal Site Configurations
创建drupal站点的配置
We need to create Drupal configurations for each site by copying the default configuration to the Drupal site subdirectory.
我们需要为每个站点创建drupal配置,在drupal的 site 文件夹下复制默认的配置文件
# cd /etc/drupal/6/sites/# cp -a default [site1.com]
# cp -a default [site2.com]
:
:
...and edit the configurations to use the right database, MySQL user name, and password...
然后 编辑配置文件 使用相对应的数据库,mysql的用户名,密码
# vi site1.com/dbconfig.php# vi site2.com/dbconfig.php
:
:
Notes:
* Modify the above items that are in [square brackets].
修改在 方括号中 的内容。
Run Drupal and Configure Your Sites
Browse to your sites, running install.php (e.g. http://www.example.com/install.php) to configure them.
安装drupal和配置
在浏览器访问 install.php 配置
Manual
手册
Get to location where Drupal core will be located:
到站点的主文件夹
[/]# cd /var/wwwUpload Drupal core:
上传代码
"x.x" should be replaced with the version of Drupal you're installing, e.g. "5.2"
"x.x"代表drupal的版本号,用具体的值代替。
[/var/www]# wget http://ftp.osuosl.org/pub/drupal/files/projects/drupal-x.x.tar.gz
Unpack Drupal core:
解压
[/var/www]# tar -zxvf drupal-5.2.tar.gzMove contents of Drupal core (including .htaccess) to html:
移动drupal源文件(包括.htaccess)到html文件夹下
[/var/www]# mv drupal-x.x/* drupal-x.x/.htaccess /var/www/htmlClean-up:
删除
[/var/www]# rm drupal-x.x.tar.gz
[/var/www]# rm drupal-5.2
Create the files directory per Drupal instructions and change permissions (will change permission again after install):
创建文件夹,更修权限
[/var/www]# cd html
[/var/www/html]# mkdir files
[/var/www/html]# chmod 777 files
Make directories that will hold custom and contributes modules and themes:
为模块和主题,创建自定义和发布的文件夹
[/var/www/html]# cd sites/all
[/var/www/html/sites/all]# mkdir modules
[/var/www/html/sites/all]# mkdir themes
[/var/www/html/sites/all]# cd modules
[/var/www/html/sites/all/modules]# mkdir custom
[/var/www/html/sites/all/modules]# mkdir contrib
[/var/www/html/sites/all/modules]# cd ../
[/var/www/html/sites/all]# cd themes
[/var/www/html/sites/all/themes]# mkdir custom
[/var/www/html/sites/all/themes]# mkdir contrib
Create directory "www.mydomain.tld":
创建 站点文件夹
[/var/www/html/sites/all/themes]# cd ../
[/var/www/html/sites/all]# cd ../
[/var/www/html/sites]# mkdir www.mydomain.com
Change permission of "settings.php" per Drupal instructions and copy "settings.php" in default to www.mydomain.tld:
每一个drupal的安装,都 要 更改 settings.php的权限,复制默认的settings.php
[/var/www/html/sites]# cd default
[/var/www/html/sites/default]# chmod 777 settings.php
[/var/www/html/sites/default]# cd ../
[/var/www/html/sites]# cp -a default www.mydomain.tld
Create database and user with permissions:
为每个站点创建数据库
[/var/www/html/sites]# mysql
mysql> CREATE DATABASE wwwmydomaintld_drupal;
mysql> GRANT ALL PRIVILEGES ON wwwmydomaintld_drupal.* TO 'wwwmydomaintld_myusername'@'localhost' IDENTIFIED BY 'mypassword';
mysql> \q
Go back to PuTTY to chmod on settings.php in www.mydomain.tld:
回到putty并改回settings.php的权限
[/var/www/html/sites]# cd www.mydomain.tld
[/var/www/html/sites/www.mydomain.tld]# chmod 755 settings.php
[/var/www/html/sites/www.mydomain.tld]# logout
研博专业课资料库--淘宝店
--------------------------------------------------------------------------------------------------------
翻译结束
What next?:
* Make changes to "settings.php" in www.mydomain.tld? I've read that it's not necessary to make changes to setting.php.
* Make changes to "httpd.conf" in /usr/local/apache/conf?
I've been using WHM to create accounts, putting Drupal in public_html and having no problems. But when it comes to parting from the WHM abstraction and getting multisite set-up correctly this is the end of the proverbial road for me.
接下来干什么?
1 需要改www.mydomain.tld的"settings.php"?我所知道的没有必要改setting.php.
2 需要改httpd.conf?
我用WHM来创建账号,把drupal放在public_html,没有问题。(后面不清楚,可能指出问题)
研博专业课资料库--淘宝店
--------------------------------------------------------------------------------------------------------
学习了^^
学习了^^
------
我的太阳|放松心灵,开拓明天 http://cuijinlin.cn/
——离开大学时,相信我们最大的收获不是对什么都没有的忍耐和适应,而是对什么都可以拥有的自信和渴望!