# 控制中心

探针 phpinfo Opcache
phpMyAdmin

## Congratulations, OneinStack installed successfully!

### Linux+Nginx/Tengine+MySQL/MariaDB/Percona+PHP+Pureftpd+phpMyAdmin+redis+memcached+jemalloc.

## 主机工具

探针 phpinfo phpMyAdmin Opcache

## 基本使用步骤

#### 域名解析

# 域名控制

- 阿里云(万网)
- DNSPOD
- Cloudflare

详细教程

#### 新建虚拟主机

# 建立网站

- 新建虚拟主机 ./vhost.sh
- 删除虚拟主机 ./vhost.sh --del
- 管理FTP账号 ./pureftpd_vhost.sh

详细教程

#### 部署网站

# 上线运行

- phpMyAdmin
- 管理FTP账号 ./pureftpd_vhost.sh
- 备份 ./backup_setup.sh

详细教程

## 如何添加虚拟主机?

    [root@WeiLiu ~]# sudo /root/oneinstack/vhost.sh

    #######################################################################
    #         LNMP for CentOS/RedHat 7+ Debian 9+ and Ubuntu 16+          #
    #######################################################################

    What Are You Doing?
            1. Use HTTP Only  #注解: 1. 仅配置http
            2. Use your own SSL Certificate and Key  #注解: 2. 自己购买ssl替换，自动配置http、https
            3. Use Let's Encrypt to Create SSL Certificate and Key  #注解: 3. Let's 免费证书，自动配置http、https
            q. Exit  #注解: 4. 退出
    Please input the correct option: 3

    Please input domain(example: www.example.com): demo.linuxeye.com  #注解: 添加的虚拟主机域名
    domain=demo.linuxeye.com

    Please input the directory for the domain:demo.linuxeye.com :
    (Default directory: /data/wwwroot/demo.linuxeye.com):             #注解: 网站根目录(绝对路径)
    Virtual Host Directory=/data/wwwroot/demo.linuxeye.com

    Create Virtul Host directory......
    set permissions of Virtual Host directory......

    Do you want to add more domain name? [y/n]: y  #注解: 是否添加更多域名或IP访问同一个网站根目录

    Type domainname or IP(example: example.com other.example.com): demo2.linuxeye.com  #注解: 输入域名或IP(添加多个以空格隔开)
    domain list=demo2.linuxeye.com

    Do you want to redirect from demo2.linuxeye.com to demo.linuxeye.com? [y/n]: y
    #注解: 是否设置301跳转，浏览器访问demo2.linuxeye.com时，强制跳转至demo.linuxeye.com

    Do you want to redirect all HTTP requests to HTTPS? [y/n]: y  #注解: 是否设置http强制跳转至https协议

    Please select domain cert key length.
    Enter one of 2048, 3072, 4096, 8192 will issue a RSA cert.
    Enter one of ec-256, ec-384, ec-521 will issue a ECC cert.

    Please enter your cert key length (default 2048): 2048  #注解: 申请免费证书加密长度

    Please enter your email: lj2007331@mail.com  #注解: 输入邮箱

    [Sun Oct 30 04:27:06 PM CST 2022] Create account key ok.
    [Sun Oct 30 04:27:06 PM CST 2022] No EAB credentials found for ZeroSSL, let's get one
    [Sun Oct 30 04:27:13 PM CST 2022] Registering account: https://acme.zerossl.com/v2/DV90
    [Sun Oct 30 04:27:15 PM CST 2022] Could not get nonce, let's try again.
    [Sun Oct 30 04:27:39 PM CST 2022] Registered
    [Sun Oct 30 04:27:39 PM CST 2022] ACCOUNT_THUMBPRINT='LMG4Elq-AFm-IH17QAk3yjmp-8TNoxi__gWTIIT1tzY'
    ....
    [Sun Oct 30 04:28:20 PM CST 2022] Cert success.

    nginx: the configuration file /usr/local/nginx/conf/nginx.conf syntax is ok
    nginx: configuration file /usr/local/nginx/conf/nginx.conf test is successful

    Do you want to add hotlink protection? [y/n]: n  #注解: 是否设置防盗链

    Allow Rewrite rule? [y/n]: y  #注解: 是否设置伪静态

    Please input the rewrite of programme :
    wordpress,opencart,magento2,drupal,joomla,codeigniter,laravel
    thinkphp,pathinfo,discuz,typecho,ecshop,nextcloud,zblog,whmcs rewrite was exist.
    (Default rewrite: other): wordpress  #注解: 显示为内置为伪静态规则（可手工输入名字），文件位置：/usr/local/nginx/conf/rewrite/wordpress.conf
    You choose rewrite=wordpress

    Allow Nginx/Tengine/OpenResty access_log? [y/n]: y  #注解: 是否记录访问日志
    You access log file=/data/wwwlogs/demo.linuxeye.com_nginx.log

    nginx: the configuration file /usr/local/nginx/conf/nginx.conf syntax is ok
    nginx: configuration file /usr/local/nginx/conf/nginx.conf test is successful
    Reload Nginx......

    #######################################################################
    #         LNMP for CentOS/RedHat 7+ Debian 9+ and Ubuntu 16+          #
    #######################################################################
    Your domain:                  demo.linuxeye.com
    Virtualhost conf:             /usr/local/nginx/conf/vhost/demo.linuxeye.com.conf
    Directory of:                 /data/wwwroot/demo.linuxeye.com
    Rewrite rule:                 /usr/local/nginx/conf/rewrite/wordpress.conf
    Let's Encrypt SSL Certificate:/usr/local/nginx/conf/ssl/demo.linuxeye.com.crt
    SSL Private Key:              /usr/local/nginx/conf/ssl/demo.linuxeye.com.key

## 如何删除虚拟主机?

    [root@WeiLiu ~]# sudo /root/oneinstack/vhost.sh --del

    #######################################################################
    #         LNMP for CentOS/RedHat 7+ Debian 9+ and Ubuntu 16+          #
    #######################################################################

    Virtualhost list:  #注解: 已经绑定域名
    demo1.linuxeye.com demo.linuxeye.com www.linuxeye.com

    Please input a domain you want to delete: demo.linuxeye.com  #注解: 删除demo.linuxeye.com域名虚拟主机

    Do you want to delete Virtul Host directory? [y/n]: y  #注解: 是否删除网站根目录，注意备份
    Press Ctrl+c to cancel or Press any key to continue...  #注解: 按Ctrl+c取消，人已经继续执行

    Domain: demo.linuxeye.com has been deleted.

## FTP客户端推荐

### FileZilla: 下载地址

## 如何管理FTP账号?

    [root@WeiLiu ~]# sudo /root/oneinstack/pureftpd_vhost.sh

    #######################################################################
    #         LNMP for CentOS/RedHat 7+ Debian 9+ and Ubuntu 16+          #
    #                 FTP virtual user account management                 #
    #######################################################################

    What Are You Doing?
            1. UserAdd      #注解: 添加Ftp账号
            2. UserMod      #注解: 更改某个Ftp账号根目录权限
            3. UserPasswd   #注解: 更改某个Ftp密码
            4. UserDel      #注解: 删除某个Ftp账号
            5. ListAllUser  #注解: 列出所有Ftp账号
            6. ShowUser     #注解: 显示某个Ftp账号详情
            q. Exit         #注解: 退出（字母q）
    Please input the correct option: 1

    Please input a username: ftpuser

    Please input the password: UArUDjLZ12HD

    Please input the directory(Default directory: /data/wwwroot):    #注解: ftpuser用户根目录，建议默认，可直接回车
    Password:
    Enter it again:
    #####################################

    [ftpuser] create successful!

    You user name is : ftpuser
    You Password is : UArUDjLZ12HD
    You directory is : /data/wwwroot

## 数据库

phpMyAdmin 如何获取MySQL root密码? 如何配置MySQL远程连接?

## 如何备份?

    [root@WeiLiu ~]# sudo /root/oneinstack/backup_setup.sh #设置备份参数

    #######################################################################
    #         LNMP for CentOS/RedHat 7+ Debian 9+ and Ubuntu 16+          #
    #                     Setup the backup parameters                     #
    #######################################################################

    Please select your backup destination:
            1. Localhost     #解析: 1. 本地备份
            2. Remote host   #解析: 2. 远程备份(ssh)
            3. Aliyun OSS    #解析: 3. 阿里云OSS备份
            4. Qcloud COS    #解析: 4. 腾讯云COS备份
            5. UPYUN         #解析: 5. 又拍云备份
            6. QINIU         #解析: 6. 七牛云备份
            7. Amazon S3     #解析: 7. 亚马孙S3备份
            8. Dropbox       #解析: 8. Dropbox备份
    Please input numbers:(Default 1 press Enter) 1

    Please select your backup content:
            1. Only Database
            2. Only Website
            3. Database and Website
    Please input a number:(Default 1 press Enter) 1  #解析: 选择备份数据库

    Please enter the directory for save the backup file:
    (Default directory: /data/backup):   #解析: 本地或远程备份目录

    Please enter a valid backup number of days:
    (Default days: 5): 10  #解析: 备份保留天数

    Please enter one or more name for database, separate multiple database names with commas:
    (Default database: linuxeye,weiliu) weiliu,linuxeye  #解析: 备份数据库，以逗号隔开

    You have to backup the content:
    Database: weiliu,linuxeye

    sudo /root/oneinstack/backup.sh #立即备份

    sudo echo '0 1 * * * sudo /root/oneinstack/backup.sh > /dev/null 2>&1' >> /var/spool/cron/root #设置计划任务自动定时备份, 设置每天凌晨一点备份

## 如何管理服务?

Nginx/Tengine/OpenResty:

`systemctl {start|stop|status|restart|reload} nginx`

MySQL/MariaDB/Percona:

`systemctl {start|stop|restart|reload|status} mysqld`

PostgreSQL:

`systemctl {start|stop|restart|status} postgresql`

MongoDB:

`systemctl {start|stop|status|restart|reload} mongod`

PHP:

`systemctl {start|stop|restart|reload|status} php-fpm`

Apache:

`systemctl {start|restart|stop} httpd`

Tomcat:

`systemctl {start|stop|status|restart} tomcat`

Pure-Ftpd:

`systemctl {start|stop|restart|status} pureftpd`

Redis:

`systemctl {start|stop|status|restart|reload} redis-server`

Memcached:

`systemctl {start|stop|status|restart|reload} memcached`

## 如何更新版本?

    [root@WeiLiu ~]# /root/oneinstack/upgrade.sh

    #######################################################################
    #         LNMP for CentOS/RedHat 7+ Debian 9+ and Ubuntu 16+          #
    #              Upgrade Software versions for OneinStack               #
    #######################################################################

    What Are You Doing?
             1. Upgrade Nginx/Tengine/OpenResty
             2. Upgrade Apache
             3. Upgrade Tomcat
             4. Upgrade MySQL/MariaDB/Percona
             5. Upgrade PHP
             6. Upgrade Redis
             7. Upgrade Memcached
             8. Upgrade phpMyAdmin
             9. Upgrade OneinStack latest
            10. Upgrade acme.sh latest
             q. Exit

    Please input the correct option:

## 如何卸载?

    [root@WeiLiu ~]# /root/oneinstack/uninstall.sh #注意备份

    #######################################################################
    #         LNMP for CentOS/RedHat 7+ Debian 9+ and Ubuntu 16+          #
    #                         Uninstall OneinStack                        #
    #######################################################################

    What Are You Doing?
             0. Uninstall All
             1. Uninstall Nginx/Tengine/OpenResty/Apache/Tomcat
             2. Uninstall MySQL/MariaDB/Percona
             3. Uninstall PostgreSQL
             4. Uninstall MongoDB
             5. Uninstall all PHP
             6. Uninstall PHP opcode cache
             7. Uninstall PHP extensions
             8. Uninstall PureFtpd
             9. Uninstall Redis
            10. Uninstall Memcached
            11. Uninstall phpMyAdmin
            12. Uninstall Nodejs (PATH: /usr/local/node)
             q. Exit

    Please input the correct option:

云主机安全组必须打开如下端口:

- ssh: 22
- http: 80
- https: 443
- ftp: 21, 20000~30000

云主机安全组端口开放教程 阿里云安全组端口 腾讯云安全组端口 华为云安全组端口

PayPal: lj2007331@gmail.com ; 支付宝：lj2007331@gmail.com , 手机客户端扫描二维码捐赠：

QQ群: 262601796(新) 558540514(付费千人群)

回顶部