Web servers, shared relational databases, and Server for NFS

Source: Internet
Author: User

  1. 650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/46/41/wKiom1Pw65biGPJNAAEYuxkAyMg214.jpg "title=" image 016. PNG "alt=" wkiom1pw65bigpjnaaeyuxkaymg214.jpg "/>

    Installing the Web (compiled and installed here) 1, httpd-2.4.2 requires a newer version of APR and Apr-util, so it needs to be upgraded beforehand. There are two ways to upgrade, one is to compile the installation through the source code, one is to upgrade the RPM package directly, download the installation package and then use "RPM-UVH" to upgrade. Here you choose to make the source code compiled and installed.

    Note: Do not forget to install the development environment before installing these packages

    Yum-y Groupinstall "Development Tools"

    Yum-y Groupinstall "Development Libraries"

    Compile and install Apr and Apr-util

    Tar XF apr-1.4.6.tar.bz2

    ./configure--PREFIX=/USR/LOCAL/APR

    Make && make install

    Tar XF apr-util-1.4.1.tar.bz2

    ./configure--prefix=/usr/local/apr-util--WITH-APR=/USR/LOCAL/APR

    Make && make install

    Yum Install Pcre-devel Openssl-devel

    Compiling and installing httpd-2.4.2.tar.bz2

    Tar XF httpd-2.4.2.tar.bz2

    CD httpd-2.4.2

    ./configure--prefix=/usr/local/apache--enable-so--with-apr=/usr/local/apr--with-apr-util=/usr/local/apr-util

    Make && make install

    In order to save time, there are not so many parameters to add.

    Learn more about compiling parameters please./configure--help to view

    Third, compile and install PHP

    Tar XF php-5.4.4.tar.bz2

    CD php-5.4.4

    ./configure--prefix=/usr/local/php--with-mysql=/usr--enable-mbstring--with-freetype-dir--with-jpeg-dir-- With-png-dir--with-zlib--with-libxml-dir=/usr--enable-xml--with-apxs2=/usr/local/apache/bin/apxs-- With-config-file-path=/etc--WITH-CONFIG-FILE-SCAN-DIR=/ETC/PHP.D--with-bz2

    Make && make install

    Provide a configuration file for PHP

    CP Php.ini-production/etc/php.ini

    Edit Apache config file, let Apache support PHP

    Vim/etc/httpd/httpd.conf

    Check if the Libphp5.so module is added and open

    Find the <ifmodule mime_module> module and add it inside

    AddType application/x-httpd-php. php

    Position to: DirectoryIndex index.html

    Modified to: DirectoryIndex index.php index.html

    Add a virtual host edit httpd.conf configuration file you need to modify the following

    Vim/usr/local/apache/conf/httpd.conf

    LoadModule Log_config_module modules/mod_log_config.so

    Include/etc/httpd/extra/httpd-vhosts.conf

    #DocumentRoot "/usr/local/apache/htdocs"/Add a # to the front, comment out/

    Save exit

    Vim/usr/local/apache/conf/extra/httpd-vhosts.conf

    <virtualhost *:80>

    ServerName www.test.com

    Documentroot/www

    <directory "/www" >

    Options indexes

    allowoverride None

    Require all granted

    </Directory>

    </VirtualHost>

    Restart httpd command:/usr/local/apache/bin/apachectl restart

    Write a PHP test script: Echo "<?php phpinfo ();?>" >/www/index.php

    Test result http://172.16.0.22/index.php

    The following NFS configuration is then used to mount the following commands:

    Mount-t NFS 172.16.0.24:/www/users/test.com/www

    Second, server2:172.16.0.23 (Mysql)

Install MySQL

Install mariadb to/usr/local/

Unzip to this directory # tar XF mariadb-5.5.36-linux-x86_64.tar.gz-c/usr/local/

For later convenience upgrade use to mariadb-5.5.36-linux-x86_64 create a link # ln-sv Mariadb-5.5.36-linux-x86_64/mysql

MySQL database file by default is under/usr/local/mysql/data/, as the data increase, put here is not appropriate. Create logical volumes to hold data so that they can be extended at any time, create logical volumes, and mount them under/mydata/data/.

MySQL is started by the root of the normal user MySQL identity to run, so add System group, System users: Mysql,mysql.

Modify the genus group of the/mydata/data/directory # Chown-r mysql.mysql/mydata/data/

# Cd/usr/local/mysql.

Modify all the files inside the main root group MySQL: # chown-r root.mysql./*

Initialization of MySQL:

Because the my.cnf already exists under/etc/. All new # Mkdir/etc/mysql.

Copy config file # cp support-files/my-large.cnf/etc/mysql/my.cnf and edit # VIM/ETC/MYSQL/MY.CNF

CD to/usr/local/mysql/down, depending on the./bin in this directory. Initialize the database script execution # scripts/mysql_install_db--user=mysql--datadir=/mydata/data

Database has been generated # Ls/mydata/data

Copy Service Script # CP Support-files/mysql.server/etc/rc.d/init.d/mysqld

Add to List of services # Chkconfig--add mysqld

Start Services # service mysqld star.

MySQL client is not available at this time because environment variables are not added

# vim/etc/profile.d/mysql.sh

# SOURCE/ETC/PROFILE.D/MYSQL.S

Export Header File # ln-sv/usr/local/mysql/include//usr/include/mysql

Update version client library # vim/etc/ld.so.conf.d/mysql.conf

Finally, the system is re-loaded into the system library:

Ldconfig


Service mysqld Start

Mysqladmin-uroot password ' redhat '

Mysql-uroot-p

Mysql> GRANT all on discuz.* to [e-mail protected] '%.%.%.% ' identified by ' Redhat ';mysql> FLUSH privileges

SAN, server3:172.16.0.24 (WEB+PHP+NFS)

Web and PHP installation ibid.


Installing NFS

redhat5.8 the NFS is already installed by default, if you do not have the installation, use this command:

Yum Install nfs-utils Nfs4-acl-tools portmap


Configuring the NFS service side

The main configuration file for NFS is/etc/exports, which is configured to open Directory for NFS servers, as well as client access permissions.

Vi/etc/exports

/www/users/test.com 172.16.0.0/16 (Rw,no_root_squash)

Save exit


Exportfs-arv make its NFS configuration effective, do not restart the NFS service


Unzip the Discuz program in NFS

Unzip discuz_7.2_full_sc_gbk.zip-d/www/users/test.com

Cd/www/users/test.com

CD upload

MV *.. /


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.