朱纯树博客
VPS测评推荐网站
cloudacead cloudacead

宝塔面板安装到home下,解决磁盘不够用的问题

宝塔面板安装到home下,解决磁盘不够用的问题插图

 

查看硬盘和CPU配置核心和线程数

	
fdisk -l && dmidecode -s processor-version && cat /proc/cpuinfo| grep "processor"| wc -l​

宝塔面板官方的安装脚本是强制安装到系统根目录下的www目录的,而官方也明确表示只能这样装,客户经常会反馈硬盘不够用

虽然官方这么说,但是并不代表不允许修改,以下是修改方法,本人原创亲测:如果是纯净系统还没安装宝塔面板,直接连接终端,按以下顺序操作:
后来查资料,每个命令之间用&&隔开,可以一次性执行完成

cd /home && mkdir www && ln -s /home/www   /www && cd / && ll -lh && yum install -y wget && wget -O install.sh http://download.bt.cn/install/install_6.0.sh && echo y|sh install.sh​

 

宝塔安装失败时,会显示宝塔服务不全,导致宝塔无法启动面板,只能先反安装

wget http://download.bt.cn/install/bt-uninstall.sh && sh bt-uninstall.sh

 

这样再安装就会正常启动宝塔了 
 

如果怕不干净,可以把WWW整个目录都删除了,但是注意会删除数据库和网站内容,所以这个命令只适合新机,不适合已经布置了网站的服务器修复面板

rm –rf  /www/home
​

 

 

 
netsh firewall set icmpsetting 8
slmgr /ipk 489J6-VHDMP-X63PK-3K798-CPX3Y
slmgr /skms key.ZYM.com
slmgr /ato

fdisk -l     查看分区和磁盘,根据硬盘大小可以判断出是否为SSD,120,240,480G等均为SSD
cat /etc/redhat-release 查询CENTOS版本号
忘记宝塔安装默认设置,执行以下命令

bt default

【推荐此命令】cd /home && mkdir www先创建www目录,ln -s /home/www   /www执行软联接
然后&& cd /返回根目录,并且&& ll -lh 检查是否软连接成功,&& fdisk -l检查一下硬盘参数
最后才是安装宝塔的命令

香港节点,针对香港服务器,速度快一些

cd /home && mkdir www && ln -s /home/www   /www && cd / && ll -lh && fdisk -l && yum install -y wget && wget -O install.sh http://download.bt.cn/install/install_6.0.sh && bash install.sh

一键脚本,安装并测试带宽:

 

easy_install speedtest_cli && ./speedtest-cli –server 17251 –share

 

yum install -y wget && wget -O speedtest-cli https://raw.githubusercontent.com/sivel/speedtest-cli/master/speedtest.py --no-check-certificate
chmod +x speedtest-cli
./speedtest-cli

如果后面还需要测试,就只需要执行./speedtest-cli
如果后面要指定测试位置需要指定–server ID,ID值在https://www.speedtest.net/speedtest-servers-static.php获取
–share是指生成图片,然后分享

./speedtest-cli --server 21005 --share
21005代表上海联通,用于测试日本

————————-其它执行方式和分步讲解—————————-
备用命令:cd /home && mkdir www && ln -s /home/www   /www
不检查软连接是否成功,一般来说执行后肯定是没错的

1、进入home目录

cd /home

2、创建宝塔面板安装需要用的www目录

mkdir www

3、建立/home/www的软连接到/www(也就是给系统根目录建立一个www的“快捷方式”指向/home/www)

ln -s /home/www   /www

4、正常安装宝塔面板即可

注意:已经安装好的宝塔面板,想要迁目录,只能先备份好数据,然后重装服务器,弄个干净系统,再按上面的操作,重新安装。

之前测试过直接使用MV命令会导致部分文件无法移动,面板随之崩溃,宝塔服务无法启动!想要偷懒只能先尝试删除掉宝塔面板,再用MV移动目录

CentOS7 常用命令

 
lsblk                                      查看分区和磁盘
df -h                                       查看空间使用情况
fdisk -l                                    分区工具查看分区信息
cfdisk /dev/sda                             查看分区
blkid                                        查看硬盘label(别名)
du -sh ./*                                  统计当前目录各文件夹大小
free -h                                      查看内存大小
cat /proc/uptime| awk -F.'{run_days=$1 / 86400;run_hour=($1 % 86400)/3600;run_minute=($1 % 3600)/60;run_second=$1 % 60;printf("系统已运行:%d天%d时%d分%d秒",run_days,run_hour,run_minute,run_second)}'
查看CENTOS系统运行了多长时间

文章来源于互联网: 宝塔面板安装到home下,解决磁盘不够用的问题

赞(0) 打赏
未经允许不得转载:VPS测评推荐网站 - 朱纯树博客 » 宝塔面板安装到home下,解决磁盘不够用的问题

评论 6970

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址
  1. #6975

    Hi there! This is my 1st comment here so I just wanted to give a quick shout out and tell you I truly enjoy reading your articles. Can you suggest any other blogs/websites/forums that cover the same subjects? Thanks!|

    Myles11小时前回复
  2. #6974

    sildenafil 100mg price – https://belviagra.com sildenafil 100mg price in india

  3. #6973

    Simply wish to say your article is as astounding. The clarity in your post is just spectacular and i could assume you’re an expert on this subject. Well with your permission allow me to grab your RSS feed to keep up to date with forthcoming post. Thanks a million and please continue the gratifying work.|

    Arminda22小时前回复
  4. #6972

    Everyone loves it when individuals come together and share opinions. Great blog, keep it up!|

    Lauren22小时前回复
  5. #6971

    I read this paragraph completely about the comparison of most recent and earlier technologies, it’s amazing article.|

    Reid22小时前回复
  6. #6970

    Wonderful work! This is the type of info that should be shared across the internet. Shame on Google for no longer positioning this publish higher! Come on over and seek advice from my website . Thank you =)|

    Myrtie22小时前回复
  7. #6969

    hydroxychloroquine 400 mg buy online how can i get hydroxychloroquine hqc hydroxychloroquine 400 mg

  8. #6968

    This is my first time pay a quick visit at here and i am in fact happy to read all at single place.|

  9. #6967

    It’s very effortless to find out any topic on net as compared to textbooks, as I found this piece of writing at this web page.|

  10. #6966

    We’re a group of volunteers and opening a new scheme in our community. Your web site provided us with valuable info to work on. You’ve done a formidable job and our whole community will be grateful to you.|

    Long3天前回复