Ubuntu 管理心得

搜尋此網誌

顯示具有 drupal 標籤的文章。 顯示所有文章
顯示具有 drupal 標籤的文章。 顯示所有文章

2024年10月21日 星期一

drupal no theme layout show

進入「管理」的「效能」,將最底下的「整合 CSS 檔案」及「整合 Javascript 檔案」unclick ! 即可展現 theme 的 layout

清除快取
快取
This is used as the value for max-age in Cache-Control headers.
頻寬最佳化
外部資源可自動優化,可以減少網站的檔案大小及請求數量。

The followings are from ChatGPT:

5. CSS/JS Aggregation Issues:

  • Cause: Sometimes, Drupal's CSS/JS aggregation can cause issues, especially during development.
  • Fix: Disable CSS/JS aggregation temporarily by unchecking the options under Admin > Configuration > Development > Performance.

 

2024年10月20日 星期日

update core

cf: https://www.drupal.org/project/drupal/releases/10.2.10

For example, upgrade to core 10.2.10

composer require drupal/core-recommended:10.2.10 drupal/core-composer-scaffold:10.2.10 drupal/core-project-message:10.2.10 --update-with-all-dependencies

 

2024年4月2日 星期二

Clone 教學網頁

  1. Rename drupal0_from_9 database to drupal10_from_9_pi4_20240402
  2. Using command line mysql instead of phpmyadmin to clone draupal0_from_9 database from kpci7 to pi4
  3. Using sudo to clone public_html/drupal10_from_9 from kpci7 to pi4
  4. In pi4 phpmyadmin, update the drupal10_from_9 database privileges for drupaladmin

2024年1月20日 星期六

after composer update error "The website encountered an unexpected error. Try again later"

  1. Edit settings.php, set $settings['update_free_access'] = FALSE; to TRUE
  2. Browse http://192.168.1.14/~chiao/drupaldam10_from_9/dam/web/update.php
  3. update the database
  4. Set $settings['update_free_access'] to = FALSE

2023年12月6日 星期三

CKeditor 5 setup for drupal 10

 Go to
     首頁->管理 ->設定-> 內容撰寫 ->文字格式與編輯器
set 文字編輯器 to CKEditor 5

Also, for other 文字格式。

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!

2023年3月18日 星期六

php stuff in pi4

  1. sudo apt purge php*
  2. sudo apt install php8.0
  3. sudo apt install php8.0-mysql
    sudo apt install php8.0-dom
    sudo apt install php8.0-mbstring
    sudo apt install php8.0-fpm
    sudo apt install php8.0-pear
    sudo apt install php-pear

2023年3月8日 星期三

Clone drupaldam to pi4

  1. Open Backup and Migration in http://kpcp4.au.edu.tw/~chiao/drupaldam/dam/web/. Backup all tables and save it as backup_kpci7_drupaldam.sql.gz
  2. gzip -d backup_kpci7_drupaldam.sql.gz > backup_kpci7_drupaldam.sql
  3. sed 's/utf8mb4_0900_ai_ci/utf8mb4_unicode_ci/g' backup_kpci7_drupaldam.sql > backup_kpci7_drupaldam_unicode.sql
  4. Open Backup and Migration in https://192.168.1.14/~chiao/drupaldam/dam/web/. Restore as with the file backup_kpci7_drupaldam_unicode.sql
  5. Done.
     

2023年2月24日 星期五

2023年2月23日 星期四

Remove mayo from drupal9

cf: https://www.drupal.org/docs/theming-drupal/defining-a-theme-with-an-infoyml-file
  1. mkdir ~/public_html/drupal9/web/themes/contrib/mayo
  2. cd ~/public_html/drupal9/web/themes/contrib/mayo
  3. vim mayo.info.yml with the following lines:
    name: Mayo
    type: theme
    description: 'remove mayo'
    core_version_requirement: ^9
    libraries:
      - mayo/l
    base theme: stable9
    regions:
      header: 'Header'
      content: 'Content'
      sidebar_first: 'Sidebar first'
    footer: 'Footer'
  4. touch mayo.l
  5. Go into admin/appearance 首頁-> 管理-> 外觀
    There sould be a Myao theme. Delete it. Done!
  6. If Mayo theme not appear, then this method not work.

2022年11月16日 星期三

PhpOffice\PhpSpreadsheet\Spreadsheet' not found

composer require phpoffice/phpspreadsheet



2022年6月28日 星期二

Set mail.au.edu.tw as email server

 The username should be au4051 or au4051@mail.au.edu rather than chiao@mail.au.edu.tw.

2022年1月30日 星期日

Install drupal from scratch

cf: https://www.drupal.org/docs/installing-drupal


  1. cd public_html; mkdir drupaldam
  2. composer create-project drupal/recommended-project drupaldam  && cd drupaldam
  3. Enter phpmyadmin;
    (1). create database 'drupaldam' with utf8mb4_general_ci

    (2). drupaladmin 指定 drupaldam 資料庫權限:
  4. cd ~/public_html; sudo chown -R www-data.www-data drupaldam
  5. Visit site in browser:
    http:kpchiao.sino.tw:8080/~chiao/drupaldam/web/core/install.php
    At
    資料庫設定:
  6. Finish the next two pages.
  7. cd ~/public_html/drupaldam/web/sites/default; sudo chmod 0400 settings.php; sudo chown -R www-data.www-data settings.php files
  8. Done.

For drupal having “htaccess: Options not allowed here” error

Edit /etc/apache2/mods-available/userdir.conf, add Options in AllowOveride, namely,

AllowOverride FileInfo AuthConfig Limit Indexes Options

 

 

網誌存檔