Ubuntu 管理心得

搜尋此網誌

2023年11月30日 星期四

Java 11 installation complains about dependencies

cf: https://askubuntu.com/questions/1356835/java-11-installation-complains-about-dependencies

While
sudo apt --fix-broken install
or
sudo apt purge openjdk-11-jdk-headless

Get the followings:

dpkg: error processing archive /var/cache/apt/archives/openjdk-11-jre-headless_11.0.
21+9-0ubuntu1~22.04_amd64.deb (--unpack):
 無法將 './usr/lib/jvm/java-11-openjdk-amd64/lib/modules' 的解壓縮資料複製到 '/usr/l
ib/jvm/java-11-openjdk-amd64/lib/modules.dpkg-new':檔案或資料串流意外結束
處理時發生錯誤:
 /var/cache/apt/archives/openjdk-11-jre-headless_11.0.21+9-0ubuntu1~22.04_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

Fix by running the followings:

sudo apt-get clean
sudo apt-get install -f
sudo dpkg --configure -a

2023年11月14日 星期二

php cannot run inside drupal subdirectory

For example, if run the php files in /home/chiao/public_html/drupaldam10_from_9/dam/web/Check_PCM_v, then it will get "Forbidden You don't have permission to access this resource.
Apache/2.4.52 (Ubuntu) Server at localhost Port 80"
 
Edit /home/chiao/public_html/drupaldam10_from_9/dam/web/.htaccess, add one line as below.

...
#chiao, 20231114,
# --- Add the line
  RewriteCond %{REQUEST_URI} !/Check_PCM_v/[^/]*\.php$
# ----------------
  RewriteCond %{REQUEST_URI} !/core/[^/]*\.php
...

Done.

2023年11月13日 星期一

Upgrade drupal 10 from 9

  1. Copy drupal database to drupal10_from_9
  2. Copy ~/public_html/drupal to ~/public_html/drupal10_from_9 
  3. Edit web/sites/default/settings.php. Change database from drupal to drupal10_from_9
  4. In phpmyadmin, set drupal10_from_9 database privileges to user drupaladmin
  5. Browse http://localhost/~chiao/drupal10_from_9/web, go to: 管理 -> 擴展 
    1. 安裝:
    2. 解除安裝:
          CKEditor (Deprecated)
          Add HW Exam
          Add My Exams Forms     
          Amazing forms     
          Appraisal Edit Forms     
          Appraisal Export Forms     
          Appraisal List Forms     
          Engineering Graphics     
          Engineering Graphics YouTube    
          FAHP Expert Data Creation Forms     
          FAHP Hierarchy Creation Forms     
          FAHP Online forms     
          FAHP Show Membership Forms     
          FAHP Synthesis Computation Form
      (for drupaladm)PCM Consistency Check Forms   
          Grade Query forms     
          Hello World     
          Industrial English     
          List HW Exam     
          Science Technology English     
          Teacher Appraisal Forms
  6. cf: https://www.drupal.org/docs/upgrading-drupal/upgrading-from-drupal-8-or-later/how-to-upgrade-from-drupal-9-to-drupal-10
    chmod 777 web/sites/default
    sudo chmod 666 web/sites/default/*settings.php
    chmod 666 web/sites/default/*services.yml
    composer require 'drupal/core-recommended:^10' 'drupal/core-composer-scaffold:^10' 'drupal/core-project-message:^10' --no-update
    composer require 'drupal/core-dev:^10' --dev --no-update
    composer update
  7. set $settings['update_free_access']= TRUE  in settings.php
  8. visiting httsp://localhost/~chiao/drupal10_from9/web/update.php
    Some modules need to be upgraded, e.g. color. Click color will open the color module project, then copy the composer line to install it inside ~/public_html/drupal0_from_9/web
    1. If there are messages like below:
      Status Details
      發現錯誤
      Removed core modules
      You must add the following contributed modules and reload this page.

          Color
          Quick Edit
          RDF

      These modules are installed on your site but are no longer provided by Core.
      For more information read the documentation on deprecated modules.
      Removed core themes
      You must add the following contributed themes and reload this page.

          Seven
          Bartik
    2. cd ~/public_html/drupal10_from_9, then
      composer require 'drupal/color:^1.0'
      composer require 'drupal/quickedit:^1.0'
      composer require 'drupal/rdf:^2.1'
      composer require 'drupal/seven:^1.0'
      composer require 'drupal/bartik:^1.0'
    3. Go to and make sure update.php page not complain anymore. (IMPORTANT!),
      If shows "Drupal 資料庫更新", then click 繼續 and Apply pending updates Until the page shows "Drupal 資料庫更新".
    4. set back $settings['update_free_access'] = FALSE  in settings.php. 
    5. chmod 755 web/sites/default
    6. sudo chmod 600 web/sites/default/*settings.php
    7. chmod 644 web/sites/default/*services.yml
    8. Go to  http://localhost/~chiao/drupal10_from_9/web/admin/reports/updates It should be

      Drupal 核心

      最新的 確定
    9. Go to http://localhost/~chiao/drupal10_from_9/web/admin/config/development/performance Click "清除所有快取"
    10. Add my own modules, e.g. Grade Query:
      cd  ~/public_html/drupal10_from_9/web/modules/custom/grade_query
      Edit  grade_query.info.yml: core_version_requirement: ^8 || ^9 || ^10
      Go to http://localhost/~chiao/drupal10_from_9/web/admin/modules
      Click: Grade Query forms 查詢成績

      安裝
       
       
       
    Done!

phpmyadmin import file size too large

 edit /etc/php/8.1/fpm/php.int:

upload_max_filesize = 200M
post_max_size = 300M

sudo systemctl restart php8.1-fpm

Go to: http://localhost/~chiao/phpinfo.php to check if it is changed.

2023年11月6日 星期一

Renew

  1. sudo systemctl stop apache2
  2. For pi4, change back the dilink wifi router port forward for internet inbound 80 and 443. 

  3. sudo certbot renew
  4. sudo systemctl start apache2
  5. For pi4, change the dilink wifi router port forward for internet inbound 9680->80 and 9681->443  

Use the command to check the certificate date:
echo | openssl s_client -connect localhost:443 -servername kpchiao9600k.sino.tw 2>/dev/null | openssl x509 -noout -dates

One more thing:

Just wait until the end of 3-month period to renew, because the next expiration date is counted from the renew date.

2023年11月3日 星期五

加中文異體字

 cf: https://latexlyx.blogspot.com/2020/12/noto-fonts-xelatex.html

Follow the steps above. Some 中文異體字 that not be able to be created using CJK can be prooduced using. e.g xelatex aa.tex. 

網誌存檔