myservice:edserver
差異處
這裏顯示兩個版本的差異處。
| 兩邊的前次修訂版前次修改 下次修改 | 前次修改 | ||
| myservice:edserver [2025/05/11 02:22] – [Set Apache Virtual Host] eddie | myservice:edserver [2025/11/25 05:32] (目前版本) – 移除 eddie | ||
|---|---|---|---|
| 行 1: | 行 1: | ||
| - | ====== Install Ubuntu 24.04 ====== | ||
| - | ==== Set First User ==== | ||
| - | - username/ | ||
| - | - uid=1000, that same as OMVServer | ||
| - | ==== Set IP ==== | ||
| - | - ens192: | ||
| - | - set LAN to static < | ||
| - | network: | ||
| - | version: 2 | ||
| - | ethernets: | ||
| - | ens192: | ||
| - | dhcp4: true | ||
| - | ens36: | ||
| - | dhcp4: true | ||
| - | </ | ||
| - | network: | ||
| - | version: 2 | ||
| - | ethernets: | ||
| - | ens192: | ||
| - | # | ||
| - | addresses: | ||
| - | [192.168.123.11/ | ||
| - | routes: | ||
| - | - to: default | ||
| - | via: 192.168.123.249 | ||
| - | # | ||
| - | nameservers: | ||
| - | search: [local] | ||
| - | addresses: | ||
| - | # | ||
| - | ens36: | ||
| - | dhcp4: true | ||
| - | # | ||
| - | </ | ||
| - | - apply < | ||
| - | ==== 設定時區 ==== | ||
| - | * Set Timezone to Asia/Taipei < | ||
| - | ==== PPPoE ==== | ||
| - | * Set PPPoE (不要 apt upgrade, 不然pppoe 會有問題? | ||
| - | - PPPoE package installation < | ||
| - | - Set up PPPoE connection < | ||
| - | - 把 LAN IP gateway 取消, only ppp 對外 < | ||
| - | network: | ||
| - | version: 2 | ||
| - | ethernets: | ||
| - | ens192: | ||
| - | # link-local: | ||
| - | # [ipv4] | ||
| - | addresses: | ||
| - | [192.168.123.11/ | ||
| - | # nameservers: | ||
| - | # addresses: | ||
| - | # [192.168.123.249] | ||
| - | # search: | ||
| - | # [] | ||
| - | # routes: | ||
| - | # - to: " | ||
| - | # via: " | ||
| - | ens36: | ||
| - | # link-local: | ||
| - | # [ipv4] | ||
| - | addresses: | ||
| - | [192.168.2.11/ | ||
| - | #dhcp4: true | ||
| - | </ | ||
| - | ==== 安裝 net tool ==== | ||
| - | * Install net-tools (for ifconfig, router...) < | ||
| - | ====== Mount Raid5 NFS ====== | ||
| - | ==== Mount NFS ==== | ||
| - | - Install NFS common < | ||
| - | - List NFS Server Folder < | ||
| - | - Mount NFS < | ||
| - | - Check NFS < | ||
| - | ==== Auto Mount NFS ==== | ||
| - | - Set NFS auto mount when system resrt < | ||
| - | # /etc/fstab: static file system information. | ||
| - | # | ||
| - | # Use ' | ||
| - | # 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> | ||
| - | # / was on /dev/sda2 during curtin installation | ||
| - | / | ||
| - | / | ||
| - | 192.168.123.12:/ | ||
| - | </ | ||
| - | |||
| - | ====== Install Apache + PHP ====== | ||
| - | * ref: https:// | ||
| - | ==== Update and Upgrade the system ==== | ||
| - | - Update and Upgrade the system. < | ||
| - | $ apt update && apt upgrade -y | ||
| - | (但怕 upgrade 後 pppoe 會有問題, | ||
| - | $ apt update | ||
| - | </ | ||
| - | |||
| - | ==== Install Apache2 and PHP Modules ==== | ||
| - | - install Apache2 < | ||
| - | - Install PHP and other Dependencies < | ||
| - | $ 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</ | ||
| - | - Enable required Apache modules < | ||
| - | - Now, Restart, Enable and Check Apache is Running Properly. < | ||
| - | $ systemctl restart apache2 | ||
| - | $ systemctl enable apache2</ | ||
| - | - Apache service should be in running state. < | ||
| - | apache2.service - The Apache HTTP Server | ||
| - | | ||
| - | | ||
| - | | ||
| - | Docs: https:// | ||
| - | Main PID: 16319 (apache2) | ||
| - | Tasks: 6 (limit: 2269) | ||
| - | | ||
| - | CPU: 97ms | ||
| - | | ||
| - | | ||
| - | | ||
| - | </ | ||
| - | - Check modules are loaded on Apache (Output omitted) < | ||
| - | Loaded Modules: | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | ............ | ||
| - | </ | ||
| - | |||
| - | ====== Install Database(MariaDB) ====== | ||
| - | ==== Install MariaDB Server ==== | ||
| - | - Install mariadb-server package < | ||
| - | - Now, restart and enable MariaDB service. < | ||
| - | $ systemctl restart mariadb | ||
| - | $ systemctl enable mariadb | ||
| - | </ | ||
| - | - check MariaDB is Running.< | ||
| - | ● mariadb.service - MariaDB 10.11.7 database server | ||
| - | | ||
| - | | ||
| - | | ||
| - | Docs: man: | ||
| - | | ||
| - | Main PID: 17589 (mariadbd) | ||
| - | | ||
| - | Tasks: 12 (limit: 14975) | ||
| - | | ||
| - | CPU: 573ms | ||
| - | | ||
| - | | ||
| - | </ | ||
| - | ==== Configure MariaDB Server ==== | ||
| - | * [MariaDB 允許外部連線的設定] \\ 不管是 MariaDB 還是 Mysql ,安裝好後都是只允許從 localhost連進資料庫,如果要從遠端連線的話需要修改一些設定和權限。 | ||
| - | - 修改設定檔 \\ MariaDB的設定檔預設是 < | ||
| - | - 給予使用者外部連線的權限 \\ 先連入 mariaDB < | ||
| - | |||
| - | ==== 將 Mysql 移至 Fileserver ==== | ||
| - | * 以下請以 root 權限下執行 | ||
| - | - 建立新的mysql資料夾< | ||
| - | $ cd / | ||
| - | $ mkdir MySQL_10.11.11-MariaDB | ||
| - | </ | ||
| - | - 更改權限< | ||
| - | $ chown mysql:mysql MySQL_10.11.11-MariaDB | ||
| - | </ | ||
| - | - 關閉 mysql 服務< | ||
| - | $ systemctl stop mysqld | ||
| - | </ | ||
| - | - 更改 mysql 位置< | ||
| - | $ cd /var/lib/ | ||
| - | $ mv mysql mysql_backup | ||
| - | $ ln -s / | ||
| - | $ mv mysql_backup/ | ||
| - | $ rm -rf mysql_backup/ | ||
| - | </ | ||
| - | - 啟動 mysql< | ||
| - | $ systemctl start mysqld | ||
| - | </ | ||
| - | - 測試 mysql< | ||
| - | $ systemctl status mysqld | ||
| - | </ | ||
| - | |||
| - | ====== Install NextCloud ====== | ||
| - | https:// | ||
| - | ==== Create Directory for Nextcloud ==== | ||
| - | * from /usr/local create a Symbolic link for Nextcloud< | ||
| - | $ cd /usr/local/ | ||
| - | $ ln -s / | ||
| - | </ | ||
| - | |||
| - | ==== Download Nextcloud ==== | ||
| - | - Download Nextcloud with latest version< | ||
| - | $ cd / | ||
| - | $ wget https:// | ||
| - | </ | ||
| - | - Unzip < | ||
| - | - Remove the zip file, which is not necessary now. < | ||
| - | - Change the ownership of the nextcloud directory to the HTTP user. < | ||
| - | |||
| - | ==== Set Apache Virtual Host ==== | ||
| - | - Confirm Apache is installed < | ||
| - | - Create a directory structure.\\ Create a directory structure for your websites. In this example, we’ll set up directories for cloud.lang.idv.tw< | ||
| - | $ mkdir -p / | ||
| - | </ | ||
| - | - Create Virtual Configuration\\ Create a new virtual host configuration file for cloud.lang.idv.tw:< | ||
| - | $ vi / | ||
| - | </ | ||
| - | < | ||
| - | ServerAdmin eddie@lang.idv.tw | ||
| - | ServerName cloud.lang.idv.tw | ||
| - | # | ||
| - | DocumentRoot / | ||
| - | |||
| - | < | ||
| - | Options Indexes FollowSymLinks | ||
| - | AllowOverride All | ||
| - | Require all granted | ||
| - | </ | ||
| - | |||
| - | ErrorLog ${APACHE_LOG_DIR}/ | ||
| - | CustomLog ${APACHE_LOG_DIR}/ | ||
| - | </ | ||
| - | </ | ||
| - | - Enable the Virtual Host\\ Enable the new virtual host with the following command:< | ||
| - | $ a2ensite cloud.lang.idv.tw.conf</ | ||
| - | - Test the Configuration\\ Check the configuration for syntax errors:< | ||
| - | $ apache2ctl configtest</ | ||
| - | - Restart\\ Restart Apache to apply the changes:< | ||
| - | $ systemctl restart apache2</ | ||
| - | - **訪問 FollowSymLinks 須要把目錄加上 執行權限, | ||
| - | $ chmod o+x / | ||
| - | $ chmod o+x / | ||
| - | </ | ||
| - | |||
| - | ==== Create Database ==== | ||
| - | - Create Database and User for Nextcloud and Provide User Permissions. < | ||
| - | CREATE USER ' | ||
| - | CREATE DATABASE nextcloud CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci; | ||
| - | GRANT ALL PRIVILEGES ON nextcloud.* TO ' | ||
| - | FLUSH PRIVILEGES; | ||
| - | quit; | ||
| - | </ | ||
| - | |||
| - | ==== Install Nextcloud ==== | ||
| - | - Install Nextcloud\\You can install Nextcloud via the web GUI or command line, and you can choose your preferred method.\\ | ||
| - | http:// | ||
| - | $ cd / | ||
| - | $ sudo -u www-data php occ maintenance: | ||
| - | " | ||
| - | ' | ||
| - | - 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.< | ||
| - | ' | ||
| - | array ( | ||
| - | 0 => ' | ||
| - | 1 => ' | ||
| - | ), | ||
| - | ..... | ||
| - | :x | ||
| - | </ | ||
| - | ==== Nextcloud的一些錯誤提示 ==== | ||
| - | ref: https:// | ||
| - | - PHP 內存限制低於建議值 512MB\\ 您可以通過以下步驟增加PHP內存限制:\\ 打開php.ini文件 在終端中輸入以下命令打開php.ini文件:< | ||
| - | - 重啟Apache服務器\\ 在終端中輸入以下命令以重啟Apache服務器:< | ||
| - | |||
| - | ====== Install DokuWiki ====== | ||
| - | |||
| - | ==== Update Your System ==== | ||
| - | * Open your terminal and run:< | ||
| - | $ sudo apt update && sudo apt upgrade -y</ | ||
| - | |||
| - | ==== Install Required Packages ==== | ||
| - | * Install Apache, PHP, and other necessary packages:\\ maybe these have installed, but you also can install again< | ||
| - | $ sudo apt install apache2 php php-xml libapache2-mod-php unzip -y</ | ||
| - | |||
| - | ==== Download DokuWiki ==== | ||
| - | * Navigate to the web directory and download the latest DokuWiki version:< | ||
| - | $ cd / | ||
| - | $ sudo wget https:// | ||
| - | </ | ||
| - | |||
| - | ==== Extract DokuWiki ==== | ||
| - | * Extract the downloaded file and rename the directory:< | ||
| - | $ sudo tar xvf dokuwiki-stable.tgz | ||
| - | $ sudo ln -s dokuwiki-*/ dokuwiki | ||
| - | </ | ||
| - | |||
| - | ==== Set Permissions ==== | ||
| - | * Adjust permissions for the DokuWiki directory:< | ||
| - | $ sudo chown -R www-data: | ||
| - | $ sudo chmod -R 755 / | ||
| - | </ | ||
| - | |||
| - | ==== Configure Apache ==== | ||
| - | * Create a new Apache configuration file:< | ||
| - | $ sudo nano / | ||
| - | * Add the following content:< | ||
| - | < | ||
| - | ServerAdmin eddie@lang.idv.tw | ||
| - | ServerName wiki.lang.idv.tw | ||
| - | # | ||
| - | DocumentRoot / | ||
| - | |||
| - | < | ||
| - | Options Indexes FollowSymLinks | ||
| - | AllowOverride All | ||
| - | Require all granted | ||
| - | </ | ||
| - | |||
| - | ErrorLog ${APACHE_LOG_DIR}/ | ||
| - | CustomLog ${APACHE_LOG_DIR}/ | ||
| - | </ | ||
| - | </ | ||
| - | * Save and exit. | ||
| - | |||
| - | ==== Enable the Site and Rewrite Module ==== | ||
| - | * Enable the new site and the rewrite module:< | ||
| - | $ sudo a2ensite wiki.lang.idv.tw.conf | ||
| - | $ sudo a2enmod rewrite | ||
| - | $ sudo systemctl restart apache2 | ||
| - | </ | ||
| - | |||
| - | ==== Complete Installation in Browser ==== | ||
| - | * Open your browser and navigate to < | ||
| - | * Follow the on-screen instructions to complete the setup. | ||
| - | |||
| - | ==== Secure Your Installation ==== | ||
| - | * After installation, | ||
| - | $ sudo rm / | ||
| - | * 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< | ||
| - | $ cd / | ||
| - | $ wget https:// | ||
| - | </ | ||
| - | - Rename latest.tar.gz to wordpress-6.8.1.tar.gz\\ please reference https:// | ||
| - | $ mv latest.tar.gz wordpress-6.8.1.tar.gz | ||
| - | </ | ||
| - | - extract the package\\ The WordPress package will extract into a folder called wordpress in the same directory< | ||
| - | $ tar -xzvf wordpress-6.8.1.tar.gz | ||
| - | </ | ||
| - | - Rename directory to wordpress_Pingtek< | ||
| - | $ mv wordpress wordpress_Pingtek | ||
| - | </ | ||
| - | - Change the ownership of the wordpress_Pingtek directory to the HTTP user< | ||
| - | $ chown -R www-data: | ||
| - | </ | ||
| - | |||
| - | ==== Create Database ==== | ||
| - | - Create Database and User for Wordpress_Pingtek and Provide User Permissions. < | ||
| - | CREATE USER ' | ||
| - | CREATE DATABASE wordpress_pingtek CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci; | ||
| - | GRANT ALL PRIVILEGES ON wordpress_pingtek.* TO ' | ||
| - | FLUSH PRIVILEGES; | ||
| - | quit; | ||
| - | </ | ||
| - | |||
| - | |||
| - | ==== Set Apache Virtual Host ==== | ||
| - | - Confirm Apache is installed < | ||
| - | - Create a directory structure.\\ Create a directory structure for your websites. In this example, we’ll set up directories for pingtek.com.tw< | ||
| - | $ mkdir -p / | ||
| - | </ | ||
| - | - Create Virtual Configuration\\ Create a new virtual host configuration file for pingtek.com.tw:< | ||
| - | $ vi / | ||
| - | </ | ||
| - | < | ||
| - | ServerAdmin eddie@lang.idv.tw | ||
| - | ServerName pingtek.com.tw | ||
| - | ServerAlias www.pingtek.com.tw | ||
| - | DocumentRoot / | ||
| - | |||
| - | < | ||
| - | Options Indexes FollowSymLinks | ||
| - | AllowOverride All | ||
| - | Require all granted | ||
| - | </ | ||
| - | |||
| - | ErrorLog ${APACHE_LOG_DIR}/ | ||
| - | CustomLog ${APACHE_LOG_DIR}/ | ||
| - | </ | ||
| - | </ | ||
| - | - Enable the Virtual Host\\ Enable the new virtual host with the following command:< | ||
| - | $ a2ensite pingtek.com.tw.conf</ | ||
| - | - Test the Configuration\\ Check the configuration for syntax errors:< | ||
| - | $ apache2ctl configtest</ | ||
| - | - Restart\\ Restart Apache to apply the changes:< | ||
| - | $ systemctl restart apache2</ | ||
| - | - **訪問 FollowSymLinks 須要把目錄加上 執行權限, | ||
| - | $ chmod o+x / | ||
| - | $ chmod o+x / | ||
| - | </ | ||
| - | |||
| - | ==== Setup Wordpress ==== | ||
| - | - Setup Wordpress by Web GUI< | ||
| - | $ http:// | ||
| - | </ | ||
| - | - 依畫面完成設定 | ||
| - | {{ : | ||
| - | |||
| - | |||
| - | |||
| - | create wordpress | ||
| - | |||
| - | install All-in-One WP Migration | ||
| - | |||
| - | import | ||
| - | |||
| - | install UpdraftPlus | ||
| - | |||
| - | set php\\ https:// | ||
myservice/edserver.1746930170.txt.gz · 上一次變更: 由 eddie
