ubuntu php mysql5.6_Ubuntu16.04搭建php5.6Web服务器环境

Ubuntu 16.04默认安装php7.0环境,但是php7目前对某些旧系统的兼容性并不是很好,如果自行安装php5需要清除php7的已安装包,否则会报错。

移除默认及已安装的PHP包

sudo dpkg -l | grep php| awk '{print $2}' |tr "\n" " "

sudo apt-get install aptitude

sudo aptitude purge `dpkg -l | grep php| awk '{print $2}' |tr "\n" " "`

添加 PPA

sudo add-apt-repository ppa:ondrej/php

安装php5.6

sudo apt-get update

sudo apt-get install php5.6

安装扩展

sudo apt-get install php5.6-gd

sudo apt-get install php5.6-mysql

安装Apache2

sudo apt install apache2

sudo apt-get install libapache2-mod-php5.6

安装MySQL

sudo apt install mysql-server php5.6-mysql root root0x0

sudo apt-get install mysql-client

mysql_secure_installation

安装 phpmyadmin

sudo apt-get install phpmyadmin

sudo apt-get install php5.6-mbstring

sudo apt-get install php5.6-gettext

sudo ln -s /usr/share/phpmyadmin /var/www/html/phpmyadmin

配置phpmyadmin

nano /etc/php/5.6/apache2/php.ini

display_errors = On(显示错误日志,出现两次,都要改,不然无效)

extension=php_mbstring.dll (开启mbstring)

sudo dpkg-reconfigure phpmyadmin (重新配置phpmyadmin)

增加网站

sudo ln -s /etc/apache2/sites-available/files.conf /etc/apache2/sites-enabled/files.conf

sudo chown -R www-data /var/www/tianya

sudo /etc/init.d/apache2 restart

添加FTP

sudo apt install vsftpd

useradd -d /var/www/tianya -s /sbin/nologin myftp

passwd myftp

chmod 777 -R /var/www/tianya

usermod -s /sbin/nologin myftp

vim /etc/vsftpd.conf

vim /etc/vsftpd.chroot_list

service vsftpd restart

service vsftpd status

# Example config file /etc/vsftpd.conf

#

# The default compiled in settings are fairly paranoid. This sample file

# loosens things up a bit, to make the ftp daemon more usable.

# Please see vsftpd.conf.5 for all compiled in defaults.

#

# READ THIS: This example file is NOT an exhaustive list of vsftpd options.

# Please read the vsftpd.conf.5 manual page to get a full idea of vsftpd's

# capabilities.

#

#

# Run standalone? vsftpd can run either from an inetd or as a standalone

# daemon started from an initscript.

#userlist_enable=YES

#userlist_deny=NO

#userlist_file=/etc/vsftpd.user_list

listen=YES

#

# Run standalone with IPv6?

# Like the listen parameter, except vsftpd will listen on an IPv6 socket

# instead of an IPv4 one. This parameter and the listen parameter are mutually

# exclusive.

#listen_ipv6=YES

#

# Allow anonymous FTP? (Disabled by default)

anonymous_enable=NO

#

# Uncomment this to allow local users to log in.

local_enable=YES

#

# Uncomment this to enable any form of FTP write command.

write_enable=YES

#

# Default umask for local users is 077. You may wish to change this to 022,

# if your users expect that (022 is used by most other ftpd's)

local_umask=022

#

# Uncomment this to allow the anonymous FTP user to upload files. This only

# has an effect if the above global write enable is activated. Also, you will

# obviously need to create a directory writable by the FTP user.

#anon_upload_enable=YES

#

# Uncomment this if you want the anonymous FTP user to be able to create

# new directories.

#anon_mkdir_write_enable=YES

#

# Activate directory messages - messages given to remote users when they

# go into a certain directory.

dirmessage_enable=YES

#

# If enabled, vsftpd will display directory listings with the time

# in your local time zone. The default is to display GMT. The

# times returned by the MDTM FTP command are also affected by this

# option.

use_localtime=YES

#

# Activate logging of uploads/downloads.

xferlog_enable=YES

#

# Make sure PORT transfer connections originate from port 20 (ftp-data).

connect_from_port_20=YES

#

# If you want, you can arrange for uploaded anonymous files to be owned by

# a different user. Note! Using "root" for uploaded files is not

# recommended!

#chown_uploads=YES

#chown_username=whoever

#

# You may override where the log file goes if you like. The default is shown

# below.

xferlog_file=/var/log/vsftpd.log

#

# If you want, you can have your log file in standard ftpd xferlog format.

# Note that the default log file location is /var/log/xferlog in this case.

xferlog_std_format=YES

#

# You may change the default value for timing out an idle session.

#idle_session_timeout=600

#

# You may change the default value for timing out a data connection.

#data_connection_timeout=120

#

# It is recommended that you define on your system a unique user which the

# ftp server can use as a totally isolated and unprivileged user.

#nopriv_user=ftpsecure

#

# Enable this and the server will recognise asynchronous ABOR requests. Not

# recommended for security (the code is non-trivial). Not enabling it,

# however, may confuse older FTP clients.

#async_abor_enable=YES

#

# By default the server will pretend to allow ASCII mode but in fact ignore

# the request. Turn on the below options to have the server actually do ASCII

# mangling on files when in ASCII mode.

# Beware that on some FTP servers, ASCII support allows a denial of service

# attack (DoS) via the command "SIZE /big/file" in ASCII mode. vsftpd

# predicted this attack and has always been safe, reporting the size of the

# raw file.

# ASCII mangling is a horrible feature of the protocol.

#ascii_upload_enable=YES

#ascii_download_enable=YES

#

# You may fully customise the login banner string:

ftpd_banner=Welcome to blah FTP service.

#

# You may specify a file of disallowed anonymous e-mail addresses. Apparently

# useful for combatting certain DoS attacks.

#deny_email_enable=YES

# (default follows)

#banned_email_file=/etc/vsftpd.banned_emails

#

# You may restrict local users to their home directories. See the FAQ for

# the possible risks in this before using chroot_local_user or

# chroot_list_enable below.

#chroot_local_user=YES

#

# You may specify an explicit list of local users to chroot() to their home

# directory. If chroot_local_user is YES, then this list becomes a list of

# users to NOT chroot().

# (Warning! chroot'ing can be very dangerous. If using chroot, make sure that

# the user does not have write access to the top level directory within the

# chroot)

chroot_local_user=YES

chroot_list_enable=YES

# (default follows)

chroot_list_file=/etc/vsftpd.chroot_list

#

# You may activate the "-R" option to the builtin ls. This is disabled by

# default to avoid remote users being able to cause excessive I/O on large

# sites. However, some broken FTP clients such as "ncftp" and "mirror" assume

# the presence of the "-R" option, so there is a strong case for enabling it.

#ls_recurse_enable=YES

#

# Customization

#

# Some of vsftpd's settings don't fit the filesystem layout by

# default.

#

# This option should be the name of a directory which is empty. Also, the

# directory should not be writable by the ftp user. This directory is used

# as a secure chroot() jail at times vsftpd does not require filesystem

# access.

secure_chroot_dir=/var/run/vsftpd/empty

#

# This string is the name of the PAM service vsftpd will use.

pam_service_name=vsftpd

#

# This option specifies the location of the RSA certificate to use for SSL

# encrypted connections.

rsa_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem

# This option specifies the location of the RSA key to use for SSL

# encrypted connections.

rsa_private_key_file=/etc/ssl/private/ssl-cert-snakeoil.key

总结

以上就是这篇文章的全部内容了,希望本文的内容对大家的学习或者工作具有一定的参考学习价值,谢谢大家对脚本之家的支持。如果你想了解更多相关内容请查看下面相关链接

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/501911.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

浏览器svg插件_Archer-svgs: 异步加载svg方案

Github地址: ShanaMaid/archer-svgs哇哦!无限的svgs!你可以使用archer-svgs去异步加载svg并将它缓存在localStorage里,当你再次使用已经加载过的svg时将不需要再发起http请求。将svgs从你的js-bunlde里移除,并且永远减小js-bunlde的体积。&am…

php打开网页执行即执行bat程序_CVE202011107:XAMPP任意命令执行漏洞复现

0x00简介XAMPP是一个把Apache网页服务器与PHP、Perl及MariaDB集合在一起的安裝包,允许用戶可以在自己的电脑上轻易的建立网页服务器。该软件与phpstudy类似。2020年4月1日ApacheFriends官方发布了XAMPP新版本,该更新解决了Windows Platforms CVE-2020-11…

阿里云rocketmq_云原生时代消息中间件的演进路线

作者 | 周礼(不铭) 阿里巴巴集团消息中间件架构师导读:本文整理自作者于 2020 年云原生微服务大会上的分享《云原生时代的消息中间件演进》,主要探讨了传统的消息中间件如何持续进化为云原生的消息服务。关注阿里巴巴云原生公众号…

mongodb mysql配置_Nosql_MongoDB数据库配置以及基本指令

数据库(database)-数据库的服务器-服务器用来保存数据-mongod用来启动服务器-数据库的客户端-客户端用来操作服务器,对数据进行增删改查的操作-mongo用来启动客户端(不能关闭启动的服务器,否则新开的客户端无法连接)扩展:将mongodb设置为系统…

python的pygame库使用方法_python基础教程使用Python第三方库pygame写个贪吃蛇小游戏...

今天看到几个关于pygame模块的博客和视频,感觉非常有趣,这里照猫画虎写了一个贪吃蛇小游戏,目前还有待完善,但是基本游戏功能已经实现,下面是代码:# 导入模块import pygameimport random# 初始化pygame.ini…

mysql爱吃鱼油_鱼油or磷虾油,多油饮食的国人心血管健康如何拯救?

作为美食大国,高油重口的饮食生活习惯直接导致我国心血管病患病率处于逐年上升的阶段,据统计我国现有心血管病患者已达3.3亿人,占总人口的40%以上。许多年轻人心血管健康已经呈现过度损害状况,心血管疾病也不再是中老年专利。因此…

python如何实现选项功能_python几种常用功能如何实现 python几种常用功能实现代码实例...

本篇文章小编给大家分享一下python几种常用功能实现代码实例,小编觉得挺不错的,现在分享给大家供大家参考,有需要的小伙伴们可以来看看。1、python 程序退出的几种方式import syssys.exit()sys.exit(0)sys.exit(1)或者os._exit()该方法中包含…

小程序promise封装post请求_Promise封装微信小程序的Request请求

回调地狱一向是影响开发和维护的症结所在,无数个success()的嵌套再嵌套,导致代码层级颇深,盘一次逻辑都要费劲千辛万苦,ES6语法中的Promise,便是专为解决JS中异步请求回调的信任问题而存在的,结合小程序目前…

kafka学习_Kafka 学习笔记01

Kafka概念和基本架构概述以下内容来自拉勾课程学习拉勾教育 - 拉勾旗下教育平台一、Kafka介绍Kafka是最初由 Linkedin 公司开发,是一个 分布式、分区的、多副本的、多生产者、多订阅者,基于zookeeper协调的分布式日志系统(也可以当做MQ系统&a…

mysql 删除另一个表中的_mysql – 在一个查询SQL中删除两个表中的记录

我有两张桌子EMPGROUP_TBLSEQID | MASTERID | BUSINESS_UNIT | DIVISION | SUB_DIVISION | CLASSIFICATION | SUB_CLASSIFICATION和EMP_MASTERTBLMASTERID | EMPNO | LASTNAME | FIRSTNAME | JOBTITLE | LOCATION |在我的ASP.NET JOBTITLE表中,BUSINESS_UNIT,DIVISION,SUB_DIVI…

python小车行驶路线图_基于python的小车走黑线

【实例简介】一个简单的基于python的小车走黑线项目,结合了OpenCV【实例截图】【核心代码】工科创II-B└── 工科创II-B├── guaidian.jpg├── 草稿│ ├── TT.PY│ ├── huatu.py│ ├── img.png│ └── ss.py├── 编译.py├── 最终版│ …

python tcl smb_python操作samba

最近在部署完xxl-job后,陆续将一些日常性执行的python脚本迁移到上面去;其中部分脚本涉及到对samaba的操作,先后尝试了pysmb、fs.smbfs、pysmbclientpysmb安装:sudo pip2 install pysmb使用from smb.SMBConnection import *class …

php 随机在文章中添加锚文本_锚文本对网站SEO优化有什么帮助?

对于优化人员来说,网站在做优化时都会在网站关键词或长尾词上添加锚文本,锚文本又称锚文本链接,是链接的一种形式。那么描文本的添加对网站优化都有什么好处呢?下面一起来了解一下。一、锚文本为网站传递权重在更新网站内容时&…

python 决策树 字符型_Python判断字符串是否xx开始或结尾的示例

判断是否xx开始使用startswith 示例代码:String "12345 上山打老虎"if str(String).startswith(1): #判断String是否以“虎”结尾print("有老虎")else:print("没老虎")执行结果:有老虎判断是否xx结尾使用endswith示例代码…

malloc 结构体_二进制安全之堆溢出(系列)——堆基础 amp; 结构(二)

哈喽啊这里是二进制安全之堆溢出(系列)第二期“堆基础 & 结构”第二节!!话不多说,直接上干货!微观结构函数执行流程void *malloc (size_t bytes) void *__libc_malloc (size_t bytes) //对于_int_mallo…

drbd实现mysql地热备_Mysql+DRBD+Heartbeat 实现mysql高可用的双机热备(mysql+heartbeat篇)...

*************************************部署MYSQL*******************************************yum -y install gcc gcc-c gcc-g77 autoconf automake zlib* fiex* libxml* ncurses-devel libmcrypt* libtool-ltdl-devel* make cmake bison*useradd mysql -d /usr/local/mysql…

深入理解计算机系统第四版_深入理解计算机系统之存储器层次结构

我的计算机模型是这样的:CPU执行指令,内存犹如一个巨大的字节数组,存储着指令和数据,硬盘保存着各种程序与程序用到的数据。I/O完成输入输出的功能。在本文中我们抛开I/O,谈一谈关于CPU,内存,硬…

mysql8支持myISAM_mysql8 参考手册--优化MyISAM表

MyISAM存储引擎在以读为主的数据或低并发操作中表现最好,因为表锁限制了同时执行更新的能力。在MySQL中,InnoDB是默认的存储引擎,而不是MyISAM。优化MyISAM查询一些加快MyISAM表查询的一般技巧 :为了帮助MySQL更好地优化查询&…

python的模块提供了许多文件处理方法_详解使用Python处理文件目录的相关方法

所有文件都包含在各个不同的目录下,不过Python也能轻松处理。os模块有许多方法能帮你创建,删除和更改目录。mkdir()方法可以使用os模块的mkdir()方法在当前目录下创建新的目录们。你需要提供一个包含了要创建的目录名称的参数。语法:os.mkdir…

mysql替换json的key_mysql中json_replace函数的使用?通过json_replace对json对象的值进行替换...

需求描述:在看mysql中关于json的内容,通过json_replace函数可以实现对json值的替换,在此记录下.操作过程:1.查看带有json数据类型的表mysql> select * from tab_json;-------------------------------------------------------------------------------------------| id | d…