Z-blog is used under Apache PHP

Source: Internet
Author: User
Tags apache php copy ftp php file php server php code domain name root directory

The Z-blog program is developed based on the iis+asp environment and cannot theoretically be run in apache+php+mysql environment, but sometimes it may be necessary to temporarily migrate Z-blog to the Apache platform in some circumstances, this article will describe the specific form of the migration.

The idea of migration is to z-blog all static, dynamic parts, using PHP code to callback the ASP server address, the database is still placed on the ASP server, using the dual domain name form, the ASP server through the FTP tool to copy the HTML files to the PHP server.

Z-blog system needs to use the "Static home Generation Plug-in", so that the first page and article pages have implemented a static HTML file, the category page and the label page was dynamic, modified to more trouble, need to modify the Z-blog source code.

The way to modify it is to create a cat directory, copy the catalog.asp file from the root directory, modify it to default.asp, and modify the include path inside.

Next, modify the c_system_base.asp,c_system_event.asp,c_system_lib.asp file in the function directory, search replaces "catalog.asp" as "cat/", This way, the directory page and the category page call the Cat directory instead of the ASP file.

After that, all the HTML will be FTP to the Apache host, for the cat directory, then create a index.php file, the contents of the file are as follows:

<?php

$qstring = Isset ($_server["query_string"])? $_server["Query_string"]: "";

$url = "http://www.williamlong.info/cat/?". $qstring;

$file =file_get_contents ($url);

Echo $file;

?>

This way, the call to the catalog page and the category page automatically crawls the files on the original ASP server.

Finally, edit the. htaccess file on the Apache server, which reads as follows:

Rewriteengine on
Rewritebase/
Rewriterule ^upload/(. *) $ http://www.williamlong.info/upload/$1 [r=301,l]
Rewriterule ^download/(. *) $ http://www.williamlong.info/download/$1 [r=301,l]
Rewriterule ^function/(. *) $ http://www.williamlong.info/function/$1 [R=301,L,QSA]

After such a deal, in the Apache environment can also browse Z-blog generated blog.

However, there are still some problems, mainly including, the comment function can not be used (separate use of another plug-in to support the comments), dynamic loading of the contents of the sidebar cannot be displayed, the article volume browsing can not count, scoring plug-ins failure, update more trouble.

The current method is to update the blog, modify the Hosts file, will z-blog the domain name again point to the original ASP server, add articles, and then FTP to the Apache server, I had considered in two servers on the simultaneous installation of Dropbox method to achieve synchronization, but later found that Some foreign virtual host has already begun to prohibit running Dropbox on the host, its system will automatically detect the Dropbox process, concurrent Mail warns the user, said that runs this program violates its policy, requests stops this process, therefore can only consider uses the automatic FTP method to realize the synchronization.



Related Article

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.