标签:dde config 共享库 soc body cal ref 查看 文件
********************************************************************************************************************************************
1.安装依赖环境
********************************************************************************************************************************************
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
yum -y install epel-release
yum install -y gcc gcc-c++ pcre pcre-devel zlib zlib-devel openssl openssl-devel
********************************************************************************************************************************************
2.安装Nginx
********************************************************************************************************************************************
useradd -M -s /sbin/nologin nginx
wget http://nginx.org/download/nginx-1.13.12.tar.gz
tar -xzvf nginx-1.13.12.tar.gz
cd nginx-1.13.12/
./configure --prefix=/usr/local/nginx --user=nginx --group=nginx --with-http_ssl_module
make && make install
/usr/local/nginx/sbin/nginx #启动Nginx
echo "/usr/local/nginx/sbin/nginx" >> /etc/rc.d/rc.local #设置开机自动
kill -QUIT $(cat /usr/local/nginx/logs/nginx.pid) #关闭Nginx
********************************************************************************************************************************************
3.安装Ncurses
********************************************************************************************************************************************
yum install -y ncurses-devel
wget http://ftp.gnu.org/gnu/ncurses/ncurses-6.1.tar.gz
tar -xzvf ncurses-6.1.tar.gz
cd ncurses-6.1/
./configure --with-shared \
--without-debug \
--without-ada \
--enable-overwrite
# 若不安装ncurses编译MySQL时会报错
# --without-ada参数为设定不编译为ada绑定,因进入chroot环境不能使用ada ;
# --enable-overwrite参数为定义把头文件安装到/tools/include下而不是/tools/include/ncurses目录
# --with-shared 生成共享库
make && make install
********************************************************************************************************************************************
4.安装-MySQL
********************************************************************************************************************************************
yum install -y cmake bison
groupadd mysql
useradd -M -g mysql -s /sbin/nologin mysql
wget http://mirrors.sohu.com/mysql/MySQL-5.5/mysql-5.5.54.tar.gz
tar -xzvf mysql-5.5.59.tar.gz
cd mysql-5.5.59/
cmake -DCMAKE_INSTALL_PREFIX=/usr/local/mysql-5.5 \
-DMYSQL_UNIX_ADDR=/tmp/mysql.sock \
-DEXTRA_CHARSETS=all \
-DDEFAULT_CHARSET=utf8 \
-DDEFAULT_COLLATION=utf8_general_ci \
-DWITH_MYISAM_STORAGE_ENGINE=1 \
-DWITH_INNOBASE_STORAGE_ENGINE=1 \
-DWITH_MEMORY_STORAGE_ENGINE=1 \
-DWITH_READLINE=1 \
-DENABLED_LOCAL_INFILE=1 \
-DMYSQL_USER=mysql \
-DMYSQL_TCP_PORT=3306
make && make install
********************************************************************************************************************************************
5.配置-MySQL
********************************************************************************************************************************************
1.修改 MySQL 目录权限
cd /usr/local/mysql-5.5/
chown -R root.mysql .
chown -R mysql data
chmod 755 -R /usr/local/mysql-5.5/
2.拷贝相关配置文件
cp -a /usr/local/mysql-5.5/support-files/my-medium.cnf /etc/my.cnf
cp -a /usr/local/mysql-5.5/support-files/mysql.server /etc/init.d/mysqld
chmod +x /etc/init.d/mysqld
3.初始化MySQL
cd /usr/local/mysql-5.5/scripts/
/usr/local/mysql-5.5/scripts/mysql_install_db \
--basedir=/usr/local/mysql-5.5/ \
--datadir=/usr/local/mysql-5.5/data/ \
--user=mysql
4.创建数据库授权表,初始化数据库
cd /usr/local/mysql-5.5/
/usr/local/mysql-5.5/scripts/mysql_install_db --user=mysql --basedir=/usr/local/mysql-5.5/
5.启动 MySQL 服务
/usr/local/mysql-5.5/bin/mysqld_safe --user=mysql &
6.设置开机自启动 MySQL
echo "/usr/local/mysql/bin/mysqld_safe --user=mysql &" >>/etc/rc.local
chkconfig mysqld on
chkconfig --list mysqld
7.设定 MySQL 初始密码
echo ‘export PATH=/usr/local/mysql-5.5/bin:$PATH‘ >> /etc/profile
source /etc/profile
mysql_secure_installation
8.测试 MySQL数据库能否使用
/usr/local/mysql-5.5/bin/mysql -u root -p
********************************************************************************************************************************************
6.安装-PHP
********************************************************************************************************************************************
yum install -y openssl openssl-devel curl curl-devel libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel pcre pcre-devel libxslt libxslt-devel bzip2 bzip2-devel libxml2 libxml2-devel
wget http://cn2.php.net/distributions/php-7.0.0.tar.gz
tar -xzvf php-7.0.0.tar.gz
cd php-7.0.0/
./configure --prefix=/usr/local/php7 --with-curl --with-freetype-dir --with-gd --with-gettext --with-iconv-dir --with-kerberos --with-libdir=lib64 --with-libxml-dir --with-mysqli --with-openssl --with-pcre-regex --with-pdo-mysql --with-pdo-sqlite --with-pear --with-png-dir --with-jpeg-dir --with-xmlrpc --with-xsl --with-zlib --with-bz2 --with-mhash --enable-fpm --enable-bcmath --enable-libxml --enable-inline-optimization --enable-gd-native-ttf --enable-mbregex --enable-mbstring --enable-opcache --enable-pcntl --enable-shmop --enable-soap --enable-sockets --enable-sysvsem --enable-sysvshm --enable-xml --enable-zip
make && make install
********************************************************************************************************************************************
7.配置-Nginx+PHP
********************************************************************************************************************************************
1.拷贝相应配置文件
cp -a php.ini-development /usr/local/php7/lib/php.ini
cp -a /usr/local/php7/etc/php-fpm.conf.default /usr/local/php7/etc/php-fpm.conf
cp -a sapi/fpm/php-fpm /usr/local/bin
vim /usr/local/php7/lib/php.ini
cgi.fix_pathinfo=0
2.编辑PHP主配置文件
编辑配置文件,在PHP文件末尾追加写入以下标★语句
--------------------------------------------------------------------------------------------------------------
vim /usr/local/php7/lib/php.ini
★cgi.fix_pathinfo=1 #将注释去掉,开启PHP的pathinfo伪静态功能
★max_execution_time = 0 #脚本运行的最长时间,默认30秒
★max_input_time = 300 #脚本可以消耗的时间,默认60秒
★memory_limit = 256M #脚本运行最大消耗的内存,根据你的需求更改数值,默认128M
★post_max_size = 100M #单提交的最大数据,默认100M
★upload_max_filesize = 10M #上载文件的最大许可大小,默认2M
--------------------------------------------------------------------------------------------------------------
3.修改php-fpm的配置
编辑配置文件,在PHP-fpm文件中,修改以下标★语句
--------------------------------------------------------------------------------------------------------------
cd /usr/local/php7/etc/php-fpm.d/
cp -a www.conf.default www.conf
vim /usr/local/php7/etc/php-fpm.d/www.conf
★listen.owner = nobody #解除注释
★listen.group = nobody #解除注释
★user = nginx #将apache修改为nginx
★group = nginx #将apache修改为nginx
--------------------------------------------------------------------------------------------------------------
4.修改nginx的主配置
编辑配置文件,在server语句内,写入以下标★语句
--------------------------------------------------------------------------------------------------------------
vim /usr/local/nginx/conf/nginx.conf
38 server {
39 listen 80 default_server;
40 listen [::]:80 default_server;
41 server_name _;
42 root /usr/share/nginx/html;
43
44 # Load configuration files for the default server block.
45 include /etc/nginx/default.d/*.conf;
46
★ location / {
★
★ root html;
★ index index.php index.html index.htm;
★
52 }
53
★ location ~ \.php$ {
★ root /usr/local/nginx/html;
★ try_files $uri =404;
★ fastcgi_pass 127.0.0.1:9000;
★ fastcgi_index index.php;
★ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
★ include fastcgi_params;
★ }
62
63 error_page 404 /404.html;
64 location = /40x.html {
65 }
--------------------------------------------------------------------------------------------------------------
5.设置网页目录权限
chown -R nginx:nginx /usr/local/nginx/html/
6.新建index.php测试页
vim /usr/local/nginx/html/index.php
<?php
phpinfo();
?>
7.重启服务,并查看9000端口是否启动成功
/usr/local/nginx/sbin/nginx
/usr/local/php7/sbin/php-fpm
netstat -npa | grep 9000
标签:dde config 共享库 soc body cal ref 查看 文件
原文地址:https://www.cnblogs.com/LyShark/p/9062643.html