最新消息:20210816 当前crifan.com域名已被污染,为防止失联,请关注(页面右下角的)公众号

【已解决】腾讯云香港服务器CentOS中用OneinStack搭建Web环境

CentOS crifan 3238浏览 0评论

折腾:

【记录】crifan.com的WordPress网站从Linode搬家到腾讯云香港服务器

期间,去新购的腾讯云的香港服务器的CentOS中搭建Web环境,用于后续WordPress网站。

打算用之前就用过几次的,效果不错的OneInStack。

参考自己之前的:

【已解决】CentOS中安装web集成环境:OneinStack

【已解决】OneinStack中安装配置虚拟主机域名

【已解决】CentOS 7的OneinStack中安装最新版本WordPress

【记录】给腾讯云香港服务器CentOS中搭建WordPress官网主页

再去操作一遍

交互安装 – OneinStack

下载 – OneinStack

此处只记录大概过程:

<code>yum -y install wget screen
wget https://www.dropbox.com/s/iampc7prd9y7cqf/oneinstack-full.tar.gz
</code>

2M/s多的下载速度,还是不错的。

<code>[root@VM_0_11_centos ~]# pwd
/root
[root@VM_0_11_centos ~]# ll -lh
total 260M
-rw-r--r-- 1 root root 260M Dec 25 19:55 oneinstack-full.tar.gz
[root@VM_0_11_centos ~]# tar xzf oneinstack-full.tar.gz
[root@VM_0_11_centos ~]# ll -lh
total 260M
drwxr-xr-x 7 root root 4.0K Dec 25 18:41 oneinstack
-rw-r--r-- 1 root root 260M Dec 25 19:55 oneinstack-full.tar.gz
[root@VM_0_11_centos ~]# cd oneinstack/
[root@VM_0_11_centos oneinstack]# ll -lh
total 252K
-rwxr-xr-x 1 root root  25K Dec 25 18:41 addons.sh
-rwxr-xr-x 1 root root  19K Dec 25 18:41 backup_setup.sh
-rwxr-xr-x 1 root root 7.7K Dec 25 18:41 backup.sh
drwxr-xr-x 2 root root 4.0K Dec 25 18:41 config
drwxr-xr-x 2 root root 4.0K Dec 25 18:41 include
drwxr-xr-x 2 root root 4.0K Dec 25 18:41 init.d
-rwxr-xr-x 1 root root  43K Dec 25 18:41 install.sh
-rw-r--r-- 1 root root  12K Dec 25 18:41 LICENSE
-rw-r--r-- 1 root root 2.4K Dec 25 18:41 options.conf
-rwxr-xr-x 1 root root 7.6K Dec 25 18:41 pureftpd_vhost.sh
-rw-r--r-- 1 root root 5.4K Dec 25 18:41 README.md
-rwxr-xr-x 1 root root 4.9K Dec 25 18:41 reset_db_root_password.sh
drwxr-xr-x 2 root root 4.0K Dec 25 18:41 src
-rwxr-xr-x 1 root root  12K Dec 25 18:41 ss.sh
drwxr-xr-x 2 root root 4.0K Dec 25 18:41 tools
-rwxr-xr-x 1 root root  18K Dec 25 18:41 uninstall.sh
-rwxr-xr-x 1 root root 5.6K Dec 25 18:41 upgrade.sh
-rw-r--r-- 1 root root 1.8K Dec 25 18:41 versions.txt
-rwxr-xr-x 1 root root  47K Dec 25 18:41 vhost.sh

screen -S oneinstack
./install.sh

</code>

然后就是安装了:

<code>[root@VM_0_11_centos oneinstack]# ./install.sh

#######################################################################
#       OneinStack for CentOS/RedHat 6+ Debian 7+ and Ubuntu 12+      #
#       For more information please visit https://oneinstack.com      #
#######################################################################
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
Resolving Dependencies
--&gt; Running transaction check
---&gt; Package redhat-lsb-core.x86_64 0:4.1-27.el7.centos.1 will be installed
--&gt; Processing Dependency: redhat-lsb-submod-security(x86-64) = 4.1-27.el7.centos.1 for package: redhat-lsb-core-4.1-27.el7.centos.1.x86_64
--&gt; Processing Dependency: spax for package: redhat-lsb-core-4.1-27.el7.centos.1.x86_64
--&gt; Processing Dependency: /usr/bin/patch for package: redhat-lsb-core-4.1-27.el7.centos.1.x86_64
--&gt; Processing Dependency: /usr/bin/m4 for package: redhat-lsb-core-4.1-27.el7.centos.1.x86_64
--&gt; Processing Dependency: /usr/bin/lpr for package: redhat-lsb-core-4.1-27.el7.centos.1.x86_64
--&gt; Processing Dependency: /usr/bin/lp for package: redhat-lsb-core-4.1-27.el7.centos.1.x86_64
--&gt; Running transaction check
---&gt; Package cups-client.x86_64 1:1.6.3-35.el7 will be installed
--&gt; Processing Dependency: cups-libs(x86-64) = 1:1.6.3-35.el7 for package: 1:cups-client-1.6.3-35.el7.x86_64
--&gt; Processing Dependency: libcups.so.2()(64bit) for package: 1:cups-client-1.6.3-35.el7.x86_64
--&gt; Processing Dependency: libavahi-common.so.3()(64bit) for package: 1:cups-client-1.6.3-35.el7.x86_64
--&gt; Processing Dependency: libavahi-client.so.3()(64bit) for package: 1:cups-client-1.6.3-35.el7.x86_64
---&gt; Package m4.x86_64 0:1.4.16-10.el7 will be installed
---&gt; Package patch.x86_64 0:2.7.1-10.el7_5 will be installed
---&gt; Package redhat-lsb-submod-security.x86_64 0:4.1-27.el7.centos.1 will be installed
---&gt; Package spax.x86_64 0:1.5.2-13.el7 will be installed
--&gt; Running transaction check
---&gt; Package avahi-libs.x86_64 0:0.6.31-19.el7 will be installed
---&gt; Package cups-libs.x86_64 1:1.6.3-35.el7 will be installed
--&gt; Finished Dependency Resolution

Dependencies Resolved

=======================================================================================================================================================
Package                                         Arch                        Version                                     Repository               Size
=======================================================================================================================================================
Installing:
redhat-lsb-core                                 x86_64                      4.1-27.el7.centos.1                         os                       38 k
Installing for dependencies:
avahi-libs                                      x86_64                      0.6.31-19.el7                               os                       61 k
cups-client                                     x86_64                      1:1.6.3-35.el7                              os                      151 k
cups-libs                                       x86_64                      1:1.6.3-35.el7                              os                      357 k
m4                                              x86_64                      1.4.16-10.el7                               os                      256 k
patch                                           x86_64                      2.7.1-10.el7_5                              os                      110 k
redhat-lsb-submod-security                      x86_64                      4.1-27.el7.centos.1                         os                       15 k
spax                                            x86_64                      1.5.2-13.el7                                os                      260 k

Transaction Summary
=======================================================================================================================================================
Install  1 Package (+7 Dependent packages)

Total download size: 1.2 M
Installed size: 2.3 M
Downloading packages:
(1/8): avahi-libs-0.6.31-19.el7.x86_64.rpm                                                                                      |  61 kB  00:00:00     
(2/8): cups-client-1.6.3-35.el7.x86_64.rpm                                                                                      | 151 kB  00:00:00     
(3/8): cups-libs-1.6.3-35.el7.x86_64.rpm                                                                                        | 357 kB  00:00:00     
(4/8): m4-1.4.16-10.el7.x86_64.rpm                                                                                              | 256 kB  00:00:00     
(5/8): patch-2.7.1-10.el7_5.x86_64.rpm                                                                                          | 110 kB  00:00:00     
(6/8): redhat-lsb-core-4.1-27.el7.centos.1.x86_64.rpm                                                                           |  38 kB  00:00:00     
(7/8): redhat-lsb-submod-security-4.1-27.el7.centos.1.x86_64.rpm                                                                |  15 kB  00:00:00     
(8/8): spax-1.5.2-13.el7.x86_64.rpm                                                                                             | 260 kB  00:00:00     
-------------------------------------------------------------------------------------------------------------------------------------------------------
Total                                                                                                                  6.5 MB/s | 1.2 MB  00:00:00     
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : avahi-libs-0.6.31-19.el7.x86_64                                                                                                     1/8
  Installing : 1:cups-libs-1.6.3-35.el7.x86_64                                                                                                     2/8
  Installing : 1:cups-client-1.6.3-35.el7.x86_64                                                                                                   3/8
  Installing : m4-1.4.16-10.el7.x86_64                                                                                                             4/8
  Installing : patch-2.7.1-10.el7_5.x86_64                                                                                                         5/8
  Installing : spax-1.5.2-13.el7.x86_64                                                                                                            6/8
  Installing : redhat-lsb-submod-security-4.1-27.el7.centos.1.x86_64                                                                               7/8
  Installing : redhat-lsb-core-4.1-27.el7.centos.1.x86_64                                                                                          8/8
  Verifying  : 1:cups-libs-1.6.3-35.el7.x86_64                                                                                                     1/8
  Verifying  : avahi-libs-0.6.31-19.el7.x86_64                                                                                                     2/8
  Verifying  : redhat-lsb-submod-security-4.1-27.el7.centos.1.x86_64                                                                               3/8
  Verifying  : spax-1.5.2-13.el7.x86_64                                                                                                            4/8
  Verifying  : patch-2.7.1-10.el7_5.x86_64                                                                                                         5/8
  Verifying  : redhat-lsb-core-4.1-27.el7.centos.1.x86_64                                                                                          6/8
  Verifying  : m4-1.4.16-10.el7.x86_64                                                                                                             7/8
  Verifying  : 1:cups-client-1.6.3-35.el7.x86_64                                                                                                   8/8

Installed:
  redhat-lsb-core.x86_64 0:4.1-27.el7.centos.1                                                                                                         

Dependency Installed:
  avahi-libs.x86_64 0:0.6.31-19.el7 cups-client.x86_64 1:1.6.3-35.el7                       cups-libs.x86_64 1:1.6.3-35.el7 m4.x86_64 0:1.4.16-10.el7
  patch.x86_64 0:2.7.1-10.el7_5     redhat-lsb-submod-security.x86_64 0:4.1-27.el7.centos.1 spax.x86_64 0:1.5.2-13.el7     

Complete!

Please input SSH port(Default: 22):
</code>

关于iptables:此处是腾讯云,暂时不知道是否有什么安全组,以及是否开启

所以要去看看:

【整理】搞懂腾讯云CVM云服务器的安全组和确保常用端口开放允许访问

但是此处SSH的连接超时,输入没响应了。

只能强制断开,重新输入:

screen -R oneinstack

看看能否恢复安装进度

结果不行:

<code>[root@VM_0_11_centos ~]# screen -R oneinstack
There is a screen on:
        14640.oneinstack        (Attached)
[root@VM_0_11_centos ~]# n
bash: n: command not found
[root@VM_0_11_centos ~]#
</code>

所以,算了,重新去安装:

<code>[root@VM_0_11_centos ~]# cd oneinstack/
[root@VM_0_11_centos oneinstack]# ./install.sh
</code>

继续:

<code>#######################################################################
#       OneinStack for CentOS/RedHat 6+ Debian 7+ and Ubuntu 12+      #
#       For more information please visit https://oneinstack.com      #
#######################################################################

Please input SSH port(Default: 22): 22

Do you want to enable iptables? [y/n]: n

Do you want to install Web server? [y/n]: y

Please select Nginx server:
        1. Install Nginx
        2. Install Tengine
        3. Install OpenResty
        4. Do not install
Please input a number:(Default 1 press Enter) 1

Please select Apache server:
        1. Install Apache-2.4
        2. Install Apache-2.2
        3. Do not install
Please input a number:(Default 3 press Enter) 3

Please select tomcat server:
        1. Install Tomcat-9
        2. Install Tomcat-8
        3. Install Tomcat-7
        4. Install Tomcat-6
        5. Do not install
Please input a number:(Default 5 press Enter) 5

Do you want to install Database? [y/n]: y

Please select a version of the Database:
         1. Install MySQL-8.0
         2. Install MySQL-5.7
         3. Install MySQL-5.6
         4. Install MySQL-5.5
         5. Install MariaDB-10.3
         6. Install MariaDB-10.2
         7. Install MariaDB-10.1
         8. Install MariaDB-10.0
         9. Install MariaDB-5.5
        10. Install Percona-5.7
        11. Install Percona-5.6
        12. Install Percona-5.5
        13. Install AliSQL-5.6
        14. Install PostgreSQL
        15. Install MongoDB
Please input a number:(Default 2 press Enter) 2
Please input the root password of MySQL(default: GwMaVWUe): xxx

Please choose installation of the database:
        1. Install database from binary package.
        2. Install database from source package.
Please input a number:(Default 1 press Enter) 1

Do you want to install PHP? [y/n]: y

Please select a version of the PHP:
        1. Install php-5.3
        2. Install php-5.4
        3. Install php-5.5
        4. Install php-5.6
        5. Install php-7.0
        6. Install php-7.1
        7. Install php-7.2
        8. Install php-7.3
Please input a number:(Default 5 press Enter) 8

Do you want to install opcode cache of the PHP? [y/n]: y

Do you want to install ionCube? [y/n]: n

Do you want to install ImageMagick or GraphicsMagick? [y/n]: n

Do you want to install Pure-FTPd? [y/n]: n

Do you want to install phpMyAdmin? [y/n]: y

Do you want to install redis? [y/n]: y

Do you want to install memcached? [y/n]: y

Do you want to install HHVM? [y/n]: n
</code>

然后继续就是安装过程了:

<code>Package wget-1.14-18.el7.x86_64 already installed and latest version
Delta RPMs disabled because /usr/bin/applydeltarpm not installed.

...
/bin/sh /root/oneinstack/src/pecl-memcache-php7/libtool --mode=compile cc -I/usr/local/php/include/php -I. -I/root/oneinstack/src/pecl-memcache-php7 -DPHP_ATOM_INC -I/root/oneinstack/src/pecl-memcache-php7/include -I/root/oneinstack/src/pecl-memcache-php7/main -I/root/oneinstack/src/pecl-memcache-php7 -I/usr/local/php/include/php -I/usr/local/php/include/php/main -I/usr/local/php/include/php/TSRM -I/usr/local/php/include/php/Zend -I/usr/local/php/include/php/ext -I/usr/local/php/include/php/ext/date/lib  -DHAVE_CONFIG_H  -g -O2   -c /root/oneinstack/src/pecl-memcache-php7/memcache_standard_hash.c -o memcache_standard_hash.lo
make: *** [memcache.lo] Error 1
make: *** Waiting for unfinished jobs....
cc -I/usr/local/php/include/php -I. -I/root/oneinstack/src/pecl-memcache-php7 -DPHP_ATOM_INC -I/root/oneinstack/src/pecl-memcache-php7/include -I/root/oneinstack/src/pecl-memcache-php7/main -I/root/oneinstack/src/pecl-memcache-php7 -I/usr/local/php/include/php -I/usr/local/php/include/php/main -I/usr/local/php/include/php/TSRM -I/usr/local/php/include/php/Zend -I/usr/local/php/include/php/ext -I/usr/local/php/include/php/ext/date/lib -DHAVE_CONFIG_H -g -O2 -c /root/oneinstack/src/pecl-memcache-php7/memcache_standard_hash.c  -fPIC -DPIC -o .libs/memcache_standard_hash.o
PHP memcache module install failed, Please contact the author!
[tz_e.zip] found
[ocp.php] found
~/oneinstack ~/oneinstack
Starting MySQL..                                           [  OK  ]
####################Congratulations########################
Total OneinStack Install Time: 19 minutes

Nginx install dir:              /usr/local/nginx

Database install dir:           /usr/local/mysql
Database data dir:              /data/mysql
Database user:                  root
Database password:              1USA2@china

PHP install dir:                /usr/local/php
Opcache Control Panel URL:      http://172.19.0.11/ocp.php

phpMyAdmin dir:                 /data/wwwroot/default/phpMyAdmin
phpMyAdmin Control Panel URL:   http://172.19.0.11/phpMyAdmin

redis install dir:              /usr/local/redis

memcached install dir:          /usr/local/memcached

Index URL:                      http://172.19.0.11/

Please restart the server and see if the services start up fine.
Do you want to restart OS ? [y/n]:
</code>

重启后:

然后现在可以访问nginx主页了:

Welcome to use OneinStack

正常连接上后,去看看各个服务如何

常见问题 – OneinStack

去看看管理页面:

<code>[root@VM_0_11_centos ~]# service nginx status
Redirecting to /bin/systemctl status nginx.service
[0m nginx.service - nginx - high performance web server
   Loaded: loaded (/usr/lib/systemd/system/nginx.service; enabled; vendor preset: disabled)
   Active: active (running) since Tue 2018-12-25 21:20:53 CST; 14min ago
     Docs: http://nginx.org/en/docs/
  Process: 1271 ExecStartPost=/bin/sleep 0.1 (code=exited, status=0/SUCCESS)
  Process: 1245 ExecStart=/usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf (code=exited, status=0/SUCCESS)
  Process: 876 ExecStartPre=/usr/local/nginx/sbin/nginx -t -c /usr/local/nginx/conf/nginx.conf (code=exited, status=0/SUCCESS)
Main PID: 1267 (nginx)
   CGroup: /system.slice/nginx.service
           1267 nginx: master process /usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf
           1272 nginx: worker process
           1273 nginx: worker process

Dec 25 21:20:53 VM_0_11_centos systemd[1]: Starting nginx - high performance web server...
Dec 25 21:20:53 VM_0_11_centos nginx[876]: nginx: the configuration file /usr/local/nginx/conf/nginx.conf syntax is ok
Dec 25 21:20:53 VM_0_11_centos nginx[876]: nginx: configuration file /usr/local/nginx/conf/nginx.conf test is successful
Dec 25 21:20:53 VM_0_11_centos systemd[1]: Started nginx - high performance web server.
[root@VM_0_11_centos ~]# service mysqld status
MySQL running (2226)                                       [  OK  ]
[root@VM_0_11_centos ~]# service mongod status
Redirecting to /bin/systemctl status mongod.service
Unit mongod.service could not be found.
[root@VM_0_11_centos ~]# service php-fpm status
Redirecting to /bin/systemctl status php-fpm.service
[0m php-fpm.service - The PHP FastCGI Process Manager
   Loaded: loaded (/usr/lib/systemd/system/php-fpm.service; enabled; vendor preset: disabled)
   Active: active (running) since Tue 2018-12-25 21:20:53 CST; 14min ago
     Docs: http://php.net/docs.php
Main PID: 877 (php-fpm)
   CGroup: /system.slice/php-fpm.service
            877 php-fpm: master process (/usr/local/php/etc/php-fpm.conf)
           1613 php-fpm: pool www
。。。
           1645 php-fpm: pool www

Dec 25 21:20:53 VM_0_11_centos systemd[1]: Started The PHP FastCGI Process Manager.
Dec 25 21:20:53 VM_0_11_centos systemd[1]: Starting The PHP FastCGI Process Manager...
[root@VM_0_11_centos ~]# service supervisord status
Redirecting to /bin/systemctl status supervisord.service
Unit supervisord.service could not be found.
[root@VM_0_11_centos ~]# service redis-server status
Redirecting to /bin/systemctl status redis-server.service
[0m redis-server.service - Redis In-Memory Data Store
   Loaded: loaded (/usr/lib/systemd/system/redis-server.service; enabled; vendor preset: disabled)
   Active: active (running) since Tue 2018-12-25 21:20:53 CST; 15min ago
  Process: 889 ExecStart=/usr/local/redis/bin/redis-server /usr/local/redis/etc/redis.conf (code=exited, status=0/SUCCESS)
  Process: 885 ExecStartPre=/bin/chown -R redis:redis ${statedir} (code=exited, status=0/SUCCESS)
  Process: 882 ExecStartPre=/bin/mkdir -p ${statedir} (code=exited, status=0/SUCCESS)
Main PID: 918 (redis-server)
   CGroup: /system.slice/redis-server.service
           918 /usr/local/redis/bin/redis-server 127.0.0.1:6379

Dec 25 21:20:53 VM_0_11_centos systemd[1]: Starting Redis In-Memory Data Store...
Dec 25 21:20:53 VM_0_11_centos systemd[1]: PID file /var/run/redis/redis.pid not readable (yet?) after start.
Dec 25 21:20:53 VM_0_11_centos systemd[1]: Started Redis In-Memory Data Store.
[root@VM_0_11_centos ~]# service memcached status
[0m memcached.service - SYSV: The memcached daemon is a network memory cache service.
   Loaded: loaded (/etc/rc.d/init.d/memcached; bad; vendor preset: disabled)
   Active: active (running) since Tue 2018-12-25 21:20:53 CST; 15min ago
     Docs: man:systemd-sysv-generator(8)
  Process: 875 ExecStart=/etc/rc.d/init.d/memcached start (code=exited, status=0/SUCCESS)
   CGroup: /system.slice/memcached.service
           916 /usr/local/memcached/bin/memcached -d -p 11211 -u memcached -m 473 -c 1024 -P /var/run/memcached/memcached.pid -l 127.0.0.1

Dec 25 21:20:53 VM_0_11_centos systemd[1]: Starting SYSV: The memcached daemon is a network memory cache service....
Dec 25 21:20:53 VM_0_11_centos memcached[875]: Starting memcached: [  OK  ]
Dec 25 21:20:53 VM_0_11_centos systemd[1]: Started SYSV: The memcached daemon is a network memory cache service..
</code>

然后再去看看其他的:

PHP Prober

PHP 7.3.0 – phpinfo()

OCP – Opcache Control Panel

phpMyAdmin

然后继续安装虚拟主机vhost:

【已解决】给腾讯云香港CVM的CentOS中OneinStack中添加虚拟主机vhost配置

转载请注明:在路上 » 【已解决】腾讯云香港服务器CentOS中用OneinStack搭建Web环境

发表我的评论
取消评论

表情

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址
82 queries in 0.188 seconds, using 22.20MB memory