Climate Group

http://pkumet.live/group

User Tools

Site Tools


hardware:cs2019:log

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
hardware:cs2019:log [2020/07/02 02:32]
Xinyu Wen
hardware:cs2019:log [2023/04/28 06:16] (current)
Xinyu Wen 增加16T硬盘一块!
Line 1: Line 1:
 ====== Log: 气候组服务器维护记录 ====== ====== Log: 气候组服务器维护记录 ======
  
-===== 1Installation =====+===== 10加装一块 16T SeaGate 硬盘 =====
  
 +首先用root账户查看一下硬盘的设备名,并进入分区命令 parted
 +
 +  fdisk -l (或用 parted -l 也可以)
 +  parted /dev/sdd (进入 parted 环境)
 +  print (查看一下当前设备的情况)
 +
 +然后构建一个label,通常对于大于2T的硬盘用gpt,可选的label有:aix, amiga, bsd, dvh, gpt, mac, ms-dos, pc98, sun, and loop
 +
 +  mklabel gpt
 +  print
 +
 +然后就可以创建分区了,如果全盘就分一个区的话,这样做
 +
 +  mkpart primary ext4 0% 100%
 +  print
 +
 +退出即可保存分区表,就这么简单!
 +
 +  quit
 +
 +下面要format这个分区
 +
 +  mkfs -t ext4 /dev/sdd1
 +
 +最后别忘了在/etc/fstab中加入相应条目,让它自动挂载
 +
 +  mkdir /home4
 +  vi /etc/fstab
 +    加入如下这样一行即可:
 +    /dev/sdd1 /home4 ext4 defaults 0 2
 +
 +大功告成!
 +  
 +
 +===== 9. WordPress =====
 +2022-July-13, I install MySQL + php extensions and setup my first WordPress
 +
 +有关 MySQL 的安装和配置如下:
 +
 +  直接用apt安装MySQL
 +  apt install mysql-server
 +  
 +  进入MySQL命令行环境
 +  mysql -u root
 +  CREATE DATABASE wordpress; 创建一个给wp用的数据库wordpress
 +  CREATE USER wpuser IDENTIFIED BY 'your-password-here'; 添加一个用户wpuser和密码
 +  GRANT ALL ON wordpress.* TO wpuser; 给wpuser用户赋予完全读写wordpress数据库的权力
 +  FLUSH PRIVILEGES; 改动生效
 +  EXIT
 +
 +有关 PHP 的安装和配置如下:
 +
 +  系统原本就有apache2和php,其它是需要安装的,否则wordpress会报错说:php没有安装mysql的扩展插件
 +  apt install apache2 \
 +              ghostscript \
 +              libapache2-mod-php \
 +              mysql-server \
 +              php \
 +              php-bcmath \
 +              php-curl \
 +              php-imagick \
 +              php-intl \
 +              php-json \
 +              php-mbstring \
 +              php-mysql \
 +              php-xml \
 +              php-zip
 +  此时务必重启一下计算机!
 +
 +有关 WordPress 的安装和配置:
 +
 +  cp wp-config-sample.php wp-config.php
 +  
 +  vi wp-config.php
 +     我改动了如下几处
 +     define( 'DB_NAME', 'wordpress' );
 +     define( 'DB_USER', 'wpuser' );
 +     define( 'DB_PASSWORD', 'mysql中设置的wpuser的密码' );
 +     $table_prefix = 'wp20220713_';
 +     
 +  chown -R www-data:www-data wordpress   把wordpress整个目录的文件都设为www-data用户
 +     
 +  打开浏览器,进入5分钟配置页面即可:http://climateserver.xxxx.xxx/wordpress/wp-admin/install.php
 +  
 +  日后访问网页:http://climateserver.xxxx.xxx/wordpress
 +  日后登录后台:http://climateserver.xxxx.xxx/wordpress/wp-login.php
 +
 +
 +===== 8. WebDAV service =====
 +2022-May-17, I strictly follow this page to configure WebDAV service within Apache2 framework: https://www.techrepublic.com/article/how-to-enable-webdav-on-your-ubuntu-server/
 +
 +   你可以这么使用webdav服务:
 +   url: http://climateserver.3322.org/webdav/[MakeOnePathHere] 实际是在/var/www/webdav/下建一个你的具体使用目录,然后连这个url即可
 +   id:  wensirwebdav
 +   pw:  wxxxxxxx2xx0 经典pw
 +
 +
 +===== 7. 重装NCL =====
 +2021年10月17日,未知原因原来的NCL6虚拟环境不能用了,进不了ncl,于是决定重装
 +
 +  su -    #必须切换到root账户
 +  conda create -n NCL662 -c conda-forge ncl    #就这一条命令即可完成安装NCL,6.6.2版是最新版
 +
 +至此已经完成安装,以后用如下命令即可进入或退出NCL环境
 +  conda activate NCL662
 +  conda deactivate
 +
 +老的NCL6环境,就删除吧
 +  conda env list    #查看有哪些环境
 +  conda env remove --name NCL6
 +
 +
 +===== 6. 断电后fsck硬盘 =====
 +2021年8月22日,来到办公室发现cs已经关机了,估计是大楼断电导致了cs硬关机,唉,很为启动盘捏一把汗。果然,启动cs后,一大堆错误,第一遍甚至没起来。按reset键重启,在经历一大堆硬盘报错后,进入到登录画面了。登录,切换root,感觉还是不太正常。决定用fsck命令检查启动盘的所有错误。命令如下:
 +
 +<code>
 +df -T -h                 # 检查各个盘的dev名,和fs类型(是否ext4?)
 +fsck.ext4    /dev/sdc2   # sdc2就是ubuntu的系统盘,另外两块10T数据盘分别是sda1和sdb1
 +或者
 +fsck.ext4 -y /dev/sdc2   # 这可以省却很多按y(或直接按回车)的过程,整个检查过程,大概有几十个错误需要按回车
 +</code>
 +
 +之后再重启,就没有问题了!God bless me!
 +
 +===== 5. Banner =====
 +<code>
 +##### Generate banner at /etc/motd (XW: Mar 6, 2020)
 +www.patorjk.com/software/taag
 +Input anything you want to show as hello banner
 +Press "Test All" so that you can choose one touching you
 +</code>
 +
 +===== 4. NCL within conda =====
 +语真反映yum安装的NCL画图会出现莫名其妙的问题,再加上历史遗留的load问题,索性干脆按照官网指导,用conda重新安一个NCL和专门给它独享的环境。
 +<code>
 +##### Re-Install NCL through conda (XW: Feb 22, 2020)
 +follow this page: http://www.ncl.ucar.edu/Download/conda.shtml
 +run this command to install NCL 6.6.2 into an environment named "NCL6"
 +conda create -n NCL6 -c conda-forge ncl
 +
 +Please note that everyone, for everytime,
 +should run "conda activate NCL6" right before using NCL.
 +
 +"conda deactivate" or not doesn't matter.
 +</code>
 +
 +===== 3. Timezone =====
 +机器时区默认是错的,故手工修改一下时区信息
 +<code>
 +##### Reset Timezone
 +timedatectl set-timezone Asia/Shanghai
 +timedatectl (this command will show below outputs)
 +(base) root@cs:~# timedatectl
 +                      Local time: Mon 2019-11-04 14:45:17 CST
 +                  Universal time: Mon 2019-11-04 06:45:17 UTC
 +                        RTC time: Mon 2019-11-04 06:45:17
 +                       Time zone: Asia/Shanghai (CST, +0800)
 +       System clock synchronized: yes
 +systemd-timesyncd.service active: yes
 +                 RTC in local TZ: no
 +</code>
 +
 +===== 2. Python =====
 +<code>
 +##### Python3 w/ Anaconda
 +Download Anaconda3-2019.10-Linux-x86_64.sh from tuna.tsinghua and install it
 +After installation, it is shown:
 +-----
 +installation finished.
 +Do you wish the installer to initialize Anaconda3
 +by running conda init? [yes|no]
 +[no] >>> yes
 +no change     /opt/anaconda3/condabin/conda
 +no change     /opt/anaconda3/bin/conda
 +no change     /opt/anaconda3/bin/conda-env
 +no change     /opt/anaconda3/bin/activate
 +no change     /opt/anaconda3/bin/deactivate
 +no change     /opt/anaconda3/etc/profile.d/conda.sh
 +no change     /opt/anaconda3/etc/fish/conf.d/conda.fish
 +no change     /opt/anaconda3/shell/condabin/Conda.psm1
 +no change     /opt/anaconda3/shell/condabin/conda-hook.ps1
 +no change     /opt/anaconda3/lib/python3.7/site-packages/xontrib/conda.xsh
 +no change     /opt/anaconda3/etc/profile.d/conda.csh
 +modified      /root/.bashrc
 +
 +==> For changes to take effect, close and re-open your current shell. <==
 +
 +If you'd prefer that conda's base environment not be activated on startup,
 +   set the auto_activate_base parameter to false:
 +
 +conda config --set auto_activate_base false
 +
 +Thank you for installing Anaconda3!
 +-----
 +</code>
 +
 +之后用conda装一个basemap,以方便慕琦使用python画地图
 +<code>
 +##### Install basemap package for anaconda/base (XW: Mar 4, 2020)
 +conda install basemap
 +</code>
 +
 +此外,有些package用conda没法安装,使用pip做如下补充:
 +<code>
 +##### pip install
 +pip install pygame
 +pip install nikola pelican
 +</code>
 +
 +===== 1. Installation =====
 <code> <code>
 ##### Tools ##### Tools
Line 38: Line 248:
  
 ##### Network ##### Network
 +apt install aria2 tranmission-cli     Download tool, support magnetic torrent
 apt install firefox apt install firefox
 apt install w3m apt install w3m
 apt install apache2 apt install apache2
-    a2enmod userdir            Open HTTP for each user under ~/public_html +    a2enmod userdir                   Open HTTP for each user under ~/public_html 
-    systemctl restart apache2  Restart HTTP service+    systemctl restart apache2         Restart HTTP service
 apt install php apt install php
 apt install shellinabox apt install shellinabox
     service shellinabox status     service shellinabox status
     service shellinabox start     service shellinabox start
-    vi /etc/default/shellinabox if you want to change the default port 4200+    vi /etc/default/shellinabox       if you want to change the default port 4200
 apt install vsftpd apt install vsftpd
     systemctl status vsftpd     systemctl status vsftpd
     systemctl start vsftpd     systemctl start vsftpd
     systemctl enable vsftpd     systemctl enable vsftpd
- 
-##### Python3 w/ Anaconda 
-Download Anaconda3-2019.10-Linux-x86_64.sh from tuna.tsinghua and install it 
-After installation, it is shown: 
------ 
-installation finished. 
-Do you wish the installer to initialize Anaconda3 
-by running conda init? [yes|no] 
-[no] >>> yes 
-no change     /opt/anaconda3/condabin/conda 
-no change     /opt/anaconda3/bin/conda 
-no change     /opt/anaconda3/bin/conda-env 
-no change     /opt/anaconda3/bin/activate 
-no change     /opt/anaconda3/bin/deactivate 
-no change     /opt/anaconda3/etc/profile.d/conda.sh 
-no change     /opt/anaconda3/etc/fish/conf.d/conda.fish 
-no change     /opt/anaconda3/shell/condabin/Conda.psm1 
-no change     /opt/anaconda3/shell/condabin/conda-hook.ps1 
-no change     /opt/anaconda3/lib/python3.7/site-packages/xontrib/conda.xsh 
-no change     /opt/anaconda3/etc/profile.d/conda.csh 
-modified      /root/.bashrc 
- 
-==> For changes to take effect, close and re-open your current shell. <== 
- 
-If you'd prefer that conda's base environment not be activated on startup, 
-   set the auto_activate_base parameter to false: 
- 
-conda config --set auto_activate_base false 
- 
-Thank you for installing Anaconda3! 
------ 
- 
-##### pip install 
-pip install pygame 
-pip install nikola pelican 
- 
-##### Reset Timezone 
-timedatectl set-timezone Asia/Shanghai 
-timedatectl (this command will show below outputs) 
-(base) root@cs:~# timedatectl 
-                      Local time: Mon 2019-11-04 14:45:17 CST 
-                  Universal time: Mon 2019-11-04 06:45:17 UTC 
-                        RTC time: Mon 2019-11-04 06:45:17 
-                       Time zone: Asia/Shanghai (CST, +0800) 
-       System clock synchronized: yes 
-systemd-timesyncd.service active: yes 
-                 RTC in local TZ: no 
- 
-##### Re-Install NCL through conda (XW: Feb 22, 2020) 
-follow this page: http://www.ncl.ucar.edu/Download/conda.shtml 
-run this command to install NCL 6.6.2 into an environment named "NCL6" 
-conda create -n NCL6 -c conda-forge ncl 
- 
-Please note that everyone, for everytime, 
-should run "conda activate NCL6" right before using NCL. 
- 
-"conda deactivate" or not doesn't matter. 
- 
-##### Install basemap package for anaconda/base (XW: Mar 4, 2020) 
-conda install basemap 
- 
-##### Generate banner at /etc/motd (XW: Mar 6, 2020) 
-www.patorjk.com/software/taag 
-Input anything you want to show as hello banner 
-Press "Test All" so that you can choose one touching you 
 </code> </code>
  
hardware/cs2019/log.1593657132.txt.gz · Last modified: 2020/07/02 02:32 by Xinyu Wen