标签:pid com 解决 发布 path 技术分享 sockets nbsp ons
Mysql安装
tar zxf mysql-boost-5.7.17.tar.gz
yum install -y gcc gcc-c++
yum install cmake-2.8.12.2-4.el6.x86_64.rpm -y
cd mysql-5.7.17/
yum install -y ncurses-devel
yum install -y bison
yum install cmake
cmake -DCMAKE_INSTALL_PREFIX=/usr/local/lnmp/mysql -DMYSQL_DATADIR=/usr/local/lnmo/mysql/data -DMYSQL_UNIX_ADDR=/usr/local/lnmp/mysql/data/mysql.sock -DWITH_MYISAM_STORAGE_ENGINE=1 -DWITH_INNOBASE_STORAGE_ENGINE=1 -DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8_general_ci -DEXTRA_CHARSETS=all -DWITH_BOOST=boost/boost_1_59_0/
make ##编译
mkae install
cd /etc/
ll my.cnf
-rw-r--r--. 1 root root 251 Aug 9 2013 my.cnf
mv my.cnf my.cnf.bak ##更改文件名,做一个备份
cd /usr/local/lnmp/mysql/support-files
cp my-default.cnf /etc/my.cnf
vim /etc/my.cnf
vim mysql.server
cp mysql.server /etc/init.d/mysqld ##将编译完成的mysql脚本复制到系统启动服务的默认目录
ll /etc/init.d/mysqld ##查看权限,如果权限不足须赋予权限
-rwxr-xr-x 1 root root 10916 Sep 21 16:31 /etc/init.d/mysqld
cd /usr/local/lnmp/mysq
groupadd -g 27 mysql ##建立mysql组
useradd -u 27 -g 27 mysql ##建立mysql用户
id mysql ##查看用户id
uid=27(mysql) gid=27(mysql) groups=27(mysql)
cd /usr/local/lnmp/mysql/bin/
vim ~/.bash_profile
source ~/.bash_profile ##刷新
mysqld --initialize --user=mysql ##初始化(弹出的数据中的最后一条冒号后的是初次登入密码)
2018-09-21T08:36:06.154856Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2018-09-21T08:36:06.154920Z 0 [Warning] ‘NO_ZERO_DATE‘, ‘NO_ZERO_IN_DATE‘ and ‘ERROR_FOR_DIVISION_BY_ZERO‘ sql modes should be used with strict mode. They will be merged with strict mode in a future release.
2018-09-21T08:36:06.154925Z 0 [Warning] ‘NO_AUTO_CREATE_USER‘ sql mode was not set.
2018-09-21T08:36:09.269783Z 0 [Warning] InnoDB: New log files created, LSN=45790
2018-09-21T08:36:09.919612Z 0 [Warning] InnoDB: Creating foreign key constraint system tables.
2018-09-21T08:36:10.158974Z 0 [Warning] No existing UUID has been found, so we assume that this is the first time that this server has been started. Generating a new UUID: 6405b9fe-bd79-11e8-b2ef-5254009ad516.
2018-09-21T08:36:10.275894Z 0 [Warning] Gtid table is not ready to be used. Table ‘mysql.gtid_executed‘ cannot be opened.
2018-09-21T08:36:10.277009Z 1 [Note] A temporary password is generated for root@localhost: ATqHlJ5i#tfv
/etc/init.d/mysqld start ##开启mysql
mysql_secure_installation ##初始化数据库
在第一次交互请求后面输入刚刚初始化时复制的密码
然后输入两次新密码
接下来的交互式请求可以直接回车,这条交互式请求是询问你是否要检查密码强度,如果输入y,就要重新修改密码,密码长度必须超过8位,必须有大小写字母,所以直接回车
接下来会询问是否要修改root密码,直接回车,因为上面已经设置过了
接下来全部输入y回车
此时就已经可以进入mysql了
mysql -p
Enter password:
cd /usr/local/lnmp/mysq
chown root.mysql . -R ##将此目录所有文件和用户和家目录都改成超级用户
chown mysql data/ -R
Php源码安装
tar -xzf php-5.6.35.tar.gz
ls
./configure --help | grep mysql ##过滤出于mysql相关模块
cd php-5.6.35
cd
为了解决依赖性,需要安装下面各包,没有的需要自行下载
yum install -y gd-devel-2.0.35-11.el6.x86_64.rpm
yum install libmcrypt-2.5.8-9.el6.x86_64.rpm
yum install libmcrypt-devel-2.5.8-9.el6.x86_64.rpm
rpm -ivh re2c-0.13.5-1.2.x86_64.rpm
yum install libxml2-devel -y
yum install openssl-devel -y
yum install curl-devel -y
yum install gmp-devel -y
yum install net-snmp-devel -y
cd php-5.6.35
./configure --prefix=/usr/local/lnmp/php --with-config-file-path=/usr/local/lnmp/php/etc --with-openssl --with-snmp --with-gd --with-zlib --with-curl --with-libxml-dir --with-png-dir --with-jpeg-dir --with-freetype-dir --with-gettext --without-pear--with-gmp --enable-optimization --enable-soap --enable-ftp --enable-sockets --enable-mbstring --with-mysql --with-mysqli --with-pdo-mysql --enable-mysqlnd --enable-fpm --with-fpm-user=nginx --with-fpm-group=nginx --with-mcrypt --with-mhash
make&make install ##编译
cd /usr/local/lnmp/php/etc/
cp php-fpm.conf.default php-fpm.conf ##复制配置文件
cd
cd php-5.6.35
cp php.ini-production /usr/local/lnmp/php/etc/php.ini
vim /usr/local/lnmp/php/etc/php-fpm.conf
将第25行注释去掉(pid)
cd /usr/local/lnmp/php/etc/
vim php.ini
修改时区
id nginx
useradd -M -d /usr/local/lnmp/nginx -s /sbin/nologin nginx ##创建nginx用户
Id nginx
cd
cd php-5.6.35
cd sapi/fpm/
cp init.d.php-fpm /etc/init.d/php-fpm ##制作php启动脚本
chmod +x /etc/init.d/php-fpm ##给启动脚本添加执行权限
/etc/init.d/php-fpm start
ps -ax ##查看php进程是否开启
netstat -antlp 查看端口状态
Nginx安装
tar zxf nginx-1.14.0.tar.gz
cd nginx-1.14.0
cd src/core/
vim nginx.h ##去除版本号
cd auto/cc/
vim gcc
注释光标所示行
cd
cd nginx-1.14.0
yum install pcre-devel -y ##解决依赖安装 如果没有gcc也需安装
./configure --prefix=/usr/local/lnmp/nginx --with-http_ssl_module --with-http_stub_status_module --user=nginx --group=nginx --with-threads --with-file-aio
id nginx ##查看是否有nginx用户,如果没有须创建
make ##进行编译
make install
cd /usr/local/lnmp/nginx/conf
vim nginx.conf ##编辑配置文件
vim /etc/security/limits.conf
nginx - nofile 65536
vim /root/.bash_profile ##制作启动脚本
source /root/.bash_profile ##刷新
cd /usr/local/lnmp/nginx/sbin/
nginx -t ##检测语法
nginx ##打开服务
cd /usr/local/lnmp/nginx/html/ ##默认发布目录
vim index.php ##编辑php发布文件
cd /usr/local/lnmp/nginx/conf/
访问 172.25.8.5
vim nginx.conf ##修改默认读取顺序
nginx -s reload ##重载
访问 172.25.8.5
论坛搭建
yum install unzip -y
unzip Discuz_X3.2_SC_UTF8.zip -d /usr/local/lnmp/nginx/html/ ##解压到指定目录
cd /usr/local/lnmp/nginx/html/
mv upload/ bss ##更改目录名
cd bss/
浏览器访问 172.25.8.5/bss/install
但会出现如图所示问题
chmod 777 config/ data/ uc_server/ uc_client/ -R ##赋予所需权限
继续
但此时优惠出现如图所示问题
cd /usr/local/lnmp/php/etc/
vim php.ini
/etc/init.d/php-fpm reload
但此时安装还会有问题
cd /usr/local/lnmp/mysql
chmod 755 data/ ##赋予权限
/etc/init.d/mysqld start
此时安装成功
登陆
进入管理中心
删除图中所示文件 避免二次安装
cd /usr/local/lnmp/nginx/html/bss/install
rm -fr index.php
ok!!
标签:pid com 解决 发布 path 技术分享 sockets nbsp ons
原文地址:https://www.cnblogs.com/zhengyipengyou/p/9747783.html