LAMP + NFS build comprehensive configuration of Forum System

Source: Internet
Author: User
Tags mysql host

Requirements: 1. Create a logical volume/dev/myvg/web and/dev/myvg/mydata, and mount it to/www/htdocs and/www/mydata. Set the local host (assuming the host name is nfs.a.org) there are two addresses in the network of 172.16.0.0/16 and 10.0.0 . 0/8 network; 2. Set the owner group of/www to a mysql user and a mysql group. The mysql user ID and group ID are both 3306; 3. Use nfs to share/www/htdocs to 172.16.0.0/16. The sharing options are read/write and asynchronous. 10.0.0 . 0/8. The sharing option is read-only; 4. Set nfs auxiliary services to use fixed ports to provide services; 5. Start two other Linux instances (for example, www1.a.org and www2.a.org) on the 172.16.0.0/16 network; mount the/www/htdocs and/www/mydata of the nfs server to the/web and/mydata directories of the local machine; 6. Install LAMP on both www1 and www2 hosts; Note: 1) the IDs of mysql users and groups created on both hosts are 3306; 2) commands for initializing mysql only need to be performed on one host. After initialization, another mysql host starts directly; 7. install and configure wordpress on the www1 host; 8. Access the services on the www2 host to verify the authenticity; 9. Configure www1 and www2 hosts to use the ssl Service; Network Topology: Purpose: Two external web servers can manage dynamic data updates at the same time, but the addresses of the two servers are different: 192.168.0.90/24, 192.168.0.151/24, and the IP address of the NFS server is 192.168.0.78/24. Data is stored on NFS. Managed through two web servers. Yumgroupinstall "XSoftwareDevelopment" "LegacySoftwareDevelopment" "DevelopmentTools" "DevelopmentLibraries" (1) NFS configuration: 1. Create two LV partitions # Fdisk/dev/sda create a partition /Dev/myvg/web and/dev/myvg/mydata 2. Create a shared directory:/www/htdocs,/www/mydata # Mkdir-pv/www/{htdocs, mydata} 3. Install the NFS Software Package nfs-utils- 1.0.9 -42. el5.rpm, nfs-utils-lib-1.0.8-7.6.el5.rpm # Tarxfnfs-utils- 1.0.9 -42. el5.rpm # Tarxfnfs-utils-lib- 1.0.8 -7.6.el5.rpm 4. Configure the NFS configuration file and specify the shared directory. # Add the following content to vim/etc/exports: /Www/htdocs192.168.0.0/24 (rw, async) /Www/mydata192.168.0.0/24 (rw, async) /Usr/local/mysql192.168.0.0/24 (rw, async) 5. Start NFS # Servicenfsstart 6. Install Mysql on NFS. The source code is used for installation as follows: # Echo "/dev/myvg/web/www/htdocsext3defaults0 0" >/Etc/fstab # Echo "/dev/myvg/mydata/www/mydataext3defaults0 0" >/Etc/fstab # Mount- # Groupadd-g3306mysql # Useradd-gmysql-s/sbin/nologin-M-u3306mysql # Chown-Rmysql: mysql/www/mydata/ # Tarxmysql- 5.5.15 -Linux2.6-i686.tar.gz-C/usr/local # Ln-vs/usr/local/mysql- 5.5.15 -Linux2.6-i686/usr/local/mysql # Cd/usr/local/mysql # Chown-Rmysql: mysql. # Scripts/mysql_install_db -- user = mysql -- datadir =/www/mydata/data # Chown-Rroot. # Cpsupport-files/mysql. server/etc/init. d/mysqld # Chkconfig -- addmysqld # Cpsupport-files/my-large.cnf/etc/my. cnf # Vim/etc/my. cnf Add: datadir =/mydata/data Servicemysqldstart Specify the mysql binary file: # ExportPATH = $ PATH:/usr/local/mysql/bin (temporary) # Vim/etc/profile Add PATH = $ PATH:/usr/local/mysql/bin (permanent) Specify the lib File # Vim/etc/ld. so. conf. d/mysql. conf Add:/usr/local/mysql/lib Ldconfig Synchronization # Ldconfig-v | grepmysql Header file: # Ln-sv/usr/local/mysql/include/usr/include/mysql Help information: # Vim/etc/man. config Add: MANPATH/usr/local/mysql/man to add a new database # mysqlmysql> CREATEDATABASEmydb; mysql> GRANTALLPRIVILEGESON *. * TOroot @ '%. %. %. % 'identifiedby 'redhat'; mysql> FLUSHPRIVILEGES; create and configure the password of the database user so that Mysql is installed. (2) installation and configuration of web servers # Mkdir/{web, mydata} # Showmount-e192.168.0.78 // view shared directories Mount shared directory # Mount-tnfs192.168.0.78:/www/mydata # Mount-tnfs192.168.0.78:/www/web Modify host name # Hostnamewww1.a.org # Vim/etc/hosts # Vim/etc/sysconfig/network change the host name to www1.a.org Install the httpd package: httpd- 2.2.19 .Tar.bz2 # Tarxfhttpd- 2.2.19 .Tar.bz2 # Cdhttpd- 2.2.19 #./Configure -- prefix =/usr/local/apache -- sysconfdir =/etc/httpd -- enable-so -- enable-modules = most -- enable-mod-shared = most # Make # Makeinstall After the installation is complete, modify the httpd configuration file. # Vim/etc/httpd. conf Modify the following content: DocumentRoot "/web", add PidFile "/var/run/httpd. pid" Add the following two sentences to identify the files ending with ". php" after installing php. AddTypeapplication/x-httpd-php.php AddTypeapplication/x-httpd-php-source.phps DirectoryIndexindex.phpindex.html # Mkdir/SQL # Mount-tnfs192.168.0.78:/usr/local/mysql- 5.5.15 -Linux2.6-i686/SQL // The source code must be installed. Otherwise, PHP cannot identify the Mysql driver, which is prepared to identify the driver. You can uninstall it after use. Install php # Tarxfphp- 5.3.6 .Tar.bz2 # Cdphp- 5.3.6 #. /Configure -- prefix =/usr/local/php5 -- sysconfdir =/etc/php -- enable-mbstring -- with-apxs2 =/usr/local/apache/bin/apxs -- with-mysql = /SQL # Make # Makeinstall # Cpphp. ini-production/usr/local/php5/lib/php. ini In this way, the installation and configuration of web + php are completed, and the configuration on the other web server is not described in detail. (3) install phpwind Forum # Cd/www/htdocs/ #Unzipphpwind_GBK_8.3.zip # Cdphpwind_GBK_8.3 # Cdupload/ # Mv./*/www/htdocs # Useraddapache # Useraddmysql # Chown-Rmysql: mysql/www/mydata/ # Chown-Rapache/www/htdocs # Cdhtdocs # Chmod-R777attachment # Chmod-R777data # Chmod-R777html After the preparation is complete, enter http: // 192.168.0.151/install. php or http: // 192.168.0.90/install. php In the browser to initialize the forum. The installation interface is the configuration.

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.