建立在Zend Framework的SaaS应用程序 [英] Building a SaaS application on Zend Framework

查看:182
本文介绍了建立在Zend Framework的SaaS应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在建设使用Zend Framework在PHP中的SaaS应用程序的方式。下面是该项目的基本信息。其项目管理系统的SaaS模式。当用户在网站上注册,他们将得到一个域名类似的格式为:

user_name.pms.com

用户名 - 当用户注册的项目管理系统(PMS)

选择的用户名

pms.com - 是主要的SaaS服务器。

目前我们提供的子域名我们的服务器上。而对于大公司,也不会好看,他们可以preFER得到这个默认的一个自己的域名来代替。所以有可能是:

user_name.pms.com [总是present]

user1.com [自定义或用户的独立域名]这个自定义域需要连接到默认用户的URL。

完整的网站正在计划使用Zend Framework开发。

在Zend框架,我们正在对用于其工作的根文件夹下面的.htaccess,是如下:

  SETENV APPLICATION_ENV发展
RewriteEngine叙述上
重写规则。*的index.php
 

下面是我的问题:

  1. 我真的需要创建子域名就像个人资料网址为所有用户一旦注册在网站上?

  2. 如果它需要创建子域名,可以PHP检查所选择的子领域是否存在,并且可以从脚本本身创建子域名?

  3. 如果没有必要子域名,可以在Zend的安装使用.htaccess的,我们达到同样的目标?

  4. 可以提供HT访问code的执行以下操作:

user_name1.pms.com需要重定向到pms.com

user_name1.pms.com/contact需要重定向到pms.com/contact

也就是在子域名一样网址的任何请求都必须重定向到的格式主要网站:pms.com其次是查询字符串

非常重要:

重要提示1:

当我说重定向到主网站,我需要保持的子域名,如地址栏上的网址,但该请求将通过主站提供服务。

即user_name1.pms /接触将是从pms.com/contact送达,但在地址栏,我们仍然看到URLuser_name1.pms /接触

重要2:

每当我们使用的.htaccess将请求重定向到主Zend服务器,我可以识别输入的地址栏即site1.pms或site1.com?

实际的URL

自定义域重定向的另一个问题:

像site1.com或site2.com需要重定向到自定义域名之一:

方案(a):pms.com 方案(b):site1.pms.com

服务请求。这里也,我需要保持的URL地址栏同样喜欢一个用户输入。

  1. 这上面的选项是更好的(a)或(B)?

  2. 哪种技术做这项工作,域映射或CNAME记录?或任何其他技术,补充这方面的工作。

解决方案

子域可以使用的cPanel一些技术处理。从的cPanel添加vurtual子域名,做的步骤:

  1. 选择的cPanel - 子域名
  2. 输入星,并选择您的域名
  3. 选择的目录,你需要重定向

和处理来自网页的重定向。

要使用Zend开发一个SaaS应用程序,查看教程<一href="http://advancedphpsolutions.com/blog/zend-framework/saas-application-development-using-php-in-zend-framework/"相对=nofollow>中使用PHP的SaaS应用程序开发Zend框架

I am on the way of building a SaaS application using Zend Framework on PHP. Here is the basic information of the project. Its Project Management System on SaaS model. When the user registered on the site, they will get a domain name like the format:

user_name.pms.com

user_name - The chosen User Name when the user registered on the Project Management System (pms)

pms.com - is the main SaaS Server.

Currently we provide the Sub Domain on our Server. And for big firms, it won't look good and they may prefer to get their own domain instead of this default one. So there may be:

user_name.pms.com [Always Present]

user1.com [ The custom or independent domain of the User ] This custom domain needs to link into the default user url.

The full website is planning to develop using Zend Framework.

On Zend Framework, we are having following HTAccess on the root folder for its working and is below:

SetEnv APPLICATION_ENV development
RewriteEngine On
RewriteRule .* index.php

Here are my questions:

  1. Do I really need to create Sub Domain like profile url for all users once they registered on the site ?

  2. If it need to create Sub Domains, can PHP check whether the chosen sub domains exists or not and can create Sub Domains from the Script itself ?

  3. If there is no need to Sub Domain, can we achieve the same goal using HTAccess in Zend Installation ?

  4. Can you provide the HT Access code which does the following:

"user_name1.pms.com" need to redirect to "pms.com"

"user_name1.pms.com/contact" need to redirect to "pms.com/contact"

ie any request on the Sub Domain like URL must redirect to main website with the format: pms.com followed by Query String.

Very Important:

Important 1:

When I said the redirect to main website, I need to keep the sub domain like URL on the address bar but the request will be served by main website.

ie "user_name1.pms/contact" is going to be served from pms.com/contact but on address bar we still see the url "user_name1.pms/contact"

Important 2:

Whenever we uses the HTAccess to redirect the request to main Zend Server, can I identify the actual url entered on the address bar ie "site1.pms or site1.com" ?

Another Question of Custom Domain Redirection:

The custom domain name like "site1.com" or "site2.com" need to redirect to either:

Option (a): "pms.com" Option (b): "site1.pms.com

to serve the request. Here also, I need to keep the url on address bar same like the one user entered.

  1. Which above option is better (a) or (b) ?

  2. Which technology does this work, domain mapping or CName ? Or Any other technology for make this working.

解决方案

The sub domains can be handled using some technique in CPanel. To add vurtual sub domains from CPanel, do the steps:

  1. Select "CPanel - Sub Domains"
  2. Enter star and choose your domain name
  3. Choose the directory to which you need to redirect

And handle the redirection from your page.

To develop a SaaS application using Zend, check the tutorial SaaS application development using PHP in Zend Framework

这篇关于建立在Zend Framework的SaaS应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆