ubuntu20 系统 Apache+花生壳(内网穿透)服务项目上线
生活随笔
收集整理的這篇文章主要介紹了
ubuntu20 系统 Apache+花生壳(内网穿透)服务项目上线
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
1.下載花生殼(內網穿透)客戶端
????????wget "https://down.oray.com/hsk/linux/phddns_5.2.0_amd64.deb" -O phddns_5.2.0_amd64.deb
?
2.下載后,安裝并啟用花生殼 ? ?
?sudo dpkg -i xxx.debsudo phddns start/stop/restart?
3.進入花生殼遠程管理頁面 ? ? ?
????????瀏覽器輸入遠程管理地址http://b.oray.com
????????輸入安裝花生殼時生成的SN碼及默認密碼admin進入
?
4.安裝Apache
sudo apt updatesudo apt install apache2?
5.驗證 Apache2 是否正在運行
sudo systemctl status apache2? ?運行成功?????
?
6.驗證 Apache 安裝??
????????打開你的瀏覽器,輸入服務器 IP 地址http://YOUR_IP_OR_DOMAIN/
? ? ? ? ?安裝成功
?
7.配置默認000-default.conf虛擬主機(也可創建多個) ?
sudo vim /etc/apache2/sites-enabled/000-default.conf <VirtualHost *:80># The ServerName directive sets the request scheme, hostname and port that# the server uses to identify itself. This is used when creating# redirection URLs. In the context of virtual hosts, the ServerName# specifies what hostname must appear in the request's Host: header to# match this virtual host. For the default virtual host (this file) this# value is not decisive as it is used as a last resort host regardless.# However, you must set it for any further virtual host explicitly.#ServerName html#ServerAlias www.htmlServerAdmin webmaster@內網穿透訪問地址DocumentRoot /var/www/項目文件夾# Available loglevels: trace8, ..., trace1, debug, info, notice, warn,# error, crit, alert, emerg.# It is also possible to configure the loglevel for particular# modules, e.g.#LogLevel info ssl:warn#<Directory /var/www/html>#Options -Indexes +FollowSymLinks#AllowOverride All#</Directory>ErrorLog ${APACHE_LOG_DIR}/error.logCustomLog ${APACHE_LOG_DIR}/access.log combined# For most configuration files from conf-available/, which are# enabled or disabled at a global level, it is possible to# include a line for only one particular virtual host. For example the# following line enables the CGI configuration for this host only# after it has been globally disabled with "a2disconf".#Include conf-available/serve-cgi-bin.conf </VirtualHost># vim: syntax=apache ts=4 sw=4 sts=4 sr noet?
8.在apache2.conf最后一行添加ServerName ?
?sudo vim /etc/apache2/sites-enabled/apache2.conf ServerName 內網穿透訪問地址:端口號?
?9.測試配置文件,是否有任何語法錯誤 ????????
sudo apachectl configtest????????如果沒有任何錯誤,你將會看到下面的輸出
????????Syntax OK
?
10.重啟 Apache 服務,使修改生效 ?
?sudo systemctl restart apache2?
11.最終效果
????????在瀏覽器輸入http://內網穿透訪問地址/xxx.html
好了,就到這了,如果喜歡就點個贊吧!?
?
?
總結
以上是生活随笔為你收集整理的ubuntu20 系统 Apache+花生壳(内网穿透)服务项目上线的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 在VirtualBox中安装BlackA
- 下一篇: ios monkey test