Linux 架站
本文章使用ubuntu 18.04
最后更新于
本文章使用ubuntu 18.04
最后更新于
-------------------必須要執行-------------------
#更改密碼
sudo -s
passwd
#更新/升級
sudo apt update && sudo apt upgrade
#tasksel 套件
sudo apt-get install -y tasksel
#xrdp 遠端桌面
sudo apt-get install -y xrdp
sudo service xrdp restart
#SQL Server - Ubuntu 18.04
wget -qO- https://packages.microsoft.com/keys/microsoft.asc | sudo apt-key add -
sudo add-apt-repository "$(wget -qO- https://packages.microsoft.com/config/ubuntu/18.04/mssql-server-2019.list)"
sudo apt-get update
sudo apt-get install -y mssql-server
sudo /opt/mssql/bin/mssql-conf setup
systemctl status mssql-server --no-pager
#SQL Server 命令列工具
curl https://packages.microsoft.com/keys/microsoft.asc | sudo apt-key add -
curl https://packages.microsoft.com/config/ubuntu/18.04/prod.list | sudo tee /etc/apt/sources.list.d/msprod.list
sudo apt-get update
sudo apt-get install mssql-tools unixodbc-dev
sudo apt-get update
sudo apt-get install mssql-tools
#Mono
sudo apt install gnupg ca-certificates
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF
echo "deb https://download.mono-project.com/repo/ubuntu stable-bionic main" | sudo tee /etc/apt/sources.list.d/mono-official-stable.list
sudo apt update
sudo apt install mono-devel
#apache2
sudo apt-get install apach2
apache2 -version
#配置防火牆設置
$ sudo ufw app list
$ sudo ufw allow 'Apache'
-------------額外安裝-----------------
#GUI 桌面
sudo apt-get install -y xfce4
#MYSQL
wget https://files.phpmyadmin.net/phpMyAdmin/5.1.0/phpMyAdmin-5.1.0-all-languages.zip
#ZIP
sudo apt install zip
systemctl status apache2.service
cd /var/www/sudo chmod -R 755 /var/www/examplecd /etc/apache2/<Directory /var/www/iis_example/>
Options Indexes FollowSymLinks
AllowOverride None
Require all granted
</Directory>
# If you just change the port or add more ports here, you will likely also
# have to change the VirtualHost statement in
# /etc/apache2/sites-enabled/000-default.conf
Listen 80
Listen 10050
Listen 10051
<IfModule ssl_module>
Listen 443
</IfModule>
<IfModule mod_gnutls.c>
Listen 443
</IfModule>
# vim: syntax=apache ts=4 sw=4 sts=4 sr noetcd /etc/apache2/sites-enabledtouch Demo.conf<VirtualHost *:81>
ServerAdmin webmaster@localhost
ServerName Demo
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
DocumentRoot /var/www/Demo
MonoServerPath Demo "/usr/bin/mod-mono-server4"
MonoAutoApplication disabled
#AddHandler mono .aspx .asmx
MonoApplications Demo "/:/var/www/iis_example/MES_Cloud_Work"
MonoSetEnv MONO_IOMAP=all
<Directory /var/www/Demo>
Require all granted
MonoSetServerAlias MES_Cloud_Work
SetHandler mono
</Directory>
</VirtualHost>service apache2 restartsudo systemctl start apache2sudo systemctl stop apache2sudo systemctl restart apache2sudo systemctl reload apache2sudo systemctl enable apache2sudo systemctl disable apache2sudo systemctl status apache2.service