标签: Debian

  • Docker 容器中为PHP-FPM 环境安装Memcached扩展 图文教程

    Docker 容器中为PHP-FPM 环境安装Memcached扩展 图文教程

    前面我们写了关于Docker的一些内容,现在我们需要在容器中开启php对Memcached的扩展。网上找了一些资料,下面我们直接贴出命令行。

    进入容器

    docker exec -it jphp-fpm /bin/bash

    jphp-fpm 是我们创建容器时给的容器名。

    注意:我们这里使用的是 bitnami/php-fpm 的套件。

    安装预编译环境

    apt-get update -y && apt-get install -y pkg-config libmemcached-dev autoconf gcc make zlib1g zlib1g-dev vim

    安装php-memcached扩展

    pecl channel-update pecl.php.net && pecl install memcached

    修改php的配置文件php.ini

    通过phpinfo里Loaded Configuration File,我们看到php.ini的位置:/opt/bitnami/php/lib/php.ini

    echo 'extension=memcached.so' >> /opt/bitnami/php/lib/php.ini

    退出容器 ,HOST终端重启php-fpm

    docker restart jphp-fpm
  • Make没有安装,错误sh: make: not found

    Make没有安装,错误sh: make: not found

    今天在Docker容器中安装php-memcached扩展,报如下错误:
    sh: make: not found

    make 没安装,Linux(Debian、Ubuntu)终端中执行以下命令即可:

    apt-get update
    apt-get install make

    Centos、Redhat下执行:

    yum update
    yum install make

  • Debian9系统如何修改SSH端口 图文教程

    Debian9系统如何修改SSH端口 图文教程

    前篇我们介绍了 Windows 10启用Linux子系统(WSL) 图文教程,下面我们具体介绍一下在安装完了Debian系统以后如何修改SSH服务的端口,以及如何设置防火墙修改端口。

    比如在拿到debian系统之后简单的配置服务器的安全肯定要禁止默认的22端口,有些服务商默认就给我们随机的SSH端口,不过大部分还是用的22端口,这里考虑到安全问题,我们还是修改成自定义的端口,以及防火墙配置。这里我们正好刚安装好Win10的Linux子系统,所以这里可以给大家介绍一下服务器配置修改Debian端口。

    修改SSH配置文件/etc/ssh/sshd_config

    vi /etc/ssh/sshd_config

    这里我们可以看到默认22端口,去掉前面的#,且在下面添加一行 设置 一个新的端口,这里姑且是19521,代表是今天的日期嘛。然后保存之后退出。

    重启SSH服务

    /etc/init.d/ssh restart

    如果我们在Linux中启用了防火墙则需要进一步配置防火墙的规则[Vultr]Linux系统中iptables防火墙 常用规则整理。

    我们不仅仅可以修改SSH端口,而且还可以使用SSH密匙免密码登录,让Linux系统更安全 SecureCRT通过ssh密钥登录 Linux服务器 图文教程。

  • Debian9 Stretch如何更换apt源

    Debian9 Stretch如何更换apt源

    前篇我们介绍了 Windows 10启用Linux子系统(WSL) 图文教程, 但是这里的apt源是官方的源,在国内更新比较慢。所以我们这里记录一下如何更换debian9的apt源。

    编辑apt源文件
    /etc/apt/sources.list

    阿里云apt源

    deb http://mirrors.aliyun.com/debian stretch main contrib non-free
    deb-src http://mirrors.aliyun.com/debian stretch main contrib non-free
    deb http://mirrors.aliyun.com/debian stretch-updates main contrib non-free
    deb-src http://mirrors.aliyun.com/debian stretch-updates main contrib non-free
    deb http://mirrors.aliyun.com/debian-security stretch/updates main contrib non-free
    deb-src http://mirrors.aliyun.com/debian-security stretch/updates main contrib non-free

    163源

    deb http://mirrors.163.com/debian/ stretch main non-free contrib 
    deb http://mirrors.163.com/debian/ stretch-updates main non-free contrib 
    deb http://mirrors.163.com/debian/ stretch-backports main non-free contrib deb-src http://mirrors.163.com/debian/ stretch main non-free contrib 
    deb-src http://mirrors.163.com/debian/ stretch-updates main non-free contrib deb-src http://mirrors.163.com/debian/ stretch-backports main non-free contrib deb http://mirrors.163.com/debian-security/ stretch/updates main non-free contrib 
    deb-src http://mirrors.163.com/debian-security/ stretch/updates main non-free contrib

    清华源

    deb https://mirrors.tuna.tsinghua.edu.cn/debian/ stretch main non-free contrib deb https://mirrors.tuna.tsinghua.edu.cn/debian/ stretch-updates main non-free contrib 
    deb https://mirrors.tuna.tsinghua.edu.cn/debian/ stretch-backports main non-free contrib 
    deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ stretch main non-free contrib 
    deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ stretch-updates main non-free contrib 
    deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ stretch-backports main non-free contrib 
    deb https://mirrors.tuna.tsinghua.edu.cn/debian-security/ stretch/updates main non-free contrib 
    deb-src https://mirrors.tuna.tsinghua.edu.cn/debian-security/ stretch/updates main non-free contrib

    你也可以把”Stretch”换成”jessie”,”wheezy”。分别对应Debian9,Debian8,Debian7版本。

    如何查询自己的Linux版本参考如下:

    cat /etc/issue

    更新apt源

    apt-get update

    通过终端窗口的信息就可以看出来,此时请求的就是阿里云的镜像。

  • 老季博客系统Debian9 Stretch及环境php7.3升级完成

    老季博客系统Debian9 Stretch及环境php7.3升级完成

    老季博客始于2015年,当时是用的是Debian7.5的版本+php5.6+mysql5.5的环境。由于WordPress对php的版本越来越高【WordPress安装环境需要PHP与MySQL版本要求】,虽然我们的版本还能使用,但是php官方已经放弃对php5.6的版本支持。而且debian7.5已经没有合适的apt源【Debian7 apt-get wheezy sources.list】。所以我们这里不得不升级。

    重点是php7的运行速度是php5的几倍,这里不做详细解释。网上都有测试说明。

    老季博客终于用上了php7.3了。后面我们会将整个迁移新安装系统以及如何配置的过程写出来。【OneinStack 安装LANMP环境图文教程】

    这里聊一下百度智能云,百度智能云的推介返点券【百度智能云BCE满55可减50】,注意这里的消费只能用在百度智能云BCE上,如果你这里买ip什么的是不行的,只能是bce的消费。

    现在发现百度智能云比阿里云的套路还要深。

  • 在DEBIAN 9 或 UBUNTU 16.10 系统中配置LAMP环境

    在DEBIAN 9 或 UBUNTU 16.10 系统中配置LAMP环境

    前面我们的大部分都是基于宝塔BT PANEL面板适配安装的WEB环境。下面我们记录一下Debian9、Ubuntu16.10下的LAMP的安装方法。

    Installation安装步骤

    Install Apache, MariaDB, PHP

    在root环境中运行如下命令Run the following command with sudo or as root:

    apt-get install apache2 mariadb-server php-mysql

    为MariaDB下的root用户设置密码Add a password to the user ROOT of MariaDB

    跟mysql安装不同,在设置导向时可以设置root密码。这里需要手动运行代如下代码。It seems, unlike mysql, MariaDB is not asking to setup a root password when you install it. This means it is a step faster to run development apps, but you will need to set it up manually. Simply run:

    mysqladmin -u root password 'enter password here'

    and restart the service然后重启服务

    service mysql restart

    Install 安装 PHPMyAdmin

    You probably wants to install PHPMyAdmin to simplify the management of your databases (Can be easily done with the web interface). The installation is simple, still in root or with sudo run:下面我们使用apt来安装一下phpmyadmin,在终端中运行如下命令

    apt-get install phpmyadmin

    however, MySQL 5.7 (and thus MariaDB) changed their model for security. Now to connect to MySQL root, you will need sudo or to be logged in as root on your machine. This also means that phpMyAdmin will not be able to use root as a user.

    You will need to create a dedicated user to do so. Here is how:下面手动创建一个用户并且给数据库授权

    mysql -u root
    CREATE USER 'newuser'@'localhost' IDENTIFIED BY 'password';
    GRANT ALL PRIVILEGES ON *.* TO 'newuser'@'localhost' WITH GRANT OPTION;
    FLUSH PRIVILEGES;
    exit

    Replace newuser with the user you want and password with the password you want.

    The restart the service.重启服务

    service mysql restart

    Now you should have access to Phpmyadmin at and use the newly created user/password combo to use PhpMyAdmin.下面可以在浏览器中输入如下地址运行phpmyadmin

    http://yourserver/phpmyadmin

  • Windows 10启用Linux子系统(WSL) 图文教程

    Windows 10启用Linux子系统(WSL) 图文教程

    Windows Subsystem for Linux(简称WSL)是一个为在Windows 10上能够原生运行Linux二进制可执行文件(ELF格式)的兼容层。它是由微软与Canonical公司合作开发,目标是使纯正的Ubuntu 14.04 “Trusty Tahr”映像能下载和解压到用户的本地计算机,并且映像内的工具和实用工具能在此子系统上原生运行。

    启用Linux子系统

    在“程序和功能” – 启用或关闭Windows功能 – 勾选适用于Linux的Windows子系统,然后点击确定等待Windows自动安装。

    安装完毕后需要重启一次才会生效,重启后打开Windows应用商店,搜索“Debian”或者“Ubuntu”,然后进行安装。

    使用Linux子系统

    这里老季安装的是Debian,首次启动WSL的时候会要求设置一个账号、密码,根据提示完成设置即可。

    注意上面设置的用户是没有root权限的,我们可以通过sudo su -来切换root用户,或者在某些需要root权限运行的条件下加上sudo命令即可。

    总结

    Windows 10子系统(WSL)可以原生运行Linux命令,但遗憾的是窗口不支持多标签运行,不过好在很多第三方软件已经支持设置WSL作为终端,比如Putty可以将终端设置为WSL,这样就可以在MobaXterm 环境下多标签使用WSL了。


  • [Vultr]创建新的VPS服务器 图文教程

    [Vultr]创建新的VPS服务器 图文教程

    Vultr创建新的VPS

    前面我们介绍了Vultr如何注册账号以及购买的教程,下面我们介绍一下如何创建新的VPS。点击右上角“+”号,如下图所示:

    3206

    账单信息确认完成,我们就可以点击右侧的 Deploy New Server  建立VPS了。

    硬盘默认

    服务器选择日本 东京

    操作系统默认

    服务器配置:默认即可。

    其他信息默认即可。

    点击 place order ,生成一个新VPS。

    3207
    3208
    3209

    进入 Servers ,稍等片刻服务器信息就生成了。

    3212

    点击 Cloud Instance 进行管理。

    3211

    Vultr 的这个控制面板还是比较清新的,VPS的所有功能都在一个页面集中,服务器停止,重新启动,重装系统,删除服务器等指示清晰,非常容易管理。

    3210

    按照上面的配置信息我们登录putty,注意vultr 端口号是22. 初次登录密码就是Initial Password 里面的信息,登录后就是我们常规的操作了。

  • Vultr Debian 8 x64环境下一键安装Windows7系统

    Vultr Debian 8 x64环境下一键安装Windows7系统

    在国外,因为版权的关系,不少VPS服务商并不提供Windows系统的支持。而提供Windows系统的价格也比Linux VPS的价格高了不少。所以,不少玩家也在尝试基于Linux安装Windows系统。

    在安装包中,萌咖 制作的一键包安装速度快,也比较稳定,非常推荐。安装环境最好是KVM,Debian 8 x64以上,老季测试使用的Vultr家5美元/月的配置。

    安装过程比较简单,执行如下命令即可:

    wget –no-check-certificate -qO DebianNET.sh ‘https://moeclub.org/attachment/LinuxShell/DebianNET.sh’ && bash DebianNET.sh -dd ‘https://moeclub.org/get-win7embx86-auto’

    接下来的过程我们就完全无需操心,等待十分钟即可安装完成。

    安装完成之后,我们通过Windows系统的远程功能直接登录就可以了。

    默认的远程登录账号密码分别为:Administrator/Vicer,我们登录之后记得修改密码。

    注意:不同服务商对版权的重视程度不同,也有不同的TOS,尝试之前请务必遵守规则。

  • Google Compute Engine GCE 免费300美金/一年使用期限 注册使用 图文教程

    Google Compute Engine GCE 免费300美金/一年使用期限 注册使用 图文教程

    Google Compute Engine GCE就是Google家卖VPS的,线路质量好,地区众多和微软的Azure一样,就是贵,一般人买不起。GCE的最低配置是5刀一个月,CPU、内存、硬盘都是独立按分钟算钱,面向中国的流量比较贵,大约为1GB 1元多,但是对比阿里云香港B其实优势不大,阿里云香港B流量是1元/GB,机器配置也高一些,CN2的网络质量还是非常不错的。

    新用户注册试用有300美元两个月有效期的试用费用,不要白不要,接触一下高质量的机器也算是物超所值了。

    1.注册

    【迷之高产50%】土豪机器测试--Google GCE使用体验

    GCE注册需要扶墙,网址:https://cloud.google.com 点击“Try it”

    填写一大堆表单就略过了,填写真实的资料即可。注册需要绑定信用卡,建议是实体卡好些,会扣除1美元的预付款,验证通过后会退还给你,但是不可使用全球付,已经被封了。

    注册成功后官方会有一个详细的教程指导你建立一个主机,一步步跟着来就行。

    2.创建计算引擎

    主页面,我们选择的是计算引擎。

    【迷之高产50%】土豪机器测试--Google GCE使用体验

    创建实例,可以自主选择配置和系统。我们选择台湾节点,Asia East

    【迷之高产50%】土豪机器测试--Google GCE使用体验

    拉到最下面,切换到网络,创建一个独立IP地址。

    【迷之高产50%】土豪机器测试--Google GCE使用体验

    GCE默认是只能通过一个类似VNC的东西登录的,虽然挺好用的就是麻烦,通过一下设置我们可以在本地使用Xshell等软件登录。

    【迷之高产50%】土豪机器测试--Google GCE使用体验

    3.SSH密钥

    进入“元数据”创建一个SSH密钥,同时使用Xshell5软件创建一个新的密钥,如图所示一路下一步,记得保存一下密钥文件,并保存好,记得复制密钥内容,回到网页如图填写,格式为:密钥内容 登录用户名

    【迷之高产50%】土豪机器测试--Google GCE使用体验

    【迷之高产50%】土豪机器测试--Google GCE使用体验

    【迷之高产50%】土豪机器测试--Google GCE使用体验

    【迷之高产50%】土豪机器测试--Google GCE使用体验

    登录用户名只能设置自己的一个,无法使用root,如果需要root权限只能使用:su 命令临时切换。

    全部完成后我们回到Xshell软件,输入IP、用户名登录,软件默认选择刚才创建的密钥登录,直接确定即可。

    【迷之高产50%】土豪机器测试--Google GCE使用体验

     

    4.测试

    路由测试

    【迷之高产50%】土豪机器测试--Google GCE使用体验

    Ping值测试,非常不错

    【迷之高产50%】土豪机器测试--Google GCE使用体验

    机器性能测试,IO都被限制了,包括阿里云和Azure

    【迷之高产50%】土豪机器测试--Google GCE使用体验

    5.总结

    土豪才能玩得起的机器,因为贵和谷歌的品质保证了机器的网络质量非常高,所以如果需要高质量的VPS而且不差钱可以考虑GCE。

  • FASTPANEL 重置密码图文教程How to reset password

    FASTPANEL 重置密码图文教程How to reset password

    面板中重置用户密码教程

    Go to “Settings” → “Users” menu and in fastuser row click “Change Password”

    In the opened modal window type in your old password, then new password twice and click “Save”

    终端中重设密码教程

    Also you can resetting passwords via command line.

    In order to do that:

    1.Connect to your server via SSH using your root-password:

    ssh root@your.server

    2.?Use a command chpasswd -u user_name -p new_password

    For example to change fastuser password to? 密码 the command should look like the following:

    mogwai chpasswd -u 用户名 -p 密码

    After you run the command you will get the following message:

    Password changed successfully, for login follow https://your_ip:8888/

    NB If password is changed via SSH it is not required to type in an old password

    在终端中,不需要填入旧的密码。
  • Linode全面升级 推出月付5刀的套餐 机房可选东京2

    Linode全面升级 推出月付5刀的套餐 机房可选东京2

    Linode以前给我们的印象是给高富帅用的。

    现在全面升级,近期推出5刀的套餐,更加平民化。而且还可以买到tokyo 2的节点。

    Linode 1024

    20GB Storage1 CPU Core1TB XFER$5/mo or (.0075/hr)

    Linode 1024 购买直达

     

    东京2 评测:

    ———————————————————————-
    CPU model? ?? ?? ?? ?: Intel(R) Xeon(R) CPU E5-2697 v4 @ 2.30GHz
    Number of cores? ?? ?: 1
    CPU frequency? ?? ???: 2299.994 MHz
    Total size of Disk? ?: 20.5 GB (1.2 GB Used)
    Total amount of Mem??: 989 MB (947 MB Used)
    Total amount of Swap : 255 MB (0 MB Used)
    System uptime? ?? ???: 0 days, 0 hour 3 min
    Load average? ?? ?? ?: 0.53, 0.26, 0.10
    OS? ?? ?? ?? ?? ?? ? : Debian GNU/Linux 8
    Arch? ?? ?? ?? ?? ???: x86_64 (64 Bit)
    Kernel? ?? ?? ?? ?? ?: 4.8.6-x86_64-linode78
    ———————————————————————-
    I/O speed(1st run)? ?: 632 MB/s
    I/O speed(2nd run)? ?: 716 MB/s
    I/O speed(3rd run)? ?: 714 MB/s
    Average I/O speed? ? : 687.3 MB/s
    ———————————————————————-
    Retrieving speedtest.net configuration…
    Retrieving speedtest.net server list…
    Selecting best server based on ping…
    Hosted by Pomflare (Tokyo) [8.86 km]: 1.861 ms
    Testing download speed……………………………………………………………………..
    Download: 3217.76 Mbit/s
    Testing upload speed……………………………………………………………………………………….
    Upload: 534.32 Mbit/s

WeChat
↑