准备工作
在安装RHEL7.0之前,我们需要先进行一些准备工作,包括:
1、更新系统软件包
2、配置防火墙
3、创建虚拟用户和组
4、设置时区
5、配置SELinux
6、安装必要的依赖包
安装Nginx1.6.0
1、下载Nginx源码包
wget http://nginx.org/download/nginx-1.6.0.tar.gz
2、解压源码包
tar -zxvf nginx-1.6.0.tar.gz
3、进入解压后的目录
cd nginx-1.6.0
4、配置编译选项
./configure --prefix=/usr/local/nginx --with-http_ssl_module --with-http_stub_status_module --with-pcre --with-stream --with-stream_ssl_module --with-http_realip_module --with-http_addition_module --with-http_dav_module --with-http_flv_module --with-http_mp4_module --with-http_gunzip_module --with-http_gzip_static_module --with-http_random_index_module --with-http_secure_link_module --with-http_degradation_module --with-http_slice_module --with-http_geoip_module --with-http_perl_module --with-mail --with-mail_ssl_module --with-file-aio --with-threads --with-stream --with-stream_ssl_module --with-stream_ssl_preread_module --with-stream_realip_module --with-stream_ssl_preread_module --with-ipv6 --with-http_CDN_module --with-http_CDN_ssl_module --with-http_xslt_module --with-http_image_filter_module --with-http_geoip_module --with-http_sub_module --with-http_dav_docroot_module --with-http_autoindex_module --with-http_limit_conn_module --with-http_limit_conn_log_level=warn --with-http_memcached_module=dynamic --with-http_referer_module --with-http_stub_status_module=on --without-mailutils --without-pcre-jit --without-compat $ADDITIONAL_CONFIGUREOPTS
5、编译并安装Nginx
make && make install
6、启动Nginx
/usr/local/nginx/sbin/nginx
安装MySQL5.6.19和PHP5.5.14
1、添加MySQL官方Yum源
wget https://dev.mysql.com/get/mysql57-community-release-el7-9.noarch.rpm sudo rpm -ivh mysql57-community-release-el7-9.noarch.rpm
2、安装MySQL5.6.19和PHP5.5.14的依赖包
yum install perl wget zlib zlib-devel bzip2 bzip2-devel openssl openssl-devel ncurses ncurses-devel cyrus-sasl-devel cyrus-sasl-gssapi libxml2 libxml2-devel libpam libpam0g libpam0g--devel pcre pcre-devel apr apr-devel aprutil aprutil-devel db4 php php php-devel php-mysql php-pear php-gd php-ldap phpize phpunit xmlrpc xmlrpc-c xmlrpc-epilog soap soapcppir soapcppir++ curl curl curl-devel epel-release epel-release-server elfutils elfutils-libelf elfutils-libelf-devel kernel kernel-headers kernel-devel kmod kmod-devel device-mapper device-mapper-devel jq jsonkit jsonkit1 jsonkit1--python3 git netconf netconflib netconflib--c libtool automake automake autoconf subversion subversion--libs subversion--cmake subversion--cmake--libs yumrepomanager yumchecksums yumclean all of them are needed for the installation of PHP and MySQL later on)
3、安装MySQL5.6.19和PHP5.5.14
yum install mysql mysql56 php php55 php55u libapache2 mod_php php55mod phpmyadmin phpbench phpseclib phpredisnd phpsoap phpxmlrpc phppgsql phpsem fpm mariadb mariadb10 mariadb10g mariadb10g--libs mariadb10g--clients mariadb10g--devel mariadb10g--perl mariadb10g--python mariadb10g--python3 mariadb10g--tools mariadb10g--libs memcached memcached--libs memcached--python memcached--python3 memcached--tools mysql mysql56 mysql56u mysqlclient mysqlcommon mysqldump mysqlnd mysqlnd devel mysqlnd mysysstat mysysstat devel mysqlslap mysqlslap client mysqlslap server netcat netcat util netcat util devel openldap openldap openldap client openldap server openssh openssh client openssh server procps procps procps devel pth pth util pth util devel sysstat sysstat sysstat util sysstat util devel which whois yumutils yumchecksums yumclean all of them are needed for the installation of PHP and MySQL later on)
配置Nginx和PHP环境变量(可选)如果需要使用自定义的PHP版本,可以在~/.bashrc文件中添加以下内容:export PHPINIDIR=/usr/local/php55/etc/php.ini然后执行source ~/.bashrc使之生效。
原创文章,作者:K-seo,如若转载,请注明出处:https://www.kdun.cn/ask/192511.html