雅虎新闻|| BBC新闻|| CNN新闻|| 美元指数|| 中国期货指数|| 股票指数|| 黄金|| 外汇|| 英汉互译|| 昭放工具
163邮箱|| 126邮箱|| 新浪邮箱|| 企业邮箱|| 21cn邮箱|| tom邮箱|| 搜狐邮箱|| hotmail邮箱|| msn邮箱|| qq邮箱

用户登录

设为主页| 淘宝铺| 加入收藏|
您的IP:18.191.192.109您的操作系统:Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)
个人便签
知识库
安装apache+php

网卡在/etc/sysconfig/network-scripts/底下。

添加:

BOOTPROTO=static

IPADDR=10.1.1.30

NETMASK=255.255.255.0

GATEWAY=10.1.1.254

DNS=114.114.114.114

NM_CONTROLLED=no

……

ONBOOT=yes

 

service network restart

yum -y install gcc

yum -y install gcc-c++

yum -y install bzip2

yum -y  install apr-devel apr apr-util

yum -y  install expat-devel

yum -y install httpd

/sbin/chkconfig httpd on

/sbin/service httpd start

vi /etc/selinux/config

将SELINUX=enforcing改为SELINUX=disabled

setenforce 0

systemctl stop firewalld.service

systemctl disable firewalld.service

reboot

yum -y install epel-release 

yum -y install libpng libpng-devel freetype freetype-devel libxml2 libxml2-devel zlib zlib-devel

yum install gd

rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm

yum search php7

yum -y install php72w-bcmath.x86_64 php72w-cli.x86_64 php72w-common.x86_64 php72w-dba.x86_64 php72w-devel.x86_64 php72w-embedded.x86_64 php72w-enchant.x86_64 php72w-fpm.x86_64 php72w-gd.x86_64 php72w-imap.x86_64 php72w-interbase.x86_64 php72w-intl.x86_64 php72w-ldap.x86_64 php72w-mbstring.x86_64 php72w-mysql.x86_64 php72w-odbc.x86_64 php72w-opcache.x86_64 php72w-pdo.x86_64 php72w-pdo_dblib.x86_64 php72w-pear.noarch php72w-pecl-apcu.x86_64 php72w-pecl-apcu-devel.x86_64 php72w-pecl-geoip.x86_64 php72w-pecl-igbinary.x86_64 php72w-pecl-igbinary-devel.x86_64 php72w-pecl-imagick.x86_64 php72w-pecl-imagick-devel.x86_64 php72w-pecl-libsodium.x86_64 php72w-pecl-memcached.x86_64 php72w-pecl-mongodb.x86_64 php72w-pecl-redis.x86_64 php72w-pecl-xdebug.x86_64 php72w-pgsql.x86_64 php72w-phpdbg.x86_64 php72w-process.x86_64 php72w-pspell.x86_64 php72w-recode.x86_64 php72w-snmp.x86_64 php72w-soap.x86_64 php72w-sodium.x86_64 php72w-tidy.x86_64 php72w-xml.x86_64 php72w-xmlrpc.x86_64 mod_php71w

php -v

vi /etc/php.ini

file_uploads = on ;//是否允许通过HTTP上传文件的开关。默认为ON即是开

upload_tmp_dir ;//文件上传至服务器上存储临时文件的地方,如果没指定就会用系统默认的临时文件夹

upload_max_filesize = 1024m ;//望文生意,即允许上传文件大小的最大值。默认为2M,我们设置为1G

post_max_size = 1024m ;//指通过表单POST给PHP的所能接收的最大值,我们也设置为1G

max_execution_time = 3600 ;//每个PHP页面运行的最大时间值(秒),默认30秒,设置为一小时,因为后面转码时间很久。

max_input_time = 36000 ;//每个PHP页面接收数据所需的最大时间,默认60秒

memory_limit = 8m ;//每个PHP页面所吃掉的最大内存,默认8M

 

mkdir /home/www

mkdir /home/www/html

mkdir /home/www/hetong

mkdir /home/logs

vi /etc/httpd/conf/httpd.conf

将DocumentRoot设为/home/www

<Directory /home/www>

    Order allow,deny

    Allow from all

</Directory>

# Further relax access to the default document root:

<Directory "/home/www/html">

......

</Directory>

ErrorLog "logs/error_log"

改为

ErrorLog "/home/logs/error_log"

CustomLog "logs/access_log" combined

改为

CustomLog "/home/logs/access_log" combined

在Listen 80下,添加

Listen 8001

<IfModule dir_module>

    DirectoryIndex index.html index.php

</IfModule>

 

<IfModule mime_module>中,添加

AddType application/x-httpd-php .php

 

配置虚拟主机

vi /etc/httpd/conf.d/vhostport.conf

NameVirtualHost 10.1.1.30:80

<VirtualHost 10.1.1.30:80>

   ServerAdmin admin@wgzrbs.com.cn

   DocumentRoot /home/www/html

   ServerName www.gzrbs.com.cn

</VirtualHost>

 

NameVirtualHost 10.1.1.30:8001

<VirtualHost 10.1.1.30:8001>

   ServerAdmin admin@gzrbs.com.cn

   DocumentRoot /home/www/hetong

   ServerName app.gzrbs.com.cn

</VirtualHost>

 

service httpd restart

 

yum -y install cmake bison-devel ncurses-devel libaio libaio-devel perl-Data-Dumper net-tools

yum -y install which

yum -y install wget

yum -y install mariadb mariadb-server

systemctl start mariadb

systemctl enable mariadb

mysql_secure_installation

首先是设置密码,会提示先输入密码。由于无密码,所以直接回车。

Enter current password for root (enter for none):<–初次运行直接回车

设置密码

Gzrb1234

Set root password? [Y/n] <– 是否设置root用户密码,输入y并回车或直接回车

New password: <– 设置root用户的密码

Re-enter new password: <– 再输入一次你设置的密码

其他配置,一律回车。

初始化MariaDB完成,接下来测试登录

mysql -uroot -p

完成。 

 

2、配置MariaDB的字符集

vi /etc/my.cnf

在[mysqld]标签下添加

init_connect='SET collation_connection = utf8_unicode_ci' 

init_connect='SET NAMES utf8' 

character-set-server=utf8 

collation-server=utf8_unicode_ci 

skip-character-set-client-handshake

 

vi /etc/my.cnf.d/client.cnf

在[client]中添加

default-character-set=utf8

vi /etc/my.cnf.d/mysql-clients.cnf

在[mysql]中添加

default-character-set=utf8

全部配置完成,重启mariadb

systemctl restart mariadb

之后进入MariaDB查看字符集

show variables like "%character%";

显示为

+--------------------------+----------------------------+

| Variable_name            | Value                      |

+--------------------------+----------------------------+

| character_set_client    | utf8                      |

| character_set_connection | utf8                      |

| character_set_database  | utf8                      |

| character_set_filesystem | binary                    |

| character_set_results    | utf8                      |

| character_set_server    | utf8                      |

| character_set_system    | utf8                      |

| character_sets_dir      | /usr/share/mysql/charsets/ |

+--------------------------+----------------------------+

8 rows in set (0.00 sec)

 

show variables like "%collation%";

+----------------------+-----------------+

| Variable_name        | Value          |

+----------------------+-----------------+

| collation_connection | utf8_unicode_ci |

| collation_database  | utf8_unicode_ci |

| collation_server    | utf8_unicode_ci |

+----------------------+-----------------+

3 rows in set (0.00 sec)

字符集配置完成。

 

3、添加用户,设置权限

授予外网登陆权限

grant all privileges on *.* to root@'%' identified by 'Gzrb1234';

CREATE DATABASE `datapp` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;

CREATE USER 'datapp'@'%' IDENTIFIED BY 'dpcf888';

GRANT ALL PRIVILEGES ON  datapp.* TO 'datapp'@'%' IDENTIFIED BY 'dpcf888';

FLUSH PRIVILEGES;

 

安装 ffmpeg

添加安装源

rpm --import http://li.nux.ro/download/nux/RPM-GPG-KEY-nux.ro

rpm -Uvh http://li.nux.ro/download/nux/dextop/el7/x86_64/nux-dextop-release-0-5.el7.nux.noarch.rpm

安装(yum install x264)(看下有没有必要)

yum install ffmpeg ffmpeg-devel -y

测试是否安装成功

ffmpeg

星期一, 08/05/2019 - 11:31 — 杨超