sudo apt-get update
sudo apt-get -y dist-upgrade
sudo apt-get clean
sudo rm /etc/apt/apt.conf.d/50unattended-upgrades.ucf-dist
apt install apache2 php7.0 libapache2-mod-php7.0 curl php-curl youtube-dl
chmod -R 0777 /var/www
sudo cp /etc/apache2/sites-available/000-default.conf /etc/apache2/sites-available/test.com.conf
sudo nano /etc/apache2/sites-available/test.com.conf
<VirtualHost *:80>
ServerAdmin [email protected]
ServerName test.com
DocumentRoot /var/www/app
</VirtualHost>
sudo a2ensite test.com.conf
sudo service apache2 restart
sudo nano /etc/apache2/apache2.conf
找到
<Directory />
Options Indexes FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
</Directory>
只需修改Options Indexes FollowSymLinks為Options None即可
sudo service apache2 restart
ubuntu修改ssh端口
sudo nano /etc/ssh/sshd_config
PasswordAuthentication改為no
service ssh restart