ISPConfig 3使用Xeround云数据库服务
本教程是任何Perfect Server教程的伴侣。 默认情况下,ISPConfig 3将无法与Xeround Cloud数据库服务配合使用。 通过本教程的微小修改,您将无需管理数据库服务器即可运行Perfect Server。
下面的具体示例是在具有ISPConfig 3和nginx的Debian服务器上完成的。 步骤应该与其他发行版类似。 该实例也托管在Rackspace ORD1数据中心。 Amazon数据中心内的实例可能需要不同的配置。 本教程没有任何形式的保证。
初步说明
我创建了一个Xeround实例:
DNS名称:
instanceABCD.db.xeround.com.:7126
内部DNS名称:int.instanceABCD.db.xeround.com.:7126
点击DNS名称将带你到phpMyAdmin。
我将使用内部DNS名称作为我的服务器位于Rackspace ORD1,但如果您的服务器位于其他地方使用DNS名称。 本教程紧接着在Perfect Server教程中开始:
php -q install.php
1端口转发 - 源
Xeround不使用3306的默认端口。最简单的方法是使用端口转发。 这个例子使用了rinetd。
要安装rinetd,只需运行
apt-get install rinetd
我们将HTTP流量从127.0.0.1转发
到int.instanceABCD.db.xeround.com。
。 默认的MySQL端口是3306
,我们的示例端口是7126
。 本地主机将无法使用127.0.0.1。
nano /etc/rinetd.conf
127.0.0.1 3306 int.instanceABCD.db.xeround.com. 7126
现在重新启动rinetd。
/etc/init.d/rinetd restart
然后运行:
netstat -tap
rinetd现在应该运行在端口3306(mysql)上。
Active Internet connections (servers and established)<br>
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 *:ftp *:* LISTEN 9086/pure-ftpd (SER
tcp 0 0 *:ssh *:* LISTEN 1578/sshd
tcp 0 0 localhost.localdom:smtp *:* LISTEN 1207/exim4
tcp 0 0 *:https *:* LISTEN 1192/nginx
tcp 0 0 localhost.localdom:9000 *:* LISTEN 1289/php-fpm: pool
<b>tcp 0 0 localhost.localdo:mysql *:* LISTEN 8700/rinetd</b>
tcp 0 0 *:http-alt *:* LISTEN 1192/nginx
tcp 0 0 *:www *:* LISTEN 1192/nginx
tcp 0 0 *:tproxy *:* LISTEN 1192/nginx
tcp 0 0 localhost.localdom:9010 *:* LISTEN 1291/php-fpm: pool
tcp 1 0 localhost.localdo:38196 localhost.localdo:mysql CLOSE_WAIT 9086/pure-ftpd (SER
tcp6 0 0 [::]:ftp [::]:* LISTEN 9086/pure-ftpd (SER
tcp6 0 0 [::]:ssh [::]:* LISTEN 1578/sshd
tcp6 0 0 ip6-localhost:smtp [::]:* LISTEN 1207/exim4
2配置ISPConfig 3
ISPConfig 3需要进行一些调整,以允许自身访问数据库服务器。 使用server1.example.com
无效。 远程MySQL主机对于任何主机都需要%
。
nano /tmp/ispconfig3_install/install/lib/installer_base.lib.php
...Line 184 if($conf['mysql']['host'] == 'localhost') { $from_host = '%'; } else { $from_host = '%'; } ...Line 1946 (Add second line) $content = rf('tpl/mysql_clientdb.conf.master'); $content = str_replace('localhost',$conf['mysql']['host'],$content);允许在ISPConfig 3中运行创建的数据库的应用程序访问
sed -i 's/localhost/%/g' /tmp/ispconfig3_install/server/plugins-available/mysql_clientdb_plugin.inc.php
我们将使用专家安装ISPConfig 3。
php -q install.php
root@neonpx:/tmp/ispconfig3_install/install# php -q install.php
PHP Deprecated: Comments starting with '#' are deprecated in /etc/php5/cli/conf.d/ming.ini on line 1 in Unknown on line 0
PHP Deprecated: Comments starting with '#' are deprecated in /etc/php5/cli/conf.d/ps.ini on line 1 in Unknown on line 0
--------------------------------------------------------------------------------
_____ ___________ _____ __ _ ____
|_ _/ ___| ___ \ / __ \ / _(_) /__ \
| | \ `--.| |_/ / | / \/ ___ _ __ | |_ _ __ _ _/ /
| | `--. \ __/ | | / _ \| '_ \| _| |/ _` | |_ |
_| |_/\__/ / | | \__/\ (_) | | | | | | | (_| | ___\ \
\___/\____/\_| \____/\___/|_| |_|_| |_|\__, | \____/
__/ |
|___/
--------------------------------------------------------------------------------
>> Initial configuration
Operating System: Debian 6.0 (Squeeze/Sid) or compatible
Following will be a few questions for primary configuration so be careful.
Default values are in [brackets] and can be accepted with <enter>.
Tap in "quit" (without the quotes) to stop the installer.
Select language (en,de) [en]: <-- ENTER
Installation mode (standard,expert) [standard]: <-- expert
Full qualified hostname (FQDN) of the server, eg server1.domain.tld [server1.example.com]: <-- ENTER
MySQL server hostname [localhost]: <-- 127.0.0.1
MySQL root username [root]: <-- yourxeroundadmin
MySQL root password []: <-- yourxeroundadminpassword
MySQL database to create [dbispconfig]: <-- ENTER
MySQL charset [utf8]: <-- ENTER
The next two questions are about the internal ISPConfig database user and password.
It is recommended to accept the defaults which are 'ispconfig' as username and a random password.
If you use a different password, use only numbers and chars for the password.
ISPConfig mysql database username [ispconfig]: <-- ENTER
ISPConfig mysql database password [MbSrzVTpPLRMjes9210ec5f0f1160a65]: <--ENTER
Shall this server join an existing ISPConfig multiserver setup (y,n) [n]: <-- ENTER
Configure Mail (y,n) [y]: <-- ENTER
Configuring Mail
Configure Jailkit (y,n) [y]: <-- ENTER
Configuring Jailkit
Configure FTP Server (y,n) [y]: <-- ENTER
Configuring Pureftpd
Restarting ftp server: Running: /usr/sbin/pure-ftpd-mysql-virtualchroot -l mysql:/etc/pure-ftpd/db/mysql.conf -l pam -Y 1 -p 20000:20100 -b -u 1000 -O clf:/var/log/pure-ftpd/transfer.log -A -E -8 UTF-8 -D -H -B
Configure DNS Server (y,n) [y]: <-- ENTER
Hint: If this server shall run the ISPConfig interface, select 'y' in the 'Configure nginx Server' option.
Configure nginx Server (y,n) [y]: <-- ENTER
Configuring nginx
Configuring Apps vhost
Configure Firewall Server (y,n) [y]: <-- ENTER
Configuring Bastille Firewall
Install ISPConfig Web Interface (y,n) [y]: <-- ENTER
Installing ISPConfig
ISPConfig Port [8080]: <-- ENTER
Enable SSL for the ISPConfig web interface (y,n) [y]: <-- ENTER
Generating RSA private key, 4096 bit long modulus
...++
....++
e is 65537 (0x10001)
You are about to be asked to enter information that will be incorporated
into your certificate request.
What you are about to enter is what is called a Distinguished Name or a DN.
There are quite a few fields but you can leave some blank
For some fields there will be a default value,
If you enter '.', the field will be left blank.
-----
Country Name (2 letter code) [AU]: <-- ENTER
State or Province Name (full name) [Some-State]: <-- ENTER
Locality Name (eg, city) []: <-- ENTER
Organization Name (eg, company) [Internet Widgits Pty Ltd]: <-- ENTER
Organizational Unit Name (eg, section) []: <-- ENTER
Common Name (eg, YOUR name) []: <-- ENTER
Email Address []: <-- ENTER
Please enter the following 'extra' attributes
to be sent with your certificate request
A challenge password []: <-- ENTER
An optional company name []: <-- ENTER
writing RSA key
Configuring DBServer
Installing ISPConfig crontab
Reloading PHP5 FastCGI Process Manager: php5-fpm.
Reloading nginx configuration: nginx.
Installation completed.
现在允许ISPConfig中的数据库链接链接到您的Xeround实例。 用Xeround DNS名称替换下面的地址。
nano /usr/local/ispconfig/interface/web/phpmyadmin/index.php
<?php Header( "HTTP/1.1 301 Moved Permanently" ); Header( "Location: https://cloud.xeround.com/phpMyAdmin/login.php?instanceName=YourInstance&host=instanceABCD.db.xeround.com.&port=7126" ); die(); ?>
如果使用nginx而不是Apache注释掉以下文件中的两行。 这些设置加倍,并将导致重定向循环。
nano /usr/local/ispconfig/server/conf/nginx_vhost.conf.master
# fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; # fastcgi_param PATH_INFO $fastcgi_script_name;
最后,返回到您的Perfect Server教程来配置ISPConfig 3。