? Build a lamp environment and quickly deploy dual Web sites and implement domain-based virtual hosts

Source: Internet
Author: User

What this section says:

    • Combat: Build Lamp environment and rapid deployment of dual sites and implementation of domain-based virtual hosting

Lamp Architecture:???

linux+apache+mysql+php

Linux+apache+mysql/mariadb+perl/php/python A group used to build Dynamic website or the server's Open Source software , together make up a powerful Web application platform .

First, install the required package

[[email protected] ~]# yum install httpd mysql-server mysql php php-mysql-y

httpd # Web Server

Mysql-server #mysql数据库

MySQL # MySQL server Linux under Client

PHP #php相关文件

Php-mysql #这个包的作用是什么???

View Php-mysql Package function: -qpi: Lists description information for RPM packages

[email protected] packages]# rpm-pqi php-mysql-5.3.3-3.el6_1.3.x86_64.rpm

Warning:php-mysql-5.3.3-3.el6_1.3.x86_64.rpm:header V3 rsa/sha256 Signature, key ID Fd431d51:nokey

Name:php-mysql Relocations: (not relocatable)

version:5.3.3 Vendor:red Hat, Inc.

release:3.el6_1.3 Build date:mon Oct 08:41:54 PM CST

Install Date: (not installed) Build host:x86-004.build.bos.redhat.com

Group:development/languages Source rpm:php-5.3.3-3.el6_1.3.src.rpm

size:220619 license:php

SIGNATURE:RSA/8, Wed 09:58:41 PM CST, Key ID 199e2f91fd431d51

Packager:red Hat, Inc.

url:http://www.php.net/

Summary: A Module for PHP applications This use MySQL databases #php程序连接mysql使用的模块

Start the service Lamp Related services:

Start Apche:

[[Email protected] ~]# service httpd start

Starting httpd: [OK]

[Email protected] ~]# chkconfig httpd on

[[Email protected] ~]# service mysqld start

[email protected] ~]# chkconfig mysqld o N

To test the database connection:

connect to MySQL database and connect the machine to remove-h

#mysql

Or:

# mysql-h Ip-u User-ppass

MySQL's super administrator is the Root,root user with the highest permissions for the most MySQL database.

Cases:

# mysql-u Ro ot

mysql> exit; #退出mysql, MySQL adds a semicolon after each command;

Configure root password: mysql

Example 1: Configuring the root password

[[email protected] ~]#/usr/bin/mysqladmin-u root password "123456"

mysql> Exit #退出命令可以加分号, you can also add no semicolons.

Bye

test whether the site supports Php

# cd/var/www/html/

[email protected] html]# vim Index . PHP

[email protected] html]# cat index.php

<? PHP

Phpinfo ();

?>

Test:

http://192.168.1.63/index.php

Lamp Environment Construction Completed

second, the installation of Ecshop website steps:

1. Decompression

2. Upload

3. Modify Permissions

4. Install on the page

Uploading site templates Ecshop_v2.7.3_utf8_release0411.zip

[email protected] ~]# Unzip ecshop_v2.7.3_utf8_release0411.zip

[[Email protected] ~]# CD ecshop_v2.7.3_utf8_release0411/

[[email protected] ecshop_v2.7.3_utf8_release0411]# ls

Docs upgrade Upload

upload upload mv upload//var/www/html/ecshop

Modify Permissions

Chown Apache:apache ecshop/-R

Web Page Installation:

http://www.xuegodcd.cn/ecshop/install/

Database names can be customized

login password is greater than 8 digits, alphanumeric combination

Install times wrong:

Create configuration file ...... Success
To Create a database ..... Success
installation Data ....... Success
Create an administrator account ..... Failed

warning:date (): It is not safe for rely on the system ' s timezone settings. You is *required* to use the Date.timezone setting or the Date_default_timezone_set () function. In case you used any of those methods and you is still getting this warning, your most likely misspelled the timezone Iden Tifier. We selected ' asia/chongqing ' for ' cst/8.0/no DST ' instead in/home/babap/ecshop/includes/lib_ time.php on line OK

Modify method

Vim ecshop/install/includes/init.php

1 <?php

2 date_default_timezone_set (' Asia/shanghai '); the second line inserts this code, sets the time zone

Close the error window after you change it, click Install Now

Remove Install

Login Backstage: (Admin center)

Http://www.xuegodcd.cn/ecshop/admin/privilege.php?act=login

Cd/xuegod123

Third, Discuz Forum Installation steps:

1. Decompression

2. Upload

3. Modify Permissions

4. Install on the page

[Email protected] ~]# Unzip Discuz_x3.2_sc_utf8.zip

[Email protected] ~]# MV upload//var/www/html/discuz

Modify file name

[Email protected] discuz]# CD config/

[[email protected] config]# ls

config_global_default.php config_ucenter_default.php index.htm

[email protected] config]# CP config_global_default.php config_global.php

[email protected] config]# CP config_ucenter_default.php config_ucenter.php

Modify Permissions

[Email protected] discuz]# chown Apache.apache config/data/-R

[Email protected] discuz]# chown Apache.apache uc_client/uc_server/-R

Install on page:

http://192.168.10.64/discuz/install/

Can register to play a play

Iv. setting up a domain-based virtual host

vim/etc/httpd/conf/httpd.conf add two domain-based virtual hosts.

990 Line, change:

# namevirtualhost *:80

For:

Namevirtualhost *:80

At the end of the file

<virtualhost *:80>

ServerAdmin [email protected]

DocumentRoot /var/www/html/kaixin001

ServerName uc.xuegod63.cn

Errorlog Logs/dummy-host.example.com-error_log

Customlog Logs/dummy-host.example.com-access_log Common

</VirtualHost>

<virtualhost *:80>

ServerAdmin [email protected]

DocumentRoot /var/www/html/kaixin

ServerName www.xuegod63.cn

Errorlog Logs/dummy-host.example.com-error_log

Customlog Logs/dummy-host.example.com-access_log Common

</VirtualHost>

Start the service:

Service httpd Restart

Intranet IP, I want to use the way domain name access???

Modify Hosts

C:\Windows\System32\drivers\etc \hosts

Domain IP address

Domain IP address

Summarize:

1. build lamp environment

2, Rapid Build ecshop

3, Rapid construction discuz Forum

4. Configure Apache domain-based virtual host

C D Style: 6

? Build a lamp environment and quickly deploy dual Web sites and implement domain-based virtual hosts

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.