oneinstack 一键配置
最后更新于:2022-04-02 02:34:02
[TOC]
## 一键安装php开发环境
[oneinstack](https://oneinstack.com/install/)
[自动安装](https://oneinstack.com/auto/)
技巧 一键安装
```
~/oneinstack/install.sh --apache_option 1 --php_option 7 --db_option 1 --php_extensions imagick --dbrootpwd idcpj --redis --phpmyadmin --reboot
```
## 添加附加组件
`./addons.sh`

## 添加虚拟主机
`./vhost.sh`

## 删除虚拟主机
`./vhost.sh del`

## 管理FTP账号
`./pureftpd_vhost.sh`

## 备份数据库和网站
`./backup_setup.sh`

```
./backup.sh # Start backup, You can add cron jobs
# crontab -l # Examples
0 1 * * * cd ~/oneinstack;./backup.sh > /dev/null 2>&1 &
```
## 管理服务
```
# MySQL
service mysqld {start|stop|restart|reload|status}
#PHP
service php-fpm {start|stop|restart|reload|status}
#Apache
service httpd {start|restart|stop}
#Redis
service redis-server {start|stop|status|restart|reload}
#Memcached:
service memcached {start|stop|status|restart|reload}
```
## 更新卸载组件
```
./upgrade.sh #更新
./uninstall.sh #卸载
```
## Opcache的缓存问题
如果使用Opcache 缓存,代码上传后,需要间隔2~3分钟才能生效
1. 方法一,卸载Opcache
```
cd /root/oneinstack
./addons.sh
```

2. 方法二:刷新PHP缓存
访问http://公网IP/ocp.php
或者直接访问http://公网IP/ocp.php?RESET=1
';