Phpcms Core code and WWW separation deployment

Source: Internet
Author: User

In order to meet more users two times development interests and hobbies, at the same time, in order to be more secure. You can separate the main program from the WWW program by modifying the way the portal code is included.

Let's look at the following directory structure:



(Fig. 1)
We need to make changes to the Phpcms directory and index.php.

Place the: Phpcms directory outside the directory.

Such as:

(Fig. 2)

The Phpcms directory is the PHPCMS directory in Figure 1.
Figure 2 of the WWW directory for our site directory, the site directory to do parsing, will: www.phpip.com binding to the WWW directory.

This way, users will not be able to access the PHPCMS directory directly through the browser. Can effectively prevent the template from being downloaded. A vulnerability in the program file has been accessed.

Then modify the www/index.php file

<?php/** * index.php phpcms entrance * * @copyright(C) 2005-2010 phpcms* @licensehttp://www.phpcms.cn/license/* @lastmodify2010-6-1*///phpcms root directory define (' Phpcms_path ', DirName (__file__). Directory_separator); include Phpcms_path. ' /phpcms/base.php ';Pc_base::creat_app ();?>

The bold section is modified to:

Include Phpcms_path. /phpcms/base.php ';

There is one last file: www/api.php file.

Do the same for the above operation.

Will: include Phpcms_path. ' Phpcms/base.php ';

Modified to: Include Phpcms_path. /phpcms/base.php ';

Reprint: http://www.phpip.com/html/2014/jiemi_0504/147.html

Phpcms Core code and WWW separation deployment

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.