分类 云计算 下的文章

为阿里云ECS(CentOS6)配置IPv6隧道地址

云友“eason_zhan”希望 能在CentOS 6.5系统里配置IPv6地址,所以写此帖。

环境:ECS“经典网络”类型(网友“ifaceparty”提醒:如果是“专有网络”,需要将HE配置隧道地址命令中的IPv4地址修改为ECS实例的内网地址),CentOS 6.5 64位系统。

注意:如是苹果APP上架申请因无法IPv6-only访问被拒,请重点检查APP代码,苹果公司的参考文档并没有要求APP服务需要有IPv6地址:https://developer.apple.com/library/content/documentation/NetworkingInternetWeb/Conceptual/NetworkingOverview/UnderstandingandPreparingfortheIPv6Transition/UnderstandingandPreparingfortheIPv6Transition.html

1.CentOS 6.5 64位系统,默认没有启用IPv6地址
bbs-aliyun-dongshan3-299254-1.png

2.编辑文件,/etc/modprobe.d/disable_ipv6.conf,将其中的三行都注释掉
vi /etc/modprobe.d/disable_ipv6.conf

# alias net-pf-10 off
# alias ipv6 off
# options ipv6 disable=1

bbs-aliyun-dongshan3-299254-2.png

3.编辑文件,/etc/sysconfig/network,将其中的 NETWORKING_IPV6=no 改为 NETWORKING_IPV6=yes,
vi /etc/sysconfig/network

NETWORKING_IPV6=yes

bbs-aliyun-dongshan3-299254-3.png

4.重启系统,以让更改生效。系统重启后,运行 ifconfig 命令,可以看到IPv6的地址
bbs-aliyun-dongshan3-299254-4.png

5.执行 HE 隧道地址配置例子中的 Linux-net-tools 命令,如本例是:

ifconfig sit0 up
ifconfig sit0 inet6 tunnel ::216.218.221.6
ifconfig sit1 up
ifconfig sit1 inet6 add 2001:470:18:401::2/64
route -A inet6 add ::/0 dev sit1

bbs-aliyun-dongshan3-299254-5.png

bbs-aliyun-dongshan3-299254-6.png

6.安装 nginx 后,启动 nginx ,可以看到在IPv6(:::80)里监听使用了
bbs-aliyun-dongshan3-299254-7.png

7.在其它IPv6的系统上,用 curl 测试 IPv6 域名和IP地址站点内容,正常。实践中,访问IPv6的网站内容可能较慢,这可能是因为提供隧道地址的网络与国内连接较慢

curl 'http://yun.anqun.org' -so - | grep -iPo '(?<=<title>)(.*)(?=</title>)'
curl [2001:470:18:401::2] -so - | grep -iPo '(?<=<title>)(.*)(?=</title>)'
curl -6 'http://ipv6.anqun.org' -so - | grep -iPo '(?<=<title>)(.*)(?=</title>)'

bbs-aliyun-dongshan3-299254-8.png

参考:http://linuxnextgen.blogspot.com/2011/08/disable-and-enable-ipv6-in-rhel.html

在CentOS 6 运行 redis-sentinel 程序

云友“ptao”提出 在ECS里无法成功运行 redis-sentinel 程序,提示端口无法绑定使用。

环境:CentOS 6 64位,redis-3.2.3

1.执行更新
yum update
bbs-aliyun-dongshan3-299048-1.png

2.下载redis安装文件
wget http://download.redis.io/releases/redis-3.2.3.tar.gz

3.解压缩安装包
tar -xzvf redis-3.2.3.tar.gz

4.移动文件
mv redis-3.2.3 /usr/local/redis

5.转到工作目录
cd /usr/local/redis

6.编译
make

7.安装
make install
bbs-aliyun-dongshan3-299048-2.png

8.创建新的配置文件,
mkdir -p /etc/redis
cp redis.conf /etc/redis

9.修改配置文件 /etc/redis/redis.conf,将 daemonize 值从 no 更改为 yes, 使之后台运行:
daemonize yes
bbs-aliyun-dongshan3-299048-3.png

10.运行,测试可正常运行
/usr/local/bin/redis-server /etc/redis/redis.conf
bbs-aliyun-dongshan3-299048-4.png

11.但运行出错,提示无法绑定使用相应的端口:
redis-sentinel /usr/local/redis/sentinel.conf

Creating Server TCP listening socket *:26379: unable to bind socket

12.修改配置文件 sentinel.conf 在 定义监听端口一行前添加监听IP参数,如 bind 0.0.0.0 ,表示仅监听IPv4。因为阿里云的ECS Linux系统暂时没有启用IPv6,所以 redis-sentinel 尝试在所有的(IPv4 + IPv6)的网络接口启动时,会报错

# port <sentinel-port>
# The port that this sentinel instance will run on
bind 0.0.0.0
port 26379

bbs-aliyun-dongshan3-299048-5.png

13.再次尝试启动 redis-sentinel ,正常
bbs-aliyun-dongshan3-299048-6.png

参考:

在弹性Web托管产品里安装 thinkcmf X2.2.0 程序

云友“evinweb”在帖子里 提到thinkcmf程序不能在弹性Web托管里正常使用。所以,此帖探讨一下。

环境:弹性Web托管,php5.5版本,未启用pathinfo功能,安装 thinkcmf x2.2.0。

关键词:目前 thinkcmf x.2.2.0 程序安装包里的 .htaccess 配置文件是适合 apache 2.2,但弹性Web托管产品的 apache 2.4,所以默认安装后有问题,需要稍微调整一下。

过程:

1.初始安装
bbs-aliyun-dongshan3-298729-1.png

2.环境检测
bbs-aliyun-dongshan3-298729-2.png

3.创建数据
bbs-aliyun-dongshan3-298729-3.png

4.安装成功
bbs-aliyun-dongshan3-298729-4.png

5.网站前台内容,图片不能显示,css等文件不能加载
bbs-aliyun-dongshan3-298729-5.png

6.网站后台访问,提示 500 Internal Server Error 错误
bbs-aliyun-dongshan3-298729-6.png

7.修改 admin/.htaccess 配置文件内容为:

<Files *.html>
Require all denied
</Files>

bbs-aliyun-dongshan3-298729-7.png

8.同样,修改 themes/.htaccess 配置文件内容
bbs-aliyun-dongshan3-298729-8.png

9.网站前台显示正常
bbs-aliyun-dongshan3-298729-9.png

10.网站前台登录页面
bbs-aliyun-dongshan3-298729-10.png

11.网站后台页面正常
bbs-aliyun-dongshan3-298729-11.png

参考:http://www.zzuyxg.top/article/126.html

升级FreeBSD 10.2-STABLE 到 11.0-RELEASE

网友 "magicesp " 想用 FreeBSD 11.0-RELEASE 的系统,但目前阿里云官方提供的是 10.2-STABLE 版本。本例测试,在 ecs.s1.small (1核心,2GB内存)上升级 FreeBSD 到 11.0-RELEASE 版本。

步骤:

1.运行 freebsd-version -k -u 默认阿里云提供的FreeBSD版本是:kernel: 10.2-STABLE, userland: 10.1-RELEASE
bbs-aliyun-dongshan3-297189-1.png

2.修改 /etc/resolv.conf 里边的 nameserver 值,如修改为 208.67.222.222,防止不能解析 freebsd 的相关更新服务器网址

3.运行 setenv UNAME_r "10.3-RELEASE" , 以获取更新文件

4.运行 freebsd-update fetch 获取文件
bbs-aliyun-dongshan3-297189-2.png

5.运行 freebsd-update upgrade -r 10.3-RELEASE ,升级到接近的 10.3-RELEASE 版本
bbs-aliyun-dongshan3-297189-3.png

6.运行 freebsd-update install 安装更新
bbs-aliyun-dongshan3-297189-4.png

bbs-aliyun-dongshan3-297189-5.png

7.然后运行官方文档提示的升级命令:

# : > /usr/bin/bspatch
# freebsd-update upgrade -r 11.0-RELEASE
# freebsd-update install
<reboot the system>
# freebsd-update install
<rebuild third-party software>
# freebsd-update install

8.完成后,可以看到版本更新到 11.0-RELEASE
bbs-aliyun-dongshan3-297189-6.png

bbs-aliyun-dongshan3-297189-7.png

bbs-aliyun-dongshan3-297189-8.png

bbs-aliyun-dongshan3-297189-9.png

bbs-aliyun-dongshan3-297189-10.png

bbs-aliyun-dongshan3-297189-11.png

参考:

在Debian 8 系统里安装Magento2在线商店程序

环境:ECS 2GB内存,Debian 8
目的:安装 Magento 2.1.1 带演示数据程序

步骤:

1.更新软件安装源:
apt-get update

2.安装apache2.4
aptitude install apache2 apache2-doc

3.安装MariaDB数据库及创建数据库magento
aptitude install mariadb-server
mysqladmin -uroot -p create magento
bbs-aliyun-dongshan3-295899-1.png

4.安装php模块及扩展
aptitude install php5-common libapache2-mod-php5 php5-cli php5-curl php5-mcrypt php5-gd php5-mcrypt php5-xsl php5-intl php5-mysql

5.修改php配置文件,/etc/php5/apache2/php.ini ,以适合 magento2 安装要求:

always_populate_raw_post_data = -1
max_execution_time = 120
memory_limit = 300M

bbs-aliyun-dongshan3-295899-2.png

6.开启 apache rewrite 模块:
a2enmod rewrite

7.新建一个站点配置文件 /etc/apache2/sites-enabled/yun.conf,内容如下(假如我将magento的安装文件放在 /var/www/html/mgt ):

<VirtualHost *:80>
        ServerName yun.anqun.org
        DocumentRoot /var/www/html/mgt
        <Directory "/var/www/html/mgt">
          AllowOverride All
        </Directory>
</VirtualHost>

8.重启 apache 服务,以让设置生效:
service apache2 restart

参考:

bbs-aliyun-dongshan3-295899-3.png
开始安装

bbs-aliyun-dongshan3-295899-4.png
检测安装环境

bbs-aliyun-dongshan3-295899-5.png
填写数据库连接信息

bbs-aliyun-dongshan3-295899-6.png
填写网站访问地址

bbs-aliyun-dongshan3-295899-7.png
配置商城语言、货币等

bbs-aliyun-dongshan3-295899-8.png
配置站点后台登录信息

bbs-aliyun-dongshan3-295899-9.png
开始安装

bbs-aliyun-dongshan3-295899-10.png
安装成功

bbs-aliyun-dongshan3-295899-11.png
站点前台(带演示数据)

bbs-aliyun-dongshan3-295899-12.png
站点后台