centos7安装连锁当家软件的步骤
<p>centos7安装连锁当家软件的步骤
1.安装网卡
安装界面选择激活网卡;并且可以设置ip地址;
设置时区</p>
<pre><code>timedatectl set-timezone Asia/Shanghai</code></pre>
<p>2.postgresql 10 安装</p>
<p>yum install <a href="https://download.postgresql.org/pub/repos/yum/10/redhat/rhel-7-x86_64/pgdg-centos10-10-2.noarch.rpm">https://download.postgresql.org/pub/repos/yum/10/redhat/rhel-7-x86_64/pgdg-centos10-10-2.noarch.rpm</a></p>
<p>yum install postgresql10
yum install postgresql10-server
/usr/pgsql-10/bin/postgresql-10-setup initdb
systemctl enable postgresql-10
systemctl start postgresql-10</p>
<p>编辑#vi /var/lib/pgsql/10/data/pg_hba.conf文件
IPv4
host all all 0.0.0.0/0 md5</p>
<p>编辑#vi /var/lib/pgsql/10/data/postgresql.conf 文件。
将 #listen_addresses = 'localhost' 修改为 listen_addresses='*' </p>
<p>systemctl start postgresql-10 #启动服务
systemctl restart postgresql-10 #重启服务
systemctl stop postgresql-10 #停止服务</p>
<p>systemctl enable postgresql-10.service 开机启动</p>
<p>为了数据库存在/data目录下,所以需要创建表空间
创建表空间
在/data中创建zgsplace文件夹,赋予用户postgres用户写入和读取权限
<code># mkdir -p /data/zgsplace </code># chown postgres:postgres /data/zgsplace/ </p>
<p>登陆数据库修改访问密码</p>
<p>``#su postgres</p>
<p>$psql</p>
<pre><code>ALTER USER postgres PASSWORD 'bearsoft';</code></pre>
<pre><code>CREATE TABLESPACE zgsplace LOCATION '/data/zgsplace'; </code></pre>
<p>\q 退出psql</p>
<p>如果需要还原数据库,参考。。。。。。。</p>
<p>Apache 安装
yum install httpd //默认情况下,选择Y,进行安装</p>
<p>安装成功后,默认情况下,是禁止外部IP访问的,需要进行设置
vi /etc/httpd/conf/httpd.conf //进入配置文件
找到
<Directory />
AllowOverride none
Require all denied
</Directory >
修改为:
<Directory />
AllowOverride none
Require all granted
</Directory ></p>
<p>systemctl start httpd.service //启动
systemctl stop httpd.service //停止
systemctl status httpd.service //查看状态
systemctl restart httpd.service //重启
systemctl enable httpd.service //开机启动</p>
<p>虚拟目录的建立
在 /etc/httpd/conf.d/ 下面建立一个 vhost.conf 文件来配置虚拟主机。
<VirtualHost *:80></p>
<h1>绑定的主域</h1>
<p>ServerName demo.upyuan.com</p>
<h1>绑定的子域名</h1>
<h1>ServerAlias www.test.com</h1>
<h1>网站主目录</h1>
<p>DocumentRoot /var/www/html/demo.upyuan.com/</p>
<h1>日志配置</h1>
<h1>ErrorLog /home/web_log/com.test.www_error.log</h1>
<h1>CustomLog /home/web_log/com.test.www_access.log common</h1>
<h1>ServerSignature Off</h1>
<p></VirtualHost></p>
<h1>测试一的配置</h1>
<p><Directory "/var/www/html/demo.upyuan.com/">
Options Indexes FollowSymLinks </p>
<h1>Options FollowSymLinks 不允许通过目录访问文件列表</h1>
<pre><code>AllowOverride All
Require all granted</code></pre>
<p></Directory></p>
<p>// 如果有更多内容,重复上面的</p>
<p>PHP7 安装
1.安装epel-release
通过命令:
yum -y install epel-release
成功安装。
2.安装PHP7
终端再次运行如下命令:
rpm -Uvh <a href="https://mirror.webtatic.com/yum/el7/webtatic-release.rpm">https://mirror.webtatic.com/yum/el7/webtatic-release.rpm</a>
成功获取PHP7的yum源,然后再执行:
yum install php70w
这样就大功告成了。
yum install php70w php70w-pgsql php70w-mbstring php70w-pdo_dblib php70w-pdo -y</p>
<p>修改php.ini中的默认上传文件的大小为8M
vi /etc/php.ini</p>
<pre><code>##################
date.timezone = &quot;Asia/Shanghai&quot;; ##时区一定要设置。 重要。。。。
##################
upload_max_filesize = 32m ;#望文生意,即允许上传文件大小的最大值。默认为2M
post_max_size = 32m ;#指通过表单POST给PHP的所能接收的最大值,包括表单里的所有值。默认为8M
max_execution_time = 600;#每个PHP页面运行的最大时间值(秒),默认30秒
max_input_time = 600;#每个PHP页面接收数据所需的最大时间,默认60秒</code></pre>
<p>systemctl restart httpd 重启 APACHE</p>
<p>2.0版本php代码的上传;3.0因为是共享代码,不用给商户单独安装php;
比如;给客户配置的域名是:test.9isoft.com</p>
<p>文件夹同一放在upyuan目录下(<strong>如果没有的话 自已新建一个upyuan目录</strong>);例如 /data/www/html/upyuan/目录下
需要手工建立upyuan/log文件夹,upyuan/uploadimg;并且给予777权限;或者apache用户写这个文件夹权限;</p>
<p>数据库配置文件在/common/pg_inc.php中(以后可能会调整);
图片缓存配置放在ossconfig.php中(以后会调整)OSS_TEST_BUCKET 默认是bearsoft;以后会根据不同的用户使用不同的oss子目录</p>
<p>centos7 关闭防火墙
<code>#systemctl stop firewalld.service </code>#systemctl disable firewalld.service
编辑关闭防火墙
vi /etc/sysconfig/selinux<br />
``#SELINUXTYPE=targeted #注释掉
SELINUX=enforcing 修改为disabled
关闭SELinux,重启永久生效</p>
<p>centos7 中文乱码 </p>
<p>``#cp /etc/locale.conf /etc/locale.conf_bak</p>
<p>``# vim /etc/locale.conf </p>
<p>LANG="zh_CN.GB18030"
LANGUAGE="zh_CN.GB18030:zh_CN.GB2312:zh_CN"
SUPPORTED="zh_CN.UTF-8:zh_CN:zh:en_US.UTF-8:en_US:en"
SYSFONT="lat0-sun16"</p>
<p>``#exit</p>
<p>``#yum clean all</p>
<p>``#rpm -Uvh <a href="https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm">https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm</a> </p>
<p>``#rpm -Uvh <a href="https://mirror.webtatic.com/yum/el7/webtatic-release.rpm">https://mirror.webtatic.com/yum/el7/webtatic-release.rpm</a> </p>
<p>systemctl stop firewalld.service #停止firewall
systemctl disable firewalld.service #禁止firewall开机启动</p>
<p>关闭防火墙
sudo systemctl disable firewalld.service
关闭防火墙开机启动:sudo systemctl disable firewalld.service
安装iptables防火墙
执行以下命令安装iptables防火墙:sudo yum install iptables-services
设置iptables防火墙开机启动:sudo systemctl enable iptables</p>
<p>2.设置防火墙
Centos7下的防火墙已经由iptables改为firewall,使用firewall-cmd命令开放80及443端口:
firewall-cmd –permanent –zone=public –add-service=http
firewall-cmd –permanent –zone=public –add-service=https
firewall-cmd –reload
设置SELinux为permissive模式 命令行下 setenforce 0 立即生效,重启失效。
。
笔者ip为192.168.1.108,测试下服务器能否打开,浏览器http://192.168.1.108回车后看到欢迎页面,说明服务器正常运行
ftp服务器增加了安全性;需要增加一行;或者你可以在vsftpd的配置文件中增加下列两项中的一项:
allow_writeable_chroot=YES</p>
<p>开启端口
firewall-cmd --zone=public --add-port=80/tcp --permanent
命令含义:
--zone #作用域
--add-port=80/tcp #添加端口,格式为:端口/通讯协议
--permanent #永久生效,没有此参数重启后失效
重启防火墙
firewall-cmd --reload
--接下来就可以进入安装系统初始化的步骤;
请参考连锁当家租户数据库初始化步骤;</p>
<p>其他可能有用,但是我们程序没有用到:</p>
<p>Linux CentOS 7编译redis报错"cc:未找到命令"解决方案
yum -y install gcc automake autoconf libtool make </p>
<p>1、方法一:安装mariadb
MariaDB数据库管理系统是MySQL的一个分支,主要由开源社区在维护,采用GPL授权许可。开发这个分支的原因之一是:甲骨文公司收购了MySQL后,有将MySQL闭源的潜在风险,因此社区采用分支的方式来避开这个风险。MariaDB的目的是完全兼容MySQL,包括API和命令行,使之能轻松成为MySQL的代替品。
安装mariadb,大小59 M。
[root@yl-web yl]# yum install mariadb-server mariadb
mariadb数据库的相关命令是:
systemctl start mariadb #启动MariaDB
systemctl stop mariadb #停止MariaDB
systemctl restart mariadb #重启MariaDB
systemctl enable mariadb #设置开机启动
所以先启动数据库
[root@yl-web yl]# systemctl start mariadb
然后就可以正常使用mysql了 注意开放3306端口;
``# mysql -u root -p
set password for 'root'@'localhost' =password('bearsoft');
grant all privileges on <em>.</em> to root@'%'identified by 'password';
exit;</p>