The "server" php+apache+mysql the entire process, including the two-level domain name setting (

Source: Internet
Author: User

Warmly welcome to visit Xiao Spontaneous combustion!!

1 Extracting PHP
2 Installing Apache
Modify the Apache configuration file.
Install in CGI mode
The following three lines need to be added to the Apache httpd.conf configuration file to set up CGI: Example 6-5. PHP in

The CGI method in Apache 2.0

scriptalias/php/"c:/php/"
AddType application/x-httpd-php. php

# for PHP 4 Use this line
Action application/x-httpd-php "/php/php.exe"

# for PHP 5 Use this line
Action application/x-httpd-php "/php/php-cgi.exe"

Installation in Apache module mode
The following two lines need to be added to the Apache httpd.conf configuration file to set up the Apache 2.0 PHP module:

Example 6-6. PHP module mode in Apache 2.0

# for PHP 4 Use these two lines:
LoadModule php4_module "C:/php/php4apache2.dll"
# Don't forget to copy the Php4apache2.dll from the SAPI directory!
AddType application/x-httpd-php. php

# for PHP 5 use these two lines:
LoadModule php5_module "C:/php/php5apache2.dll"
AddType application/x-httpd-php. php

# Configure the path of the php.ini, do not pull down, otherwise it will appear: undefined function mysql_connect (), etc.

PHP is not connected to MySQL problem
Phpinidir "c:/php"

3 Adding a Directory
Alias/www "C:/php/www"
<directory "C:/php/www" >
Options Indexes MultiViews
AllowOverride None
Order Allow,deny
Allow from all
DirectoryIndex default.php index.php index.html index.htm
</Directory>
To verify that PHP is running successfully, you can use Phpinfo () to verify the instructions
4 Installing MySQL
Remove the semicolon from the PHP configuration file for loading MySQL, and the semicolon for loading mysqli.
Use the following tests
<?php
$connection = mysql_connect (' 127.0.0.1 ', ' root ', ' password ')
Or Die (' cannot connect to MySQL Server: '. mysql_error ());
Echo ' has successfully connected MySQL database <br/> ';
mysql_select_db (' test ') or Die (' No Selection database ');
echo ' Connection test database has succeeded ';
?>
5 Installing phpMyAdmin
6 Configuring the Domain name
(1) Add in the Windows\system32\drivers\etc\hosts file so that it can be mclly.com or

Mclly.cn to visit the local.
127.0.0.1 localhost
127.0.0.1 mclly.com
127.0.0.1 mclly.cn
Configuration file Settings in Apache
Namevirtualhost *:80

<VirtualHost*:80>
ServerName mclly.com
DocumentRoot e:/www/
</VirtualHost>

<VirtualHost*:80>
ServerName mclly.cn
DocumentRoot e:/www/wordpress
</VirtualHost>
In this way, you can enter this machine's homepage via mclly.com, and enter the native WordPress page via mclly.cn.
(2) Setting up a local level two domain name
Also add the Hosts file to the
127.0.0.1 blog.mclly.com
In the Apache configuration file, add
<virtualhost *:80>
ServerName blog.mclly.com
DocumentRoot e:/www/wordpress
</VirtualHost>

7 Building a blog system
Use the Open Source Blog framework WordPress can.
8 Establishing BBS System
Using the Open source BBS Framework phpBB Direct installation can be,
But here's a problem: It's not safe-to-rely on the system ' s timezonesettings.
This solves the problem:
1 in the header use Date_default_timezone_set () to set my default time zone to Beijing time, i.e. <?php

Date_default_timezone_set ("PRC"); > It's ready. 2, set the value of Date.timezone in php.ini

PRC, set the following as: DATE.TIMEZONE=PRC, and uncomment this line of code at the same time.
9 Mall: Zencart
10 Build a CMS system
Set up a mail system
Server-Side hMailServer
Web Client: Squirlmail
Configuration: Copy the two folders under Hmailserver\addons to plugins under Squirlmail; settings Squirlmail

configuration file, to install ActivePerl, so that click config\conf.pl can set the configuration, here, carefully set

The configuration file, especially the path problem of option 4 for 1 and 2, is set to the path of your own machine.
11 There are other systems, we'd better choose open source free, so there are better resources for us to learn.

Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.

The

Server php+apache+mysql the entire process, including the two-level domain name setting (

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.