将Codeigniter项目从主域复制到子域 [英] Copy Codeigniter project from Main domain to subdomain

查看:72
本文介绍了将Codeigniter项目从主域复制到子域的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想创建我当前正在运行的 codeigniter网站的副本,说。添加子域时,您必须输入其文档根路径。



如果您的网站使用数据库,则需要使用cPanel中的MySQL数据库选项创建一个新数据库。 。创建数据库并为其分配用户后,打开phpMyAdmin,转到原始数据库,转到phpMyAdmin中的操作选项卡,然后将该数据库复制到您创建的新数据库中。



打开文件管理器并复制与您的主要网站有关的所有文件。将它们粘贴到子域的文档根目录中。



如果您的网站使用数据库,则最终必须在站点代码中修改数据库连接参数。您可以通过grep命令轻松找到config的位置:

  grep -r mysql / public_html / subdomain / 

现在当您打开 http://beta.example.com ,您应该会看到副本网站。


I want to create a copy of my currently running codeigniter website, say http://www.example.com and place the copy in a new subdomain "beta", say http://beta.example.com for test purposes and site modifications, so that the live site doesnt gets unmanaged due to the modifications.

So its about making a replica of website for test purposes and modifications under beta subdomain. How should I do it?

This is the file-structure I am having in beta subdomain

解决方案

First use your cpanel to add a new subdomain: http://documentation.cpanel.net/display/ALD/Subdomains . While adding the subdomain you will have to enter its document root path.

If your website uses a database, then you need to create a new database using MySQL Databases option in cPanel. After creating a database and assigning a user to it, open phpMyAdmin, go to the original database, go to Operations tab in phpMyAdmin and copy that database to the new database you created.

Open File Manager and copy all the files related to your main website. Paste them in the subdomain's document root.

If your website uses a database, you will have to finally modify the database connection parameters in your site code. You can find the location of config easily through a grep command:

grep -r "mysql" /public_html/subdomain/

Now when you open http://beta.example.com you should see the replica website.

这篇关于将Codeigniter项目从主域复制到子域的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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