使用者工具

網站工具


myservice:edserver

差異處

這裏顯示兩個版本的差異處。

連向這個比對檢視

兩邊的前次修訂版前次修改
下次修改
前次修改
myservice:edserver [2025/05/10 15:54] – [Download and unzip the WordPress] eddiemyservice:edserver [2025/11/25 05:32] (目前版本) – 移除 eddie
行 1: 行 1:
-====== Install Ubuntu 24.04 ====== 
-==== Set First User ==== 
-  - username/pasword: administrator/a784026 
-  - uid=1000, that same as OMVServer 
-==== Set IP ==== 
-  - ens192:LAN(192.168.123.0/24), ens36:WAN(192.168.2.0/24) 
-  - set LAN to static <code>$ sudo nano /etc/netplan/50-cloud-init.yaml</code> Original <code> 
-network: 
-  version: 2 
-  ethernets: 
-    ens192: 
-      dhcp4: true 
-    ens36: 
-      dhcp4: true 
-</code> New <code> 
-network: 
-  version: 2 
-  ethernets: 
-    ens192: 
-#     link-local: [ ipv4 ]  # 禁用 IPv6 
-      addresses: 
-        [192.168.123.11/24] 
-      routes: 
-        - to: default 
-        via: 192.168.123.249 
-#     metric: 100 
-      nameservers: 
-        search: [local] 
-        addresses:  [192.168.123.249, 168.95.1.1, 8.8.8.8, 8.8.4.4] 
-#     dhcp4: false 
-    ens36: 
-      dhcp4: true 
-#     link-local: [ ipv4 ]  # 禁用 IPv6 
-</code> 
-  - apply <code>$ sudo netplan apply</code> 
-==== 設定時區 ==== 
-  * Set Timezone to Asia/Taipei <code>$ sudo timedatectl set-timezone Asia/Taipei</code> 
-==== PPPoE ==== 
-  * Set PPPoE (不要 apt upgrade, 不然pppoe 會有問題?) 
-  - PPPoE package installation <code>$ sudo apt install pppoeconf</code> 
-  - Set up PPPoE connection <code>$ sudo pppoeconf</code> 
-  - 把 LAN IP gateway 取消, only ppp 對外 <code>$ sudo nano /etc/netplan/50-cloud-init.yaml</code><code> 
-network: 
-  version: 2 
-  ethernets: 
-    ens192: 
-#      link-local: 
-#        [ipv4] 
-      addresses: 
-        [192.168.123.11/24] 
-#      nameservers: 
-#        addresses: 
-#          [192.168.123.249] 
-#        search: 
-#          [] 
-#      routes: 
-#         - to: "default" 
-#           via: "192.168.123.249" 
-    ens36: 
-#      link-local: 
-#        [ipv4] 
-      addresses: 
-        [192.168.2.11/24] 
-      #dhcp4: true 
-</code> 
-==== 安裝 net tool ==== 
-  * Install net-tools (for ifconfig, router...) <code>$ sudo apt install net-tools</code> 
  
-====== Mount Raid5 NFS ====== 
-==== Mount NFS ==== 
-  - Install NFS common <code>$ apt install nfs-common</code> 
-  - List NFS Server Folder <code>$ showmount -e 192.168.123.12</code> 
-  - Mount NFS <code>$ sudo mount -t nfs 192.168.123.12:/export/Raid5 /mnt/Raid5/</code> 
-  - Check NFS <code>$ df -hT</code> 
-==== Auto Mount NFS ==== 
-  - Set NFS auto mount when system resrt <code>$ nano /etc/fstab</code><code> 
-# /etc/fstab: static file system information. 
-# 
-# Use 'blkid' to print the universally unique identifier for a 
-# device; this may be used with UUID= as a more robust way to name devices 
-# that works even if disks are added and removed. See fstab(5). 
-# 
-# <file system> <mount point>   <type>  <options>       <dump>  <pass> 
-# / was on /dev/sda2 during curtin installation 
-/dev/disk/by-uuid/b5b3be75-3c6c-4573-aeb6-3e2af16fa2ef / ext4 defaults 0 1 
-/swap.img       none    swap    sw      0       0 
-192.168.123.12:/export/Raid5    /mnt/Raid5      nfs     default 0       0 
-</code> 
- 
-====== Install Apache + PHP ====== 
-  * ref: https://mailserverguru.com/install-nextcloud-on-ubuntu-24-04-lts/ 
-==== Update and Upgrade the system ==== 
-  - Update and Upgrade the system. <code> 
-$ apt update && apt upgrade -y 
-(但怕 upgrade 後 pppoe 會有問題, 僅 update 就好) 
-$ apt update 
-</code> 
- 
-==== Install Apache2 and PHP Modules ==== 
-  - install Apache2 <code>$ apt install apache2 -y</code> 
-  - Install PHP and other Dependencies <code> 
-$ apt install php php-common libapache2-mod-php php-bz2 php-gd php-mysql \ 
-php-curl php-mbstring php-imagick php-zip php-common php-curl php-xml \ 
-php-json php-bcmath php-xml php-intl php-gmp zip unzip wget -y</code> 
-  - Enable required Apache modules <code>$ a2enmod env rewrite dir mime headers setenvif ssl</code> 
-  - Now, Restart, Enable and Check Apache is Running Properly. <code> 
-$ systemctl restart apache2 
-$ systemctl enable apache2</code> 
-  - Apache service should be in running state. <code>$ systemctl status apache2</code><code> 
-  apache2.service - The Apache HTTP Server 
-     Loaded: loaded (/usr/lib/systemd/system/apache2.service;  
-     enabled; preset: enabled) 
-     Active: active (running) since Tue 2024-06-18 04:39:09 UTC; 8s ago 
-       Docs: https://httpd.apache.org/docs/2.4/ 
-   Main PID: 16319 (apache2) 
-      Tasks: 6 (limit: 2269) 
-     Memory: 16.1M (peak: 16.3M) 
-        CPU: 97ms 
-     CGroup: /system.slice/apache2.service 
-             ├─16319 /usr/sbin/apache2 -k start 
-             ├─16326 /usr/sbin/apache2 -k start 
-</code> 
-  - Check modules are loaded on Apache (Output omitted) <code>$ apache2ctl -M</code><code> 
-Loaded Modules: 
- core_module (static) 
- so_module (static) 
- watchdog_module (static) 
- http_module (static) 
- log_config_module (static) 
-............ 
-</code> 
- 
-====== Install Database(MariaDB) ====== 
-==== Install MariaDB Server ==== 
-  - Install mariadb-server package <code>$ apt install mariadb-server -y</code> 
-  - Now, restart and enable MariaDB service. <code> 
-$ systemctl restart mariadb 
-$ systemctl enable mariadb 
-</code> 
-  - check MariaDB is Running.<code>$ systemctl status mariadb</code><code> 
-● mariadb.service - MariaDB 10.11.7 database server 
-     Loaded: loaded (/usr/lib/systemd/system/mariadb.service;  
-     enabled; preset: enabled) 
-     Active: active (running) since Tue 2024-06-18 04:43:21 UTC; 10s ago 
-       Docs: man:mariadbd(8) 
-             https://mariadb.com/kb/en/library/systemd/ 
-   Main PID: 17589 (mariadbd) 
-     Status: "Taking your SQL requests now..." 
-      Tasks: 12 (limit: 14975) 
-     Memory: 78.8M (peak: 81.8M) 
-        CPU: 573ms 
-     CGroup: /system.slice/mariadb.service 
-             └─17589 /usr/sbin/mariadbd 
-</code> 
-==== Configure MariaDB Server ==== 
-  * [MariaDB 允許外部連線的設定] \\ 不管是 MariaDB 還是 Mysql ,安裝好後都是只允許從 localhost連進資料庫,如果要從遠端連線的話需要修改一些設定和權限。 
-  - 修改設定檔 \\ MariaDB的設定檔預設是 <code>/etc/mysql/mariadb.conf.d/50-server.cnf</code> 進入檔案後看到 <code>bind-address = 127.0.0.1</code> 在這行前加入 # 註解掉。 
-  - 給予使用者外部連線的權限 \\ 先連入 mariaDB <code>mysql -uroot -p</code> 之後輸入 <code>grant privileges on *.* to 'root'@'%' identified by 'yourpassword';</code> 記得把 root 改成自己的使用者名稱,yourpassword改成自己設的密碼 \\ 再輸入 <code>flush privileges; </code>更新新的權限。\\ 做完這些之後,可能還不會立即生效,即使用 <code>service mysql restart</code> 也不會立即套用新的設定。\\ 機器必須重啟過後才能套用新設定 <code>sudo reboot</code> 
- 
-==== 將 Mysql 移至 Fileserver ==== 
-  * 以下請以 root 權限下執行 
-  - 建立新的mysql資料夾<code> 
-$ cd /mnt/Raid5/Service2/ 
-$ mkdir MySQL_10.11.11-MariaDB 
-</code> 
-  - 更改權限<code> 
-$ chown mysql:mysql MySQL_10.11.11-MariaDB 
-</code> 
-  - 關閉 mysql 服務<code> 
-$ systemctl stop mysqld 
-</code> 
-  - 更改 mysql 位置<code> 
-$ cd /var/lib/ 
-$ mv mysql mysql_backup 
-$ ln -s /mnt/Raid5/Service2/MySQL_10.11.11-MariaDB mysql 
-$ mv mysql_backup/* mysql/ 
-$ rm -rf mysql_backup/ 
-</code> 
-  - 啟動 mysql<code> 
-$ systemctl start mysqld 
-</code> 
-  - 測試 mysql<code> 
-$ systemctl status mysqld 
-</code> 
- 
-====== Install NextCloud ====== 
-https://mailserverguru.com/install-nextcloud-on-ubuntu-24-04-lts/ 
-==== Create Directory for Nextcloud ==== 
-  * from /usr/local create a Symbolic link for Nextcloud<code> 
-$ cd /usr/local/ 
-$ ln -s /mnt/Raid5/Service2 Service2 
-</code> 
- 
-==== Download Nextcloud ==== 
-  - Download Nextcloud with latest version<code> 
-$ cd /usr/local/Server2/ 
-$ wget https://download.nextcloud.com/server/releases/latest.zip 
-</code> 
-  - Unzip <code>$ unzip latest.zip</code> 
-  - Remove the zip file, which is not necessary now. <code>$ rm -rf latest.zip</code> 
-  - Change the ownership of the nextcloud directory to the HTTP user. <code>$ chown -R www-data:www-data /usr/local/Server2/nextcloud/</code> 
- 
-==== Set Apache Virtual Host ==== 
-  - Confirm Apache is installed <code>$ systemctl status apache2</code> 
-  - Create a directory structure.\\ Create a directory structure for your websites. In this example, we’ll set up directories for cloud.lang.idv.tw<code> 
-$ mkdir -p /usr/local/Server2/nextcloud 
-</code> 
-  - Create Virtual Configuration\\ Create a new virtual host configuration file for cloud.lang.idv.tw:<code> 
-$ vi /etc/apache2/sites-available/cloud.lang.idv.tw.conf 
-</code>Add the following content to the file;<code> 
-<VirtualHost *:80> 
-    ServerAdmin eddie@lang.idv.tw 
-    ServerName cloud.lang.idv.tw 
-    #ServerAlias box.lang.idv.tw 
-    DocumentRoot /usr/local/Server2/nextcloud 
- 
-    <Directory /usr/local/Server2/nextcloud> 
-        Options Indexes FollowSymLinks 
-        AllowOverride All 
-        Require all granted 
-    </Directory> 
- 
-    ErrorLog ${APACHE_LOG_DIR}/cloud.lang.idv.tw_error.log 
-    CustomLog ${APACHE_LOG_DIR}/cloud.lang.idv.tw_access.log combined 
-</VirtualHost> 
-</code> 
-  - Enable the Virtual Host\\ Enable the new virtual host with the following command:<code> 
-$ a2ensite cloud.lang.idv.tw.conf</code> 
-  - Test the Configuration\\ Check the configuration for syntax errors:<code> 
-$ apache2ctl configtest</code> 
-  - Restart\\ Restart Apache to apply the changes:<code> 
-$ systemctl restart apache2</code> 
-  - **訪問 FollowSymLinks 須要把目錄加上 執行權限, 包含上層目錄**<code> 
-$ chmod o+x /usr/local/Server2/nextcloud 
-$ chmod o+x /usr/local/Server2 
-</code> 
-  
-==== Create Database ==== 
-  - Create Database and User for Nextcloud and Provide User Permissions. <code> $ mysql</code><code> 
-CREATE USER 'nextcloud'@'localhost' IDENTIFIED BY 'nextcloud'; 
-CREATE DATABASE nextcloud CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci; 
-GRANT ALL PRIVILEGES ON nextcloud.* TO 'nextcloud'@'localhost'; 
-FLUSH PRIVILEGES; 
-quit; 
-</code> 
- 
-==== Install Nextcloud ==== 
-  - Install Nextcloud\\You can install Nextcloud via the web GUI or command line, and you can choose your preferred method.\\  * Used web GUI to install<code> 
-http://[hostname]/install.php)</code>  * Run the below command to install nextcloud (provide your own credentials)<code> 
-$ cd /usr/local/Server2/nextcloud 
-$ sudo -u www-data php occ  maintenance:install --database \ 
- "mysql" --database-name "nextcloud"  --database-user "nextcloud" --database-pass \ 
- 'nextcloud' --admin-user "admin" --admin-pass "a784026"</code> If everything goes well the command will output “Nextcloud was successfully installed”. 
-  - Add access domain\\ Nextcloud allows access only from localhost, it could through error “Access through untrusted domain”. we need to allow accessing Nextcloud by using ip or domain name.<code>$ vi /usr/local/Server2/nextcloud/config/config.php</code><code> 
-  'trusted_domains' => 
-  array ( 
-    0 => 'localhost', 
-    1 => 'cloud.lang.idv.tw',   // we Included the Sub Domain 
-  ), 
-  ..... 
-:x 
-</code> 
-==== Nextcloud的一些錯誤提示 ==== 
-ref: https://www.cnblogs.com/Athenavi/p/17168460.html 
-  - PHP 內存限制低於建議值 512MB\\ 您可以通過以下步驟增加PHP內存限制:\\ 打開php.ini文件 在終端中輸入以下命令打開php.ini文件:<code>$ sudo nano /etc/php/<version>/apache2/php.ini</code> 更改內存限制\\ 使用Ctrl+W搜索memory_limit。找到並更改下面一行中的內存限制值:<code>memory_limit = 512M</code> 將值更改為建議的內存限制,如1G或2G:<code>memory_limit = 1G</code> 保存並關閉文件\\ 使用Ctrl+O保存更改,然後使用Ctrl+X退出nano。  
-  - 重啟Apache服務器\\ 在終端中輸入以下命令以重啟Apache服務器:<code>$ sudo systemctl restart apache2</code> 現在,您的PHP內存限制已更改為建議值。 
- 
-====== Install DokuWiki ====== 
- 
-==== Update Your System ==== 
-  * Open your terminal and run:<code> 
-$ sudo apt update && sudo apt upgrade -y</code> 
- 
-==== Install Required Packages ==== 
-  * Install Apache, PHP, and other necessary packages:\\ maybe these have installed, but you also can install again<code> 
-$ sudo apt install apache2 php php-xml libapache2-mod-php unzip -y</code> 
- 
-==== Download DokuWiki ==== 
-  * Navigate to the web directory and download the latest DokuWiki version:<code> 
-$ cd /usr/local/Service2 
-$ sudo wget https://download.dokuwiki.org/src/dokuwiki/dokuwiki-stable.tgz 
-</code> 
- 
-==== Extract DokuWiki ==== 
-  * Extract the downloaded file and rename the directory:<code> 
-$ sudo tar xvf dokuwiki-stable.tgz 
-$ sudo ln -s dokuwiki-*/ dokuwiki 
-</code> 
- 
-==== Set Permissions ==== 
-  * Adjust permissions for the DokuWiki directory:<code> 
-$ sudo chown -R www-data:www-data /usr/local/Service2/dokuwiki 
-$ sudo chmod -R 755 /usr/local/Service2/dokuwiki 
-</code> 
- 
-==== Configure Apache ==== 
-  * Create a new Apache configuration file:<code> 
-$ sudo nano /etc/apache2/sites-available/wiki.lang.idv.tw.conf</code> 
-  * Add the following content:<code> 
-<VirtualHost *:80> 
-    ServerAdmin eddie@lang.idv.tw 
-    ServerName wiki.lang.idv.tw 
-    #ServerAlias box.lang.idv.tw 
-    DocumentRoot /usr/local/Service2/dokuwiki 
- 
-    <Directory /usr/local/Service2/dokuwiki> 
-        Options Indexes FollowSymLinks 
-        AllowOverride All 
-        Require all granted 
-    </Directory> 
- 
-    ErrorLog ${APACHE_LOG_DIR}/wiki.lang.idv.tw_error.log 
-    CustomLog ${APACHE_LOG_DIR}/wiki.lang.idv.tw_access.log combined 
-</VirtualHost> 
-</code> 
-  * Save and exit. 
- 
-==== Enable the Site and Rewrite Module ==== 
-  * Enable the new site and the rewrite module:<code> 
-$ sudo a2ensite wiki.lang.idv.tw.conf 
-$ sudo a2enmod rewrite 
-$ sudo systemctl restart apache2 
-</code> 
- 
-==== Complete Installation in Browser ==== 
-  * Open your browser and navigate to <code>http://wiki.lang.idv.tw/install.php</code> 
-  * Follow the on-screen instructions to complete the setup. 
- 
-==== Secure Your Installation ==== 
-  * After installation, remove the install.php file:<code> 
-$ sudo rm /var/www/html/dokuwiki/install.php</code> 
-  * DokuWiki is now installed and ready to use on your Ubuntu 24.04 LTS system. 
- 
-====== Install Wordpress for Pingtek ====== 
-==== Download and unzip the WordPress ==== 
-  - Download Nextcloud with latest version<code> 
-$ cd /usr/local/Server2/ 
-$ wget https://wordpress.org/latest.tar.gz 
-</code> 
-  - Rename latest.tar.gz to wordpress-6.8.1.tar.gz\\ please reference https://tw.wordpress.org/download/ that will show the download version<code> 
-$ mv latest.tar.gz wordpress-6.8.1.tar.gz 
-</code> 
-  - extract the package\\ The WordPress package will extract into a folder called wordpress in the same directory<code> 
-$ tar -xzvf wordpress-6.8.1.tar.gz 
-</code> 
-  - Rename directory to wordpress_Pingtek<code> 
-$ mv wordpress wordpress_Pingtek 
-</code> 
-  - Change the ownership of the wordpress_Pingtek directory to the HTTP user<code> 
-$ chown -R www-data:www-data wordpress_Pingtek/ 
-</code> 
- 
-==== Create Database ==== 
-  - Create Database and User for Wordpress_Pingtek and Provide User Permissions. <code> $ mysql</code><code> 
-CREATE USER 'wordpress_pingtek'@'localhost' IDENTIFIED BY 'wordpress_pingtek'; 
-CREATE DATABASE wordpress_pingtek CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci; 
-GRANT ALL PRIVILEGES ON wordpress_pingtek.* TO 'wordpress_pingtek'@'localhost'; 
-FLUSH PRIVILEGES; 
-quit; 
-</code> 
myservice/edserver.1746892493.txt.gz · 上一次變更: 由 eddie

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki