一、安装Nginx
挂载系统盘
创建运行账户和组,
解tar包
编译安装
开启服务
测试Nginx网页
二、配置虚拟Web主机
1.配置DNS服务
[root@centos04 ~]# yum -y install bind bind-chroot bind-utils
[root@centos04 ~]# vim /etc/named.conf
[root@centos04 ~]# vim /var/named/bdqn.com.zone
[root@centos04 ~]# vim /var/named/accp.com.zone
[root@centos05 ~]# systemctl restart named
[root@centos04 ~]# mkdir -p /var/www/bdqn
[root@centos04 ~]# mkdir -p /var/www/accp
[root@centos04 ~]# echo “www.bdqn.com” > /var/www/bdqn/index.html
[root@centos04 ~]# echo “www.accp.com” > /var/www/accp/index.html
[root@centos05 ~]# vim /usr/local/Nginx/conf/Nginx.conf
检查配置文件
[root@centos05 ~]# killall Nginx
[root@centos05 ~]# Nginx
安装MysqL
[root@centos04 ~]# yum -y install ncurses-devel.x86_64
[root@centos04 ~]# tar zxvf /mnt/cmake-2.8.6.tar.gz -C /usr/src/
[root@centos04 cmake-2.8.6]# ./configure gmake && gmake install
[root@centos04 ~]# tar zxvf /mnt/MysqL-5.5.22.tar.gz -C /usr/src/
[root@centos04 MysqL-5.5.22]# cmake -DCMAKE_INSTALL_PREFIX=/usr/local/MysqL -DDEFAULT_
CHARSET=utf8 -DDEFAULT_COLLATION=utf8_general_ci -DWITH_EXTRA_CHARSETS=all -DSYSconfdIR=/etc
[root@centos04 MysqL-5.5.22]# make && make install
[root@centos04 MysqL-5.5.22]# cp support-files/my-medium.cnf /etc/my.cnf
[root@centos04 MysqL-5.5.22]# cp support-files/MysqL.server /etc/init.d/MysqLd
[root@centos04 MysqL-5.5.22]# chmod +x /etc/init.d/MysqLd
[root@centos04 MysqL-5.5.22]# chkconfig --add MysqLd
[root@centos04 MysqL-5.5.22]# chkconfig --level 35 MysqLd on
[root@centos04 MysqL-5.5.22]# vim /etc/profile
PATH=$PATH:/usr/local/MysqL/bin/
[root@centos04 MysqL-5.5.22]# source /etc/profile
[root@centos04 MysqL-5.5.22]# groupadd MysqL
[root@centos04 MysqL-5.5.22]# useradd -M -s /sbin/nologin -g MysqL MysqL
[root@centos04 MysqL-5.5.22]# chown -R MysqL:MysqL /usr/local/MysqL/
[root@centos04 MysqL-5.5.22]# /usr/local/MysqL/scripts/MysqL_install_db --basedir=/usr
/local/MysqL --datadir=/usr/local/MysqL/data --user=MysqL
四、安装PHP
[root@centos04 ~]# yum -y install gd libxml2-devel.x86_64 libjpeg-turbo-devel.x86_64 libpng-devel.x86_64
[root@centos04 ~]# tar zxvf /mnt/PHP-5.3.28.tar.gz -C /usr/src/
[root@centos04 ~]# cd /usr/src/PHP-5.3.28/
[root@centos04 PHP-5.3.28]# ./configure --prefix=/usr/local/PHP --with-gd --with-zlib
–with-MysqL=/usr/local/MysqL --with-MysqLi=/usr/local/MysqL/bin/MysqL_config --with-config-file-path=/usr/local/PHP --enable-mbstring --enable-fpm --with-jpeg-dir=/usr/lib
[root@centos04 PHP-5.3.28]# make && make install
[root@centos04 PHP-5.3.28]# cp PHP.ini-production /usr/local/PHP/PHP.ini
[root@centos04 PHP-5.3.28]# ln -s /usr/local/PHP/bin/* /usr/local/bin
[root@centos04 PHP-5.3.28]# ln -s /usr/local/PHP/sbin/* /usr/local/sbin/
[root@centos04 ~]# tar zxvf /mnt/ZendGuardLoader-PHP-5.3-linux-glibc23-x86_64.tar.gz -C /usr/src/
[root@centos04 ZendGuardLoader-PHP-5.3-linux-glibc23-x86_64]# cd PHP-5.3.x/
[root@centos04 PHP-5.3.x]# cp ZendGuardLoader.so /usr/local/PHP/lib/PHP
五、配置Nginx支持PHP环境
[root@centos04 ~]# cd /usr/local/PHP/etc/
[root@centos04 etc]# cp PHP-fpm.conf.default PHP-fpm.conf
[root@centos04 etc]# useradd -M -s /sbin/nologin PHP
[root@centos04 etc]# vim PHP-fpm.conf
[root@centos04 ~]# vim /usr/local/Nginx/conf/Nginx.conf
六、部署论坛
[root@centos01 ~]# unzip discuz_X3.2_SC_UTF8.zip
[root@centos01 ~]# mv upload/* /var/www/bdqn/bbs
[root@centos01 ~]# chown -R Nginx:Nginx /var/www/bdqn/bbs/
[root@centos01 ~]# chmod -R 755 /var/www/bdqn
[root@centos01 ~]# MysqL -uroot -ppwd@123
MysqL> create database bbs;
MysqL> grant all on bbs.* to ‘bbs’@‘localhost’ identified by ‘pwd@123’;
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。