18
Zhuyun Information Technology Co.,Ltd. www.cloudcare.cn Revision History Date Version Description Prepared by 2017/08/01 V1.1 Users Guide Zhuyun/Technical Support Joomla on CentOS 7.2 Users Guide

JoomlaonCentOS7.2 User sGuide...services companies entirely engaged in cloud-based business in China. Relying on Alibaba Cloud's public cloud computing technology, Zhuyun is committed

  • Upload
    others

  • View
    1

  • Download
    0

Embed Size (px)

Citation preview

Page 1: JoomlaonCentOS7.2 User sGuide...services companies entirely engaged in cloud-based business in China. Relying on Alibaba Cloud's public cloud computing technology, Zhuyun is committed

Zhuyun Information Technology Co.,Ltd.www.cloudcare.cn

Revision History

Date Version Description Prepared by

2017/08/01 V1.1 User’s Guide Zhuyun/Technical Support

Joomla on CentOS 7.2User’s Guide

Page 2: JoomlaonCentOS7.2 User sGuide...services companies entirely engaged in cloud-based business in China. Relying on Alibaba Cloud's public cloud computing technology, Zhuyun is committed

Zhuyun Information Technology Co.,Ltd.

www.cloudcare.cn 400-882-3320 2

ContentsPreface....................................................................................................................................3

I. Copyright:.............................................................................................................................. 3II. About us:...............................................................................................................................3III. Contact us:...........................................................................................................................4

1. Image environment........................................................................................................6

1.1. Image version............................................................................................................ 61.2. Image installation...................................................................................................... 6

2. Password for mysql and ftp......................................................................................... 7

2.1. Password file..............................................................................................................72.2. View Password...........................................................................................................72.3. Change ftp password.................................................................................................72.4. Change mysql password............................................................................................ 7

3. Software directory and configuration list................................................................ 8

4. Software operation command summary................................................................. 9

5. Uninstallation...................................................................................................................9

6. Appendix......................................................................................................................... 10

Tutorial 1: configure remote connection........................................................................10Tutorial 2: configure joomla........................................................................................... 10Tutorial 3: Migrate the site to the data disk...................................................................13Tutorial 4: Migrate mysql to the data disk......................................................................15Tutorial 5: configure mysql remote connection............................................................. 16

Page 3: JoomlaonCentOS7.2 User sGuide...services companies entirely engaged in cloud-based business in China. Relying on Alibaba Cloud's public cloud computing technology, Zhuyun is committed

Zhuyun Information Technology Co.,Ltd.

www.cloudcare.cn 400-882-3320 3

Preface

I. Copyright:

1、 All contents provided in this document, including images, texts, pictures,

software, and programs are properties of Shanghai Zhuyun Information

Technology Co., Ltd. ("the Company"). All rights reserved.

2、Visitors may use the content or services provided in this document for

personal study, research, and other non-commercial or non-profit uses, but

they shall comply with the Copyright Law and other related laws and shall not

infringe the legal rights of the Company. No organization or individual may

apply any content or service of this document to any other occasions without

prior written consent of the Company. The Company shall hold any

organization or individual accountable by law for any unauthorized use of this

document.

3. If you have other suggestions on image, send them to [email protected].

II. About us:

Zhuyun Information Technology Co., Ltd. was founded in 2013, as one of the few

Page 4: JoomlaonCentOS7.2 User sGuide...services companies entirely engaged in cloud-based business in China. Relying on Alibaba Cloud's public cloud computing technology, Zhuyun is committed

Zhuyun Information Technology Co.,Ltd.

www.cloudcare.cn 400-882-3320 4

services companies entirely engaged in cloud-based business in China. Relying on Alibaba

Cloud's public cloud computing technology, Zhuyun is committed to helping the majority

of companies choose the cloud and big data products that truly fit their business needs.

Meanwhile. Zhuyun provides services including consulting, design, system

implementation, application migration, system management, hybrid cloud management,

and data center construction and other services; and helps enterprises build IT

infrastructure of the cloud computing era.

III. Contact us:

1. Website

http://www.cloudcare.cn

2. Address

No. 399 Keyuan Road, Pudong District, Shanghai (Headquarters)

Hangzhou Intelligent Industrial Incubator, No. 857 West Wenyi Road, Xihu District,

Hangzhou

Yinhe SOHO, Chaoyangmen, Dongcheng District, Beijing

Zhonghua Plaza, No. 33 of Third Zhongshan Road, Yuexiu District, Guangzhou

Zhongguancun Software Park, No.7 Yingcui Road, Jiangning District, Nanjing

Tianfu Software Park, No.216 Century City South Road, High-tech Zone, Chengdu

Page 5: JoomlaonCentOS7.2 User sGuide...services companies entirely engaged in cloud-based business in China. Relying on Alibaba Cloud's public cloud computing technology, Zhuyun is committed

Zhuyun Information Technology Co.,Ltd.

www.cloudcare.cn 400-882-3320 5

3. More support and help

Tel: 021-50800099

Technical support: 021-50800099-103

TradeManager: Architecture Cloud

Email: [email protected]

Page 6: JoomlaonCentOS7.2 User sGuide...services companies entirely engaged in cloud-based business in China. Relying on Alibaba Cloud's public cloud computing technology, Zhuyun is committed

Zhuyun Information Technology Co.,Ltd.

www.cloudcare.cn 400-882-3320 6

1. Image environment

1.1. Image version

Operating system: Centos 7.2 64-bit

Software details of image:

Nginx1.10.3-PHP5.6.27-MySQL5.6.35-Joomla! 3.3.3

1.2. Image installation

root/joomla.tar.gz is the script we used to install the image . you can use it for the

image environment installation in Centos 7.2 by yourself, the manually installed

environment is the same as the initialized image environment. Note that if you use

this script to install the image environment, you need to run “chmod 777 -R

/root/joomla” to grant 777 installation privileges.

/root/joomla is the main directory for installing the environment, in which the

image environment is compiled and installed.

Page 7: JoomlaonCentOS7.2 User sGuide...services companies entirely engaged in cloud-based business in China. Relying on Alibaba Cloud's public cloud computing technology, Zhuyun is committed

Zhuyun Information Technology Co.,Ltd.

www.cloudcare.cn 400-882-3320 7

2. Password for mysql and ftp

2.1. Password file

/alidata/account.log

2.2. View Password

Logon your server, in any directory, you can execute the following command to

view the password:

cat /alidata/account.log

2.3. Change ftp password

Logon mongodb server with root accoutn, then execute below commands:

passwd www

Then enter new password for ftp.

2.4. Change mysql password

mysqladmin -uroot –p Old password password new password

Note: There is no space between “-p” and “old password”, and there is a space

between“password” and “new password”.

Page 8: JoomlaonCentOS7.2 User sGuide...services companies entirely engaged in cloud-based business in China. Relying on Alibaba Cloud's public cloud computing technology, Zhuyun is committed

Zhuyun Information Technology Co.,Ltd.

www.cloudcare.cn 400-882-3320 8

3. Software directory and configuration list

software main directory: /alidata

web root directory: /alidata/www

Ftp home directory: /alidata/www

Nginx directory: /alidata/server/nginx

Nginx configuration file home directory: / alidata / server / nginx / conf

Php home directory: / alidata / server / php

Php configuration file: / alidata / server / php / etc

Mysql directory: /alidata/server/mysql

Mysql configuration file: /etc/my.cnf

Joomla Chinese support package: / alidata / res

Log directory: /alidata/log/nginx

/alidata/log/php

/alidata/log/mysql

Init directory: /alidata/init

When a user creates a system with this image, the ftp and mysql passwords

(random passwords) will be initialized with this script when and only if the user

starts the system for the first time.

Page 9: JoomlaonCentOS7.2 User sGuide...services companies entirely engaged in cloud-based business in China. Relying on Alibaba Cloud's public cloud computing technology, Zhuyun is committed

Zhuyun Information Technology Co.,Ltd.

www.cloudcare.cn 400-882-3320 9

4. Software operation command summary

systemctl start|stop|restart mysqld.service

systemctl start|stop|restart vsftpd.service

systemctl start|stop|restart nginx.service

5. Uninstallation

Execute below commands for uninstallation:

cd /root/joomla

./uninstall.sh

Note:

①: This operation will clean up /alidata directory. Before uninstallation, please back

up the necessary data.

②: If / root / joomla directory is mistakenly deleted, you can extract

/root/mariadb.zip to get this directory again. you can refer to the following

commands:

cd

tar zvf joomla.tar.gz

chmod 777 -R joomla

cd joomla

./uninstall.sh

Page 10: JoomlaonCentOS7.2 User sGuide...services companies entirely engaged in cloud-based business in China. Relying on Alibaba Cloud's public cloud computing technology, Zhuyun is committed

Zhuyun Information Technology Co.,Ltd.

www.cloudcare.cn 400-882-3320 10

6. Appendix

Tutorial 1: configure remote connection

For security reason, joomla default setting only allows local access. there is a script

called joomla_opennet.sh under /root/joomla directory, executing it will enable

joomla remote access.

Tutorial 2: configure joomla

At the first time you login server system that is installed by the image, run

/root/joomla/joomla_opennet.sh, then type http://ip in browser, click“Enter”,

you will see the initialized page of joomla.

1) Select language, fill out the other configurations, then click "Next".

Page 11: JoomlaonCentOS7.2 User sGuide...services companies entirely engaged in cloud-based business in China. Relying on Alibaba Cloud's public cloud computing technology, Zhuyun is committed

Zhuyun Information Technology Co.,Ltd.

www.cloudcare.cn 400-882-3320 11

2) select the mysql database, enter the account and the password, click "Next".

3) Double check the configurations , then click "install".

Page 12: JoomlaonCentOS7.2 User sGuide...services companies entirely engaged in cloud-based business in China. Relying on Alibaba Cloud's public cloud computing technology, Zhuyun is committed

Zhuyun Information Technology Co.,Ltd.

www.cloudcare.cn 400-882-3320 12

4) After the installation done, go to /alidata/www/default directory, type below

commands to delete the installation directory.

Page 13: JoomlaonCentOS7.2 User sGuide...services companies entirely engaged in cloud-based business in China. Relying on Alibaba Cloud's public cloud computing technology, Zhuyun is committed

Zhuyun Information Technology Co.,Ltd.

www.cloudcare.cn 400-882-3320 13

cd /alidata/www/default

rm -rf installation/

now ,the installation is completely finished.

Visit the front-end site: http: // ip

Visit the background management interface: http: //ip/administrator.

Tutorial 3: Migrate the site to the data disk

The site data of the image is stored in system disk. Considering that the system

disk space may not be sufficient, if the amount of application data is too large, you

may need to move it to the data disk. The specific steps are as follows:

1) Firstly, partition and format the data disk. If you have already formatted the

Page 14: JoomlaonCentOS7.2 User sGuide...services companies entirely engaged in cloud-based business in China. Relying on Alibaba Cloud's public cloud computing technology, Zhuyun is committed

Zhuyun Information Technology Co.,Ltd.

www.cloudcare.cn 400-882-3320 14

data disk, ignore this step.

2)Take 《Appendix tutorial 1: deploy joomla》as an example, execute the following

commands to migrate joomla to the data disk:

/etc/init.d/nginx stop #stop the nginx service first

rm -rf installation/

/etc/init.d/php-fpm stop # stop php service

cd / # switch to the root directory

mount /dev/xvdb1 /mnt/ # Mount the first data disk under the mnt directory.

The mount point depends on your needs, here we just use mnt directory as an

example. Mounting /dev/xvdb1 /alidata/www directly to the /alidata/ www

directory seems more convenient.

mkdir -p /mnt/www /mnt/log

cp -a /alidata/www/default /mnt/www # migrate data to the data disk

3)vim / alidata/server/nginx/conf.d/vhost/default.conf

Change

"/root/alidata/www/default;"

"Access_log / alidata/log/nginx/access/default.log;"

to

"/mnt/www/default;"

Page 15: JoomlaonCentOS7.2 User sGuide...services companies entirely engaged in cloud-based business in China. Relying on Alibaba Cloud's public cloud computing technology, Zhuyun is committed

Zhuyun Information Technology Co.,Ltd.

www.cloudcare.cn 400-882-3320 15

"access_log /mnt/log/default.log;"

4) start php、nginx, then the migration done.

/etc/init.d/php-fpm start

/etc/init.d/nginx start

Tutorial 4: Migrate mysql to the data disk

The installation directory and data directory of image are both installed in system

disk. Considering that the system disk space may not be sufficient, if the amount

of mysql data is too large, you may need to move mysql to the data disk, which

usually means migrating the data directory of mysql to the data disk. The specific

steps are as follows:

1) First, format the data disk and mount it under /mnt directory (the mount point

depends on your requirement, here we just take /mnt as an example)

mkdir -p /mnt/data

2) Use“mysqldump” command to export all data of your project.

mysqldump -p --all-databases > all.sql

3) Stop mysql

/etc/init.d/mysqld stop

4) edit “/etc/init.d/mysqld”file

Page 16: JoomlaonCentOS7.2 User sGuide...services companies entirely engaged in cloud-based business in China. Relying on Alibaba Cloud's public cloud computing technology, Zhuyun is committed

Zhuyun Information Technology Co.,Ltd.

www.cloudcare.cn 400-882-3320 16

Change

“datadir=/alidata/server/mysql/data”

To

“datadir=/mnt/data”

5) Then initialize the database environment with below command:

/alidata/server/mysql/scripts/mysql_install_db --basedir=/alidata/server/mysql

--datadir=/mnt/data --user=mysql

Note: here the datadir is the new directory you will migrate mysql to

6) Start mysql, then restore the data to the new data disk

/etc/init.d/mysqld start

mysql < all.sql

/etc/init.d/mysqld restart

Tutorial 5: configure mysql remote connection

A lot of users feedback, after generating system with the image, the cloud host

itself can connect mysql, but the remote connections from other machine fail. It is

because the default installation of mysql, for security reasons, can only be

connected locally. If you want remote access, you need to set the mysql permission

table. The specific steps are as follows:

Page 17: JoomlaonCentOS7.2 User sGuide...services companies entirely engaged in cloud-based business in China. Relying on Alibaba Cloud's public cloud computing technology, Zhuyun is committed

Zhuyun Information Technology Co.,Ltd.

www.cloudcare.cn 400-882-3320 17

1) Connect mysql on your cloud host.

2) Execute twi command:

use mysql #open the mysql database

3) Setting the host to “%” means any ip can connect mysql. Of course, you can

also specify the host as a fixed ip:

update user set host='%' where user='root' and host='localhost';

flush privileges; #Refresh the permissions table to make the configuration

take effect

Then we can connect mysql remotely with root user。

Note: You can also add a user named “yuancheng” with the password

“123456”, the authority is % (that means it can be connected by any ip):

Grant all on *. * To 'yuancheng' @ '%' identified by '123456';

Flush privileges;

4) If you want to turn off remote connections , restore mysql to the default

settings (only local connection permitted), you can do the followings:

use mysql #open the mysql database

update user set host='localhost' where user='root'; #Setting host to the

“localhost”means you can only connect mysql locally.

Page 18: JoomlaonCentOS7.2 User sGuide...services companies entirely engaged in cloud-based business in China. Relying on Alibaba Cloud's public cloud computing technology, Zhuyun is committed

Zhuyun Information Technology Co.,Ltd.

www.cloudcare.cn 400-882-3320 18

flush privileges; #Refresh the permission table to make the

configurations take effect.