ICode9

精准搜索请尝试: 精确搜索
首页 > 系统相关> 文章详细

centos6.9 安装 php 运行环境,php5.3.3、php-mcrypt、ZendGuardLoader、Apache、设置IP

2020-05-17 22:53:26  阅读:183  来源: 互联网

标签:httpd x86 IP ZendGuardLoader etc 64 mysql php


cat /etc/redhat-release
CentOS release 6.9 (Final)
-- ----------------------------------------------------------------------
cat /proc/version
Linux localhost.localdomain 2.6.32-696.20.1.el6.x86_64 #1 SMP Fri Jan 26 17:51:45 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
-- ----------------------------------------------------------------------
php -version
PHP 5.3.3 (cli) (built: Mar 22 2017 12:27:09)
Copyright (c) 1997-2010 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies
with Zend Guard Loader v3.3, Copyright (c) 1998-2010, by Zend Technologies
-- ----------------------------------------------------------------------
mysql -V
mysql Ver 14.14 Distrib 5.1.73, for redhat-linux-gnu (x86_64) using readline 5.1
-- ----------------------------------------------------------------------
apachectl -v
Server version: Apache/2.2.15 (Unix)
Server built: Oct 19 2017 16:43:38
-- ----------------------------------------------------------------------
#find / -name 'httpd'
#/opt/sh/etc_config/httpd
#/etc/sysconfig/httpd
#/etc/rc.d/init.d/httpd
#/etc/httpd
#/etc/logrotate.d/httpd
#/usr/sbin/httpd
#/usr/lib64/httpd
#/var/run/httpd
#/var/log/httpd
#/var/lock/subsys/httpd
-- ----------------------------------------------------------------------
命令行模式
systemctl set-default multi-user.target
-- ----------------------------------------------------------------------
支持xshell
service sshd status
-- ----------------------------------------------------------------------
##### 开放端口 ##########
查看当前开放的端口
/etc/init.d/iptables status
service iptables status
设置端口
iptables -I INPUT -p tcp --dport 3306 -j ACCEPT
iptables -I INPUT -p tcp --dport 9080 -j ACCEPT
iptables -I INPUT -p tcp --dport 9081 -j ACCEPT
保存设置
/etc/init.d/iptables save
service iptables save
重启使生效
/etc/init.d/iptables restart
service iptables restart
-- ----------------------------------------------------------------------
开机启动
ln -s /etc/init.d/sshd /etc/rc.d/rc3.d/S100ssh
ln -s /etc/init.d/mysqld /etc/rc.d/rc3.d/S100mysqld
ln -s /etc/init.d/httpd /etc/rc.d/rc3.d/S100httpd
-- ----------------------------------------------------------------------
静态IP
vi /etc/sysconfig/network-scripts/ifcfg-eth0
添加以下内容
DEVICE=eth0
NAME=eth0
TYPE=Ethernet
BOOTPROTO=static
HWADDR=00:15:5D:00:7C:09
IPADDR=192.168.0.133
NETMASK=255.0.0.0
GATEWAY=192.168.0.1
ONBOOT=yes
DNS1=192.168.0.1

重启网络
service network restart
-- ----------------------------------------------------------------------
安装 php-mcrypt

rpm -ivh http://mirrors.sohu.com/fedora-epel/6/x86_64/epel-release-6-8.noarch.rpm
yum repolist //查看是否已经有了 EPEL(Extra Packages for Enterprise Linux) 扩展包。如果有epel说明已经安装成功。
yum install php-mcrypt -y
service httpd restart
-- ----------------------------------------------------------------------
定时任务 crontab
cat /var/spool/cron/root
-- ----------------------------------------------------------------------
##### 设置mysql #####
mysql_secure_installation
service mysqld stop
service mysqld start
##### ##### ##########

# service mysqld stop
# mysqld_safe --user=mysql --skip-grant-tables --skip-networking &
# mysql -u root
mysql> use mysql;
mysql> grant all privileges on *.* to root@'%' identified by "111111";
-- mysql> update user set password=password("111111") where user='root';
mysql> flush privileges;
mysql> quit
# service mysqld restart
-- ----------------------------------------------------------------------
前提是SELinux 类型必须是targeted的:
cat /etc/selinux/config|grep SELINUXTYPE;
也可以直接把selinux禁用掉;
直接修改/etc/selinux/config找到SELINUX=enforcing 修改为SELINUX=disable,然后reboot即可。
一次性的执行命令setenforce 0,这样不用重启,也可以生效。
建议不要禁用SELinux,开启相关端口即可
-- ----------------------------------------------------------------------

mkdir /usr/zend
tar xvfz ZendGuardLoader-php-5.3-linux-glibc23-x86_64.tar.gz
cp ZendGuardLoader-php-5.3-linux-glibc23-x86_64 /usr/zend
cp /etc/php.ini /etc/php.ini.bak
vi /etc/php.ini

在最后位置添加以下内容
[Zend Guard]
zend_extension=/usr/zend/ZendGuardLoader.so
zend_loader.enable=1
zend_loader.disable_licensing=0
zend_loader.obfuscation_level_support=3
zend_loader.license_path=

-- ----------------------------------------------------------------------
service httpd restart

php log
php_errors.log
/root/php_errors.log

apache log
/var/log/httpd

-- ----------------------------------------------------------------------
groupadd apache //添加用户 apache
useradd --shell /sbin/nologin -g apache apache //添加用户组 apache
-- ----------------------------------------------------------------------
cd /data/www/
chown -R apache:apache .
-- ----------------------------------------------------------------------

标签:httpd,x86,IP,ZendGuardLoader,etc,64,mysql,php
来源: https://www.cnblogs.com/youjiao/p/12907508.html

本站声明: 1. iCode9 技术分享网(下文简称本站)提供的所有内容,仅供技术学习、探讨和分享;
2. 关于本站的所有留言、评论、转载及引用,纯属内容发起人的个人观点,与本站观点和立场无关;
3. 关于本站的所有言论和文字,纯属内容发起人的个人观点,与本站观点和立场无关;
4. 本站文章均是网友提供,不完全保证技术分享内容的完整性、准确性、时效性、风险性和版权归属;如您发现该文章侵犯了您的权益,可联系我们第一时间进行删除;
5. 本站为非盈利性的个人网站,所有内容不会用来进行牟利,也不会利用任何形式的广告来间接获益,纯粹是为了广大技术爱好者提供技术内容和技术思想的分享性交流网站。

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有