Build a lamp environment learning record under Ubuntu server

Source: Internet
Author: User

These days in learning some knowledge of Linux, here to record learning records.

Here are some comprehensive practical questions: a comprehensive practice of curriculum

Practice Description: With the continuous development of MU-class network, the user volume continues to rise, MySQL data volume more and more large, occupy more and more disk space, assuming that the existing server hard disk space. MU class network server operation of the siege Lion can not sit, report to the leader of the situation, need to add hard disk. Then the leadership also sit, in order to meet the growing MU class network normal operation, spend some money to buy a few pieces of server hard disk is not what, bite teeth approved. Siege Lion to IDC on the company's servers to purchase a new hard disk, format, mount to the server/mnt/mysqlhdd minutes. and posted on the site notice that tomorrow morning 1:00-3:00 nets will be system maintenance, may not be able to access the normal. After that, this glorious and arduous late-night overtime task to the bitter force of you, the boss after work all patted the butt home.

Task requirements: Assuming that the current MySQL data storage directory is/data/mysql/, please move the MySQL data to/MNT/MYSQLHDD after 1:00 in the night.

Research skill points: MySQL database storage directory modification and Data migration

Description: The $ before the command only represents the beginning of a command, do not enter during the actual operation, #后面是操作说明或对前一条本条命令的详细解释

Follow the instructions below (please write the executed command at the horizontal line at the prompt):

#数据迁移前停止mysql服务

$

#将目标目录的所属用户组和用户和文件夹权限修改为mysql: MySQL 0700

$

$

#为了防止意外, the existing data replication (CP) to the new directory, instead of moving (MV), in order to ensure that the file permissions and properties consistent, the copy process must add-a parameter, due to the large amount of data added –v parameter to view the process of replication

$

#编辑MySQL的配置文件my. cnf

$

# Modify the datadir parameter values in the my.cnf file

datadir=/data/mysql/revision changed to

#编辑apparmor关于 the mysql permissions configuration file

$

# Modify The permissions of the data store directory in the usr.sbin.mysqld file

/DATA/MYSQL/R revision changed to

/data/mysql/** RWK revision changed to

#保存退出后重启apparmor Services
$
#重启apparmor权限服务进程和mysql进程

$

Improve practical problems

Practice Description: Assume that the video tutorial Web site is subordinate to the Ubuntuserver operating system, and the use of the lamp environment. Recently, the Siege Lions of the MU Network have developed two new systems:

1, Student Exchange Forum System (BBS)

2. Employee Online Office System (OA)

Now you need to deploy these two new systems to a server that already has a video tutorial Web site (www.imooc.com), The two new systems have been assigned the two-level domain name bbs.imooc.com and oa.imooc.com and have resolved the domain name to the IP of the server where the www.imooc.com resides.

Task requirements: Assume that the web video site is currently stored in the directory/webdata/imooc/www, and the currently loaded virtual host configuration file is/etc/apache2/sites-available/imooc_www. Configure the virtual host separately for each of the two new systems, from an independent and manageable point of view between the systems.

Explore Skill Points: Apache Virtual host Simple configuration

Description: The $ before the command only represents the beginning of a command, do not enter during the actual operation, #后面是操作说明或对前一条本条命令的详细解释

Follow the instructions below (please write the executed command at the horizontal line at the prompt):

#在/WEBDATA/IMOOC directory new two folders BBs and OA, after the execution of the above command,/WEBDATA/IMOOC directory has www, BBS, oa three folders, the name and two-level domain name corresponding, respectively, storage three system PHP files, This facilitates future maintenance and management.

$

or step through the command

$

$

#将当前目录切换到虚拟主机 "Currently available" configuration directory

$

#每个虚拟主机之间虽然是独立的, but most of the configuration items are the same. It is not necessary for us to fully write a new configuration file by two copies of the existing IMOOC_WWW configuration file renamed to Imooc_bbs and Imooc_oa corresponding to the root directory of the new system two. The configuration file name here is optional, but for the sake of distinction and management, we use the name above.

$

#通过vim编辑配置文件

$

# First you can see this copy of the configuration file as follows

<virtualhost *:80>

ServerName www.imooc.com

Documentroot/webdata/imooc/www

<directory/>

Options FollowSymLinks

AllowOverride None

</Directory>

<Directory/webdata/imooc/www/>

Options Indexes followsymlinks MultiViews

AllowOverride None

Order Allow,deny

Allow from all

</Directory>

#..... Do not want to close configuration items here

</VirtualHost>

#将以上暗红色标记的参数从上到下分别改为

Www.imooc.com instead

/webdata/imooc/www instead

/webdata/imooc/www/instead

#保存退出, modify the Imooc_oa configuration file in a similar way with the same steps

#将当前目录切换到虚拟主机 "currently enabled" configuration directory

$

#到此已经成功为bbs. Imooc.com and oa.imooc.com two new systems configured with a virtual host

$

$

#最后重启apache让配置生效即可

$

Build a lamp environment learning record under Ubuntu server

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.