{"id":897,"date":"2023-05-22T21:35:10","date_gmt":"2023-05-22T13:35:10","guid":{"rendered":"http:\/\/192.168.0.100\/?p=897"},"modified":"2023-12-31T20:58:31","modified_gmt":"2023-12-31T12:58:31","slug":"virtualbox-ubuntu-server-ubuntu-desktop-%e5%ae%89%e8%a3%9d%e7%b4%80%e9%8c%84","status":"publish","type":"post","link":"https:\/\/cwchin.no-ip.com\/?p=897","title":{"rendered":"VirtualBox , Ubuntu server + Ubuntu desktop \u5b89\u88dd\u7d00\u9304"},"content":{"rendered":"<p>VirtualBox , Ubuntu server + Ubuntu desktop \u5b89\u88dd\u7d00\u9304<\/p>\n<div class=\"separator\"><b><a href=\"wp-content\/uploads\/2023\/07\/Screenshot 2023-07-10-2.jpg\"><img decoding=\"async\" src=\"wp-content\/uploads\/2023\/07\/Screenshot 2023-07-10-2.jpg\" border=\"0\" \/><\/a><\/b><\/div>\n<p>1) VirtualBox (\u6211\u7684\u4e3b\u6a5f\u662fWin11)<br \/>\nVirtualBox 7.0.8 Windows hosts ISO: <a href=\"https:\/\/www.virtualbox.org\/wiki\/Downloads\">https:\/\/www.virtualbox.org\/wiki\/Downloads<\/a><\/p>\n<p>1.1) install VirtualBox 7.0.8 Oracle VM VirtualBox Extension Pack<br \/>\n<a href=\"https:\/\/askubuntu.com\/questions\/282018\/wifi-card-on-ubuntu-in-virtualbox-no-wireless-extensions\">https:\/\/askubuntu.com\/questions\/282018\/wifi-card-on-ubuntu-in-virtualbox-no-wireless-extensions<\/a><\/p>\n<div>1.2) install guest addition in ubuntu client:<\/div>\n<div><a href=\"https:\/\/www.blogger.com\/blog\/post\/edit\/5113711716586468024\/3545408156716445542#\" data-original-attrs=\"{&quot;data-original-href&quot;:&quot;https:\/\/www.itzgeek.com\/how-tos\/linux\/ubuntu-how-tos\/how-to-install-virtualbox-guest-additions-on-ubuntu-22-04.html&quot;}\">https:\/\/www.itzgeek.com\/how-tos\/linux\/ubuntu-how-tos\/how-to-install-virtualbox-guest-additions-on-ubuntu-22-04.html<\/a><\/div>\n<div><\/div>\n<div>check guest addition is installed ok:<\/div>\n<div><span style=\"background-color: #3366ff; color: #ffffff;\">$ lsmod | grep vboxguest<\/span><\/div>\n<div><span style=\"background-color: #3366ff; color: #ffffff;\">vboxguest\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0434176\u00a0 7 vboxsf<\/span><\/div>\n<p>Win11 \u7528 ipconfig check wifi IP &#8211; 192.168.x.xxx (e.g. change to 192.168.x.x as static IP), set up wifi as bridge adapter (\u7db2\u8def\u8a2d\u5b9a\u6210\u6a4b\u63a5\u4ecb\u9762\u5361)<\/p>\n<p>2) VirtualBox \u5efa\u7acb\u65b0\u7684 Ubuntu Server \u6559\u5b78:<br \/>\n<a href=\"https:\/\/ubuntu.com\/download\/server\">https:\/\/ubuntu.com\/download\/server<\/a> (now is 22.04.2 LTS)<br \/>\n<a href=\"https:\/\/footmark.com.tw\/news\/linux\/ubuntu\/ubuntu-server-install\/\">https:\/\/footmark.com.tw\/news\/linux\/ubuntu\/ubuntu-server-install\/<\/a><\/p>\n<p>\u624b\u52d5\u8a2d\u5b9a\u56fa\u5b9a IP:<br \/>\n<span style=\"background-color: #3366ff; color: #ffffff;\">sudo netplan generate<\/span><br \/>\n<span style=\"background-color: #3366ff; color: #ffffff;\">sudo pico \/etc\/netplan\/00-installer-config.yaml <\/span>(\u66f4\u6539\u6210 fix ip)<\/p>\n<div><span style=\"background-color: #3366ff; color: #ffffff;\">network:<\/span><\/div>\n<div><span style=\"background-color: #3366ff; color: #ffffff;\">\u00a0 version: 2<\/span><\/div>\n<div><span style=\"background-color: #3366ff; color: #ffffff;\">\u00a0 renderer: networkd<\/span><\/div>\n<div><span style=\"background-color: #3366ff; color: #ffffff;\">\u00a0 ethernets:<\/span><\/div>\n<div><span style=\"background-color: #3366ff; color: #ffffff;\">\u00a0 \u00a0 enp0s3:<\/span><\/div>\n<div><span style=\"background-color: #3366ff; color: #ffffff;\">\u00a0 \u00a0 \u00a0 dhcp4: no<\/span><\/div>\n<div><span style=\"background-color: #3366ff; color: #ffffff;\">\u00a0 \u00a0 \u00a0 gateway4: 192.168.0.1<\/span><\/div>\n<div><span style=\"background-color: #3366ff; color: #ffffff;\">\u00a0 \u00a0 \u00a0 addresses: [192.168.x.x\/24]<\/span><\/div>\n<div><span style=\"background-color: #3366ff; color: #ffffff;\">\u00a0 \u00a0 \u00a0 nameservers:<\/span><\/div>\n<div><span style=\"background-color: #3366ff; color: #ffffff;\">\u00a0 \u00a0 \u00a0 \u00a0 addresses: [8.8.8.8,8.8.4.4]<\/span><\/div>\n<p>Windows 11 \u56fa\u5b9aIP\u8a2d\u5b9a\u65b9\u5f0f<br \/>\n<a href=\"https:\/\/chenmama.neocities.org\/IP\/11\">https:\/\/chenmama.neocities.org\/IP\/11<\/a><\/p>\n<p>\u5bb6\u4e2dRouter \u8a2d\u5b9a DDNS (\u6211\u7531\u7d04 2000\u5e74\u5df2\u4f7f\u7528 <a href=\"http:\/\/www.noip.com\">noip.com<\/a> &#8230;)<br \/>\n<a href=\"https:\/\/www.tp-link.com\/tw\/support\/faq\/297\/\">https:\/\/www.tp-link.com\/tw\/support\/faq\/297\/<\/a><\/p>\n<p>2.1) after ubuntu server setup:<br \/>\n<span style=\"background-color: #3366ff; color: #ffffff;\">sudo apt update &amp;&amp; sudo apt upgrade -y<\/span><br \/>\n<span style=\"background-color: #3366ff; color: #ffffff;\">timedatectl set-timezone Asia\/Taipei<\/span><br \/>\n<span style=\"background-color: #3366ff; color: #ffffff;\">hostnamectl set-hostname xxx.no-ip.com<\/span><\/p>\n<p><span style=\"background-color: #3366ff; color: #ffffff;\">sudo apt install cockpit<\/span><br \/>\n<span style=\"background-color: #3366ff; color: #ffffff;\">sudo systemctl enable &#8211;now cockpit.socket<\/span><br \/>\n<span style=\"background-color: #3366ff; color: #ffffff;\">sudo systemctl status cockpit.socket<\/span><\/p>\n<p>Access cockpit thru:<br \/>\nhttps:\/\/192.168.x.x:9090\/<\/p>\n<p><span style=\"background-color: #3366ff; color: #ffffff;\">ping -c 5 www.google.com<\/span><br \/>\n<span style=\"background-color: #3366ff; color: #ffffff;\">ifconfig<\/span><br \/>\n<span style=\"background-color: #3366ff; color: #ffffff;\">ip a<\/span><br \/>\n<span style=\"background-color: #3366ff; color: #ffffff;\">sudo service ssh status<\/span><\/p>\n<p>2.2) \u5b89\u88ddLAMP Server and phpmyadmin<br \/>\n<a href=\"https:\/\/www.chirue.com\/ubuntu-wordpress-web\/\">https:\/\/www.chirue.com\/ubuntu-wordpress-web\/<\/a><br \/>\n<span style=\"background-color: #3366ff; color: #ffffff;\">sudo apt purge phpmyadmin<\/span><br \/>\n<span style=\"background-color: #3366ff; color: #ffffff;\">sudo apt install phpmyadmin<\/span><br \/>\n<span style=\"background-color: #3366ff; color: #ffffff;\">sudo service apache2 restart<\/span><\/p>\n<p>2.3) install ubuntu desktop on ubuntu server<br \/>\n<span style=\"background-color: #3366ff; color: #ffffff;\">sudo apt install ubuntu-desktop<\/span><br \/>\n<span style=\"background-color: #3366ff; color: #ffffff;\">sudo apt install lightdm<\/span><br \/>\nInstall google browser<br \/>\n<span style=\"color: #ffffff; background-color: #3366ff;\">sudo dpkg -i google-chrome-stable_current_amd64.deb<\/span><\/p>\n<p>3)\u5efa\u7acbwordpress<br \/>\n<a href=\"https:\/\/www.chirue.com\/ubuntu-wordpress-web\/\">https:\/\/www.chirue.com\/ubuntu-wordpress-web\/<\/a><br \/>\nwp-config.php \u8a2d\u7f6e : <a href=\"https:\/\/developer.wordpress.org\/apis\/wp-config-php\/\">https:\/\/developer.wordpress.org\/apis\/wp-config-php\/<\/a><\/p>\n<p>Google Blogger\u90e8\u843d\u683c\u6587\u7ae0\u642c\u5bb6\u5230WordPress:<br \/>\n<a href=\"https:\/\/rogerli.xyz\/2018\/09\/%E7%B5%82%E6%96%BC%E6%B1%BA%E5%BF%83%E5%BE%9Eblogger%E8%BD%89%E7%A7%BB%E5%88%B0wordpress-%E6%89%80%E6%9C%89%E6%96%87%E7%AB%A0%E5%92%8C%E5%9C%96%E7%89%87%E9%83%BD%E4%BF%9D%E5%AD%98%E5%88%B0%E6%96%B0.html\">https:\/\/rogerli.xyz\/2018\/09\/%E7%B5%82%E6%96%BC%E6%B1%BA%E5%BF%83%E5%BE%9Eblogger%E8%BD%89%E7%A7%BB%E5%88%B0wordpress-%E6%89%80%E6%9C%89%E6%96%87%E7%AB%A0%E5%92%8C%E5%9C%96%E7%89%87%E9%83%BD%E4%BF%9D%E5%AD%98%E5%88%B0%E6%96%B0.html<\/a><\/p>\n<p>Manual upgrade for WordPress:<br \/>\n<span style=\"background-color: #3366ff; color: #ffffff;\">wget https:\/\/tw.wordpress.org\/wordpress-6.2.2-zh_TW.tar.gz<\/span><br \/>\n<span style=\"background-color: #3366ff; color: #ffffff;\">tar -zxvf wordpress-6.2.2-zh_TW.tar.gz<\/span><br \/>\n<span style=\"background-color: #3366ff; color: #ffffff;\">rm -r wp-content<\/span> (delete this folder) in the .gz file<br \/>\n<span style=\"background-color: #3366ff; color: #ffffff;\">sudo cp -r wordpress \/var\/www\/<\/span><\/p>\n<p>3.1) \u90e8\u843d\u683c\u642c\u5bb6\u9ebb\u7169\u7684\u4e8b, \u642c blog \u7e3d\u6709\u5927\u5927\u5c0f\u5c0f\u602a\u554f\u984c\uff0c\u4f8b\u5982\u4e0d\u662f\u5168\u90e8\u76f8\u7247\u4e0b\u8f09\u5230 server\uff0c\u90a3\u9ebc\u5982\u679c\u7528\u4f5c\u5099\u4efd\u9084\u53ef\uff0c\u76f8\u7247\u7684\u9023\u7d50\u4ecd\u662f blogger \u53ef\u898b\u3002<br \/>\n\u767b\u5165: m<span style=\"background-color: #3366ff; color: #ffffff;\">ysql -u root -p<\/span><br \/>\n<span style=\"background-color: #3366ff; color: #ffffff;\">mysql&gt;use wordpress;<\/span><br \/>\n<span style=\"background-color: #3366ff; color: #ffffff;\">mysql&gt;select * from wp_options limit 2;<\/span><br \/>\n<span style=\"background-color: #3366ff; color: #ffffff;\">option_name option_value<\/span><br \/>\n<span style=\"background-color: #3366ff; color: #ffffff;\">siteurl\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0http:\/\/192.168.x.x<\/span><br \/>\n<span style=\"background-color: #3366ff; color: #ffffff;\">home\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0http:\/\/xxx.no-ip.com<\/span><br \/>\n<span style=\"background-color: #3366ff; color: #ffffff;\">mysql&gt;exit<\/span><\/p>\n<p>\u4fee\u6539\u914d\u7f6e\u6587\u4ef6 replace local url by \u57df\u540d url :<br \/>\n<span style=\"background-color: #3366ff; color: #ffffff;\">mysql&gt;UPDATE wp_options SET option_value = replace(option_value, &#8216;http:\/\/192.168.x.x&#8217;, &#8216;http:\/\/xxx.no-ip.com&#8217;) WHERE option_name = &#8216;home&#8217;;<\/span><\/p>\n<p>WordPress\u5167\u5916\u7db2\u540c\u6642\u8a2a\u554f\u554f\u984c\u89e3\u6c7a\u65b9\u6cd5:<br \/>\namend \/var\/www\/wordpress\/wp-includes\/option.php:<br \/>\n<a href=\"https:\/\/www.shuibuxing.fun\/solution-of-simultaneous-access-to-wordpress-intranet-and-intranet\/.html\">https:\/\/www.shuibuxing.fun\/solution-of-simultaneous-access-to-wordpress-intranet-and-intranet\/.html<\/a><\/p>\n<div>\n<p>\u5bb6\u4e2d Router \u9700\u8981 port forward 80\/443\u81f3 ubuntu server ip.<\/p>\n<p>3.2)<\/p>\n<div>\u60f3\u8d77\u5eff\u591a\u5e74\u524d\u7528Linux Fedora \u67b6\u7ad9\u5f8c\uff0c\u8a66\u904e lifetype (\u5b98\u65b9\u5df2\u7d50\u675f\u7dad\u8b77)\uff0c\u5de5\u8cbf\u7f722013\u5e74\u70ba\u4e2d\u5c0f\u4f01\u63a8\u5ee3 Joomla! \u5efa\u7db2\u7ad9\uff0c\u5728\u7db2\u4e0a\u627e\u5230:<\/div>\n<div><a href=\"https:\/\/www.smefund.tid.gov.hk\/english\/sdf\/deliverables\/D12001005_user_manual.pdf\">https:\/\/www.smefund.tid.gov.hk\/english\/sdf\/deliverables\/D12001005_user_manual.pdf<\/a><\/div>\n<div>\u6211\u597d\u50cf 2005\u5e74\u525b\u51fa\u5df2\u7528\u904e\u529f\u80fd\u5168\u9762\u7684 Joomla \u5efa\u8a2d\u7db2\u8a8c\u3002\u6240\u4ee5\uff0c\u53c8\u5617\u8a66\u5b83\u3002<\/div>\n<div><\/div>\n<\/div>\n<div>\u5efa\u7acbJoomla:<\/div>\n<div><a href=\"https:\/\/www.rosehosting.com\/blog\/how-to-install-joomla-on-ubuntu-22-04\/#Step-4-Install-PHP\">https:\/\/www.rosehosting.com\/blog\/how-to-install-joomla-on-ubuntu-22-04\/#Step-4-Install-PHP<\/a><\/div>\n<div><a href=\"https:\/\/extensions.joomla.org\/category\/migration-a-conversion\/data-import-a-export\/\">https:\/\/extensions.joomla.org\/category\/migration-a-conversion\/data-import-a-export\/<\/a><\/div>\n<div><\/div>\n<p>4) enable SSL (http to https)<br \/>\ne.g. self-signed certificate<br \/>\n<span style=\"background-color: #3366ff; color: #ffffff;\">openssl req -x509 -newkey rsa:4096 -sha256 -days 3650 -nodes \\<\/span><br \/>\n<span style=\"background-color: #3366ff; color: #ffffff;\">-keyout example.key -out example.crt<\/span><\/p>\n<p><span style=\"background-color: #3366ff; color: #ffffff;\">sudo openssl req -x509 -nodes -days 3650 -newkey rsa:2048 -keyout \/etc\/ssl\/private\/xxx.no-ip.com.key -out \/etc\/ssl\/certs\/xxx.no-ip.com.crt<\/span><\/p>\n<p><a href=\"https:\/\/blog.csdn.net\/wu10188\/article\/details\/124970453\">https:\/\/blog.csdn.net\/wu10188\/article\/details\/124970453<\/a><br \/>\n<a href=\"https:\/\/www.rosehosting.com\/blog\/how-to-enable-https-protocol-with-apache-2-on-ubuntu-20-04\/\">https:\/\/www.rosehosting.com\/blog\/how-to-enable-https-protocol-with-apache-2-on-ubuntu-20-04\/<\/a><\/p>\n<p>create 000-default.conf for and xxx.no-ip.com-ssl.conf for (refer step 6):<br \/>\n<span style=\"background-color: #3366ff; color: #ffffff;\">cat \/etc\/apache2\/sites-available\/xxx.no-ip.com-ssl.conf<\/span><br \/>\n<span style=\"background-color: #3366ff; color: #ffffff;\">sudo a2enmod ssl<\/span><br \/>\n<span style=\"background-color: #3366ff; color: #ffffff;\">sudo a2ensite xxx.no-ip.com-ssl.conf<\/span><br \/>\nEnable\/Disable your site config using sudo a2ensite {name} or sudo a2dissite {name}.<br \/>\n<span style=\"background-color: #3366ff; color: #ffffff;\">sudo systemctl restart apache2<\/span><\/p>\n<p><span style=\"background-color: #3366ff; color: #ffffff;\">sudo apache2ctl -S <\/span>to check if :80 :443 is enabled<\/p>\n<p>OR (Let&#8217;s Encrypt, this is work in browser)<br \/>\nInstall SNAP and Let&#8217;s Encrypt using CERTBOT<br \/>\n<a href=\"https:\/\/certbot.eff.org\/instructions?ws=apache&amp;os=ubuntufocal\">https:\/\/certbot.eff.org\/instructions?ws=apache&amp;os=ubuntufocal<\/a><\/p>\n<p>5) share folder in VirtualBox<\/p>\n<p><span style=\"background-color: #3366ff; color: #ffffff;\">mkdir temp<\/span><br \/>\n<span style=\"background-color: #3366ff; color: #ffffff;\">\/home\/\/temp<\/span><br \/>\n<a href=\"https:\/\/linuxconfig.org\/webdav-server-setup-on-ubuntu-linux\">https:\/\/linuxconfig.org\/webdav-server-setup-on-ubuntu-linux<\/a><br \/>\n<a href=\"https:\/\/sites.google.com\/site\/waue0920\/wei-yu-chen-s-note\/linux-%E7%AD%86%E8%A8%98\/virtualbox-client-%E7%AB%AF%E8%8B%A5%E6%98%AFlinux%E7%94%A8%E5%85%B1%E7%94%A8%E8%B3%87%E6%96%99%E5%A4%BE%E7%9A%84%E8%A8%AD%E5%AE%9A%E6%96%B9%E6%B3%95\">https:\/\/sites.google.com\/site\/waue0920\/wei-yu-chen-s-note\/linux-%E7%AD%86%E8%A8%98\/virtualbox-client-%E7%AB%AF%E8%8B%A5%E6%98%AFlinux%E7%94%A8%E5%85%B1%E7%94%A8%E8%B3%87%E6%96%99%E5%A4%BE%E7%9A%84%E8%A8%AD%E5%AE%9A%E6%96%B9%E6%B3%95<\/a><br \/>\nsudo mount -t vboxsf \u5206\u4eab\u8cc7\u6599\u593e\u540d\u7a31 \u639b\u8f09\u8def\u5f91<br \/>\n<span style=\"background-color: #3366ff; color: #ffffff;\">sudo mount -t vboxsf [sourcedir] \/home\/[admin]\/[destdir]<\/span><\/p>\n<div><span style=\"text-decoration: underline;\">Auto mount at startup example:<\/span><\/div>\n<div><\/div>\n<div>As root (i.e. sudo) Go to home folder and create a cron file:<\/div>\n<div>sudo pico cronjobs; Add the following and save file<\/div>\n<div>@reboot sleep 15; mount -t vboxsf temp \/home\/ubuntuadmin\/temp<\/div>\n<div><\/div>\n<div>To enable your cron as root (for above filename)<\/div>\n<div>crontab cronjobs<\/div>\n<div><\/div>\n<div>Make sure cron is active:<\/div>\n<div>crontab -l<\/div>\n<p>6) share folder using webdav ; setup davfs to allow webDAV, and WebDAV with user authentication<br \/>\n<a href=\"https:\/\/linuxconfig.org\/webdav-server-setup-on-ubuntu-linux\">https:\/\/linuxconfig.org\/webdav-server-setup-on-ubuntu-linux<\/a><br \/>\n<a href=\"https:\/\/www.jianshu.com\/p\/17da6608dc74\">https:\/\/www.jianshu.com\/p\/17da6608dc74<\/a><br \/>\n<a href=\"https:\/\/blog.lincloud.pro\/archives\/36.html\">https:\/\/blog.lincloud.pro\/archives\/36.html<\/a><br \/>\n<a href=\"https:\/\/www.digitalocean.com\/community\/tutorials\/how-to-configure-webdav-access-with-apache-on-ubuntu-18-04\">https:\/\/www.digitalocean.com\/community\/tutorials\/how-to-configure-webdav-access-with-apache-on-ubuntu-18-04<\/a><\/p>\n<p>matthew is the user id to login webdav:<br \/>\n<span style=\"background-color: #3366ff; color: #ffffff;\">sudo htpasswd -c \/etc\/apache2\/webdav.passwords matthew<\/span><\/p>\n<p><span style=\"background-color: #3366ff; color: #ffffff;\">sudo pico \/etc\/apache2\/sites-available\/xxx-no-ip.com-ssl.conf:<\/span><\/p>\n<div><span style=\"background-color: #3366ff; color: #ffffff;\">&lt;IfModule mod_ssl.c&gt;<\/span><\/div>\n<div><span style=\"background-color: #3366ff; color: #ffffff;\">&lt;VirtualHost *:<span style=\"background-color: #ff0000;\">443<\/span>&gt;<\/span><\/div>\n<div><span style=\"background-color: #3366ff; color: #ffffff;\">ServerAdmin webmaster@localhost<\/span><\/div>\n<div><span style=\"background-color: #3366ff; color: #ffffff;\">\u00a0 \u00a0 \u00a0 \u00a0 ServerName xxx.no-ip.com<\/span><\/div>\n<div><span style=\"background-color: #3366ff; color: #ffffff;\">\u00a0 \u00a0 \u00a0 \u00a0 DocumentRoot \/var\/www\/wordpress<\/span><\/div>\n<div><span style=\"background-color: #3366ff; color: #ffffff;\">\u00a0 \u00a0 \u00a0 \u00a0 Alias \/webdav \/var\/www\/webdav<\/span><\/div>\n<div><span style=\"background-color: #3366ff; color: #ffffff;\">\u00a0 \u00a0 \u00a0 \u00a0 &lt;Location \/webdav&gt;<\/span><\/div>\n<div><span style=\"background-color: #3366ff; color: #ffffff;\">\u00a0 \u00a0 \u00a0 \u00a0 \u00a0Options Indexes<\/span><\/div>\n<div><span style=\"background-color: #3366ff; color: #ffffff;\">\u00a0 \u00a0 \u00a0 \u00a0 \u00a0DAV On<\/span><\/div>\n<div><span style=\"background-color: #3366ff; color: #ffffff;\">\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 AuthType Basic<\/span><\/div>\n<div><span style=\"background-color: #3366ff; color: #ffffff;\">\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 AuthName &#8220;webdav&#8221;<\/span><\/div>\n<div><span style=\"background-color: #3366ff; color: #ffffff;\">\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 AuthUserFile \/etc\/apache2\/webdav.password<\/span><\/div>\n<div><span style=\"background-color: #3366ff; color: #ffffff;\">\u00a0 \u00a0 \u00a0 \u00a0 \u00a0Require valid-user<\/span><\/div>\n<div><span style=\"background-color: #3366ff; color: #ffffff;\">\u00a0 \u00a0 \u00a0 \u00a0 &lt;\/Location&gt;<\/span><\/div>\n<div><\/div>\n<div><span style=\"background-color: #3366ff; color: #ffffff;\">\u00a0 \u00a0 \u00a0 \u00a0 ErrorLog ${APACHE_LOG_DIR}\/error.log<\/span><\/div>\n<div><span style=\"background-color: #3366ff; color: #ffffff;\">\u00a0 \u00a0 \u00a0 \u00a0 CustomLog ${APACHE_LOG_DIR}\/access.log combined<\/span><\/div>\n<div><\/div>\n<div><span style=\"background-color: #3366ff; color: #ffffff;\">\u00a0 \u00a0 \u00a0 \u00a0 SSLEngine on<\/span><\/div>\n<div><span style=\"background-color: #3366ff; color: #ffffff;\">\u00a0 \u00a0 \u00a0 \u00a0 SSLCertificateFile \/etc\/ssl\/certs\/xxx.no-ip.com.crt<\/span><\/div>\n<div><span style=\"background-color: #3366ff; color: #ffffff;\">\u00a0 \u00a0 \u00a0 \u00a0 SSLCertificateKeyFile \/etc\/ssl\/certs\/xxx.no-ip.com.key<\/span><\/div>\n<div><span style=\"background-color: #3366ff; color: #ffffff;\">&lt;\/VirtualHost&gt;<\/span><\/div>\n<div><span style=\"background-color: #3366ff; color: #ffffff;\">&lt;\/IfModule&gt;<\/span><\/div>\n<p><span style=\"background-color: #3366ff; color: #ffffff;\">sudo pico \/etc\/apache2\/sites-available\/000-default.conf<\/span><\/p>\n<div><span style=\"color: #ffffff; background-color: #3366ff;\">&lt;IfModule mod_ssl.c&gt;<\/span><\/div>\n<div><span style=\"color: #ffffff; background-color: #3366ff;\">&lt;VirtualHost *:<span style=\"background-color: #ff0000;\">80<\/span>&gt;<\/span><\/div>\n<div><span style=\"color: #ffffff; background-color: #3366ff;\">ServerAdmin webmaster@localhost<\/span><\/div>\n<div><span style=\"color: #ffffff; background-color: #3366ff;\">\u00a0 \u00a0 \u00a0 \u00a0 DocumentRoot \/var\/www\/wordpress<\/span><\/div>\n<div><span style=\"color: #ffffff; background-color: #3366ff;\">\u00a0 \u00a0 \u00a0 \u00a0 Alias \/webdav \/var\/www\/webdav<\/span><\/div>\n<div><span style=\"color: #ffffff; background-color: #3366ff;\">\u00a0 \u00a0 \u00a0 \u00a0 &lt;Location \/webdav&gt;<\/span><\/div>\n<div><span style=\"color: #ffffff; background-color: #3366ff;\">\u00a0 \u00a0 \u00a0 \u00a0 \u00a0Options Indexes<\/span><\/div>\n<div><span style=\"color: #ffffff; background-color: #3366ff;\">\u00a0 \u00a0 \u00a0 \u00a0 \u00a0DAV On<\/span><\/div>\n<div><span style=\"color: #ffffff; background-color: #3366ff;\">\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 AuthType Basic<\/span><\/div>\n<div><span style=\"color: #ffffff; background-color: #3366ff;\">\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 AuthName &#8220;webdav&#8221;<\/span><\/div>\n<div><span style=\"color: #ffffff; background-color: #3366ff;\">\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 AuthUserFile \/etc\/apache2\/webdav.password<\/span><\/div>\n<div><span style=\"color: #ffffff; background-color: #3366ff;\">\u00a0 \u00a0 \u00a0 \u00a0 \u00a0Require valid-user<\/span><\/div>\n<div><span style=\"color: #ffffff; background-color: #3366ff;\">\u00a0 \u00a0 \u00a0 \u00a0 &lt;\/Location&gt;<\/span><\/div>\n<div><\/div>\n<div><span style=\"color: #ffffff; background-color: #3366ff;\">\u00a0 \u00a0 \u00a0 \u00a0 ErrorLog ${APACHE_LOG_DIR}\/error.log<\/span><\/div>\n<div><span style=\"color: #ffffff; background-color: #3366ff;\">\u00a0 \u00a0 \u00a0 \u00a0 CustomLog ${APACHE_LOG_DIR}\/access.log combined<\/span><\/div>\n<div><span style=\"color: #ffffff; background-color: #3366ff;\">&lt;\/VirtualHost&gt;<\/span><\/div>\n<div><span style=\"color: #ffffff; background-color: #3366ff;\">&lt;\/IfModule&gt;<\/span><\/div>\n<p>7)\u5728 ubuntu server \u8a2d\u5b9a \u9632\u706b\u7246 ufw firewall<br \/>\n<a href=\"https:\/\/www.digitalocean.com\/community\/tutorials\/how-to-set-up-a-firewall-with-ufw-on-ubuntu-20-04\">https:\/\/www.digitalocean.com\/community\/tutorials\/how-to-set-up-a-firewall-with-ufw-on-ubuntu-20-04<\/a><\/p>\n<p><span style=\"background-color: #3366ff; color: #ffffff;\">sudo apt install ufw<\/span><br \/>\n<span style=\"background-color: #3366ff; color: #ffffff;\">sudo ufw default deny incoming<\/span><br \/>\n<span style=\"background-color: #3366ff; color: #ffffff;\">sudo ufw default allow outgoing<\/span><\/p>\n<p>\u6839\u64da\u81ea\u5df1\u9700\u8981\uff0c\u4f8b\u5982\uff1a Web server\u53ef\u958b\u5553 port 80 \u7b49\u3002<br \/>\n<span style=\"background-color: #3366ff; color: #ffffff;\">sudo ufw allow 80<\/span><\/p>\n<p>\u8a2d\u5b9a\u597d\u53ef\u4ee5\u6307\u4ee4\u4ee4\u5176\u751f\u6548\u3002<br \/>\n<span style=\"background-color: #3366ff; color: #ffffff;\">sudo ufw enable<\/span><\/p>\n<p>\u6aa2\u8996\u73fe\u6709\u8a2d\u5b9a\u53ef\u7528\u9019:<br \/>\n<span style=\"background-color: #3366ff; color: #ffffff;\">sudo ufw status numbered<\/span><br \/>\n<span style=\"background-color: #3366ff; color: #ffffff;\">sudo ufw status verbose<\/span><br \/>\n<span style=\"background-color: #3366ff; color: #ffffff;\">sudo ufw reset <\/span>(if need delete)<\/p>\n<p>8) NextCloud install<br \/>\n<a href=\"http:\/\/www.mailserverguru.com\/install-nextcloud-on-ubuntu-22-04-lts\/\">http:\/\/www.mailserverguru.com\/install-nextcloud-on-ubuntu-22-04-lts\/<\/a><\/p>\n<p><span style=\"background-color: #3366ff; color: #ffffff;\">mysql -u root -p<\/span><br \/>\n<span style=\"background-color: #3366ff; color: #ffffff;\">CREATE USER &#8216;nextcloud&#8217;@&#8217;localhost&#8217; IDENTIFIED BY &#8216;passw@rd&#8217;;<\/span><br \/>\n<span style=\"background-color: #3366ff; color: #ffffff;\">CREATE DATABASE IF NOT EXISTS nextcloud CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;<\/span><br \/>\n<span style=\"background-color: #3366ff; color: #ffffff;\">GRANT ALL PRIVILEGES ON nextcloud.* TO &#8216;nextcloud&#8217;@&#8217;localhost&#8217;;<\/span><br \/>\n<span style=\"background-color: #3366ff; color: #ffffff;\">FLUSH PRIVILEGES;<\/span><br \/>\n<span style=\"background-color: #3366ff; color: #ffffff;\">quit;<\/span><\/p>\n<p><span style=\"color: #ffffff; background-color: #3366ff;\">cd \/var\/www\/<\/span><br \/>\n<span style=\"color: #ffffff; background-color: #3366ff;\">sudo wget https:\/\/download.nextcloud.com\/server\/releases\/latest.zip<\/span><br \/>\n<span style=\"color: #ffffff; background-color: #3366ff;\">sudo unzip latest.zip<\/span><br \/>\n<span style=\"color: #ffffff; background-color: #3366ff;\">sudo rm -rf latest.zip<\/span><br \/>\n<span style=\"color: #ffffff; background-color: #3366ff;\">sudo chown -R www-data:www-data \/var\/www\/nextcloud\/<\/span><\/p>\n<p><span style=\"background-color: #3366ff; color: #ffffff;\">sudo -u www-data php occ maintenance:install &#8211;database \\<\/span><br \/>\n<span style=\"background-color: #3366ff; color: #ffffff;\">&#8220;mysql&#8221; &#8211;database-name &#8220;nextcloud&#8221; &#8211;database-user &#8220;nextcloud&#8221; &#8211;database-pass \\<\/span><br \/>\n<span style=\"background-color: #3366ff; color: #ffffff;\">&#8220;passw@rd&#8221; &#8211;admin-user &#8220;admin&#8221; &#8211;admin-pass &#8220;admin123&#8221;<\/span><br \/>\nwait and after completed, Nextcloud was successfully installed<\/p>\n<p>add domain and set pretty and shorter URLs remove the &#8220;index.php\u201d part in all Nextcloud URLs.<br \/>\n<span style=\"background-color: #3366ff; color: #ffffff;\">sudo pico \/var\/www\/nextcloud\/config\/config.php<\/span><br \/>\n<span style=\"background-color: #3366ff; color: #ffffff;\">&#8216;trusted_domains&#8217; =&gt;<\/span><br \/>\n<span style=\"background-color: #3366ff; color: #ffffff;\">array (<\/span><br \/>\n<span style=\"background-color: #3366ff; color: #ffffff;\">0 =&gt; &#8216;localhost&#8217;,<\/span><br \/>\n<span style=\"background-color: #3366ff; color: #ffffff;\">1 =&gt; &#8216;yyy.no-ip.com&#8217;,<\/span><br \/>\n<span style=\"background-color: #3366ff; color: #ffffff;\">),<\/span><\/p>\n<p><span style=\"background-color: #3366ff; color: #ffffff;\">&#8216;htaccess.RewriteBase&#8217; =&gt; &#8216;\/&#8217;,<\/span><\/p>\n<p>config ssl like step 4 and 6:<br \/>\n<span style=\"background-color: #3366ff; color: #ffffff;\">sudo pico \/etc\/apache2\/sites-available\/yyy.no-ip.com-ssl.conf<\/span><\/p>\n<p>HTTP Strict Transport Security, which instructs browsers not allow any connection to the Nextcloud instance using HTTP, it prevents man-in-the-middle attack.<\/p>\n<div><span style=\"background-color: #3366ff; color: #ffffff;\">&lt;VirtualHost *:443&gt;<\/span><\/div>\n<div><span style=\"background-color: #3366ff; color: #ffffff;\">\u00a0 ServerName yyy.no-ip.com<\/span><\/div>\n<div><\/div>\n<div><span style=\"background-color: #3366ff; color: #ffffff;\">\u00a0 \u00a0 &lt;IfModule mod_headers.c&gt;<\/span><\/div>\n<div><span style=\"background-color: #3366ff; color: #ffffff;\">\u00a0 \u00a0 \u00a0 Header always set Strict-Transport-Security &#8220;max-age=15552000; includeSubDomains&#8221;<\/span><\/div>\n<div><span style=\"background-color: #3366ff; color: #ffffff;\">\u00a0 \u00a0 &lt;\/IfModule&gt;<\/span><\/div>\n<div><\/div>\n<div><span style=\"background-color: #3366ff; color: #ffffff;\">\u00a0&lt;\/VirtualHost&gt;<\/span><\/div>\n<div><\/div>\n<div>\n<div>9) antivirus &#8211; ClamAV \/ Clamtk<\/div>\n<div><\/div>\n<div>ClamAV\u00a0 &#8211;\u00a0<a href=\"https:\/\/www.howtoforge.com\/tutorial\/clamav-ubuntu\/\">https:\/\/www.howtoforge.com\/tutorial\/clamav-ubuntu\/<\/a><\/div>\n<div>\u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0&#8211;\u00a0<a href=\"https:\/\/linuxhint.com\/install_clamav_ubuntu\/\">https:\/\/linuxhint.com\/install_clamav_ubuntu\/<\/a><\/div>\n<div><\/div>\n<div>After install, get latest signatures of virus:<\/div>\n<div>sudo freshclam<\/div>\n<div><\/div>\n<div>sudo mkdir temp\/archive\u00a0 (for moving infected file to a specified location)<\/div>\n<div><\/div>\n<div>To scan the whole system (need a while):<\/div>\n<div><\/div>\n<div>clamscan -r &#8211;infected &#8211;move=temp\/archive \/<\/div>\n<div><\/div>\n<div>Clamtk (GUI) &#8211;\u00a0<a href=\"https:\/\/www.imaginelinux.com\/clamtk-for-ubuntu\/\">https:\/\/www.imaginelinux.com\/clamtk-for-ubuntu\/<\/a><\/div>\n<div>\n<div><\/div>\n<\/div>\n<div>\n<p>10) \u9059\u9060\u767b\u5165 virtualbox client<\/p>\n<p>\u7528\u53e6\u4e00\u53f0\u96fb\u8166\u767b\u5165 \u6211\u7684Win11 \u4e3b\u6a5f(192.168.x.x)\uff0c\u5229\u7528\u5fae\u8edf\u7684 (remote desktop\uff0c port default 3389) \u4fbf\u53ef\u3002<\/p>\n<p>\u800c\u5728 Virtualbox client display \u9801\u8a2d\u5b9a 3390-4000 \u4efb\u4f55\u4e00\u500bport(\u4f8b:\u6211\u7528 3390)\uff0c\u5254\u9078enable server\u3002<\/p>\n<p>Ref: <a href=\"https:\/\/www.mybijourney.com\/how-to-connect-to-virtual-box-vm-using-microsoft-remote-desktop\/\">https:\/\/www.mybijourney.com\/how-to-connect-to-virtual-box-vm-using-microsoft-remote-desktop\/<\/a><\/p>\n<p>\u5728Win11 \u4e3b\u6a5f\u7684 firewall \u65b0\u589e\u6b64 port \u7684 inbound traffic\u3002<br \/>\nRef: <a href=\"https:\/\/learn.microsoft.com\/en-us\/windows\/security\/operating-system-security\/network-security\/windows-firewall\/create-an-inbound-port-rule\">https:\/\/learn.microsoft.com\/en-us\/windows\/security\/operating-system-security\/network-security\/windows-firewall\/create-an-inbound-port-rule<\/a><\/p>\n<p>\u90a3\u9ebc\uff0c \u7528\u53e6\u4e00\u53f0\u96fb\u8166 RDP<br \/>\n192.168.x.x:3390<\/p>\n<p>\u4fbf\u898b\u5230\u6211 Ubuntu client \u7684\u767b\u5165\u753b\u9762\u4e86\u3002<\/p>\n<p>&nbsp;<\/p>\n<\/div>\n<\/div>\n<div><span style=\"text-decoration: underline;\">\u5f8c\u8a18:<\/span><\/div>\n<div>\u5982\u679c\u8d77 Server, \u81ea\u52d5 down, up vm \u6703\u662f\u95dc\u9375\u52d5\u4f5c\uff0c\u56e0\u6211\u7528 win11\uff0c \u90a3\u4f7f\u7528 task scheduler \u4fbf\u80fd\u9054\u6210\u3002<\/div>\n<div>\u6211\u5c07 action \u653e\u5728 .bat \u518d\u4ee4 scheduler\u5728 boot \u6a5f\u6642\u904b\u884c\u5b83\u3002<\/div>\n<div><\/div>\n<div>\u53e6\u5916\uff0c\u6211\u6bcf\u9031\u8a2d\u5b9a\u5b9a\u6642\u4e00\u6b21 reboot \u53ef\u7528<\/div>\n<div>shutdown -r (\u6703\u5728\u4e00\u5206\u9418\u5167\u91cd\u958b\u6a5f)\u3002<\/div>\n<div><\/div>\n<div>\u53c2\u8003\u9019\u7bc7\uff0c\u800c\u4e0d\u8981\u4f7f\u7528 login \u5f8c\u7684 startup folder\u3002<\/div>\n<div><a href=\"https:\/\/www.blogger.com\/blog\/post\/edit\/5113711716586468024\/3545408156716445542#\" data-original-attrs=\"{&quot;data-original-href&quot;:&quot;https:\/\/superuser.com\/questions\/1027410\/how-do-you-configure-virtualbox-vm-to-autostart-after-windows-10-reboot&quot;}\">https:\/\/superuser.com\/questions\/1027410\/how-do-you-configure-virtualbox-vm-to-autostart-after-windows-10-reboot<\/a><\/div>\n<p>\u53e6\u5916\uff0c\u7db2\u4e0a\u898b\u5230\u9999\u6e2f\u670b\u53cb Toby Chiu \u7684\u5927\u4f5cAroZos, \u53ea\u9700\u7528 URL \u4fbf\u53ef\u63a7\u5236\u807d\u6b4c\u770b\u7247\u5206\u4eab\u6a94\u6848\uff0c\u529f\u80fd\u5f37\u5927\uff0c\u7a0d\u5f8c\u4f5c\u53e6\u6587\u4ecb\u7d39\u5b89\u88dd\u65b9\u6cd5\u3002<\/p>\n<p><a href=\"https:\/\/cwchin.no-ip.com\/?p=928\">https:\/\/cwchin.no-ip.com\/?p=928<\/a><\/p>\n<p>&#8212;&#8212;-END&#8212;&#8212;-<\/p>\n","protected":false},"excerpt":{"rendered":"<p>VirtualBox , Ubuntu server + Ubuntu desktop \u5b89\u88dd\u7d00\u9304 1) Vir [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":1839,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"site-container-style":"default","site-container-layout":"default","site-sidebar-layout":"default","disable-article-header":"default","disable-site-header":"default","disable-site-footer":"default","disable-content-area-spacing":"default","footnotes":""},"categories":[1],"tags":[],"class_list":["post-897","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/cwchin.no-ip.com\/index.php?rest_route=\/wp\/v2\/posts\/897","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/cwchin.no-ip.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/cwchin.no-ip.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/cwchin.no-ip.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/cwchin.no-ip.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=897"}],"version-history":[{"count":40,"href":"https:\/\/cwchin.no-ip.com\/index.php?rest_route=\/wp\/v2\/posts\/897\/revisions"}],"predecessor-version":[{"id":1811,"href":"https:\/\/cwchin.no-ip.com\/index.php?rest_route=\/wp\/v2\/posts\/897\/revisions\/1811"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/cwchin.no-ip.com\/index.php?rest_route=\/wp\/v2\/media\/1839"}],"wp:attachment":[{"href":"https:\/\/cwchin.no-ip.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=897"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/cwchin.no-ip.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=897"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/cwchin.no-ip.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=897"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}