SSH into our ubuntu device and do the following. The commands are subject to changes, we should use all latest relevant commands from certbot's website.
$ sudo apt update
$ clear
$ sudo apt install apache2
$ cd /etc/apache2/sites-available/
$ clear
$ ls
$ sudo vi ridiculous-inc.com.conf
$ cd /var/www
$ sudo git clone https://github.com/ridiculous-ijquery-todo.git ridic
$ sudo a2ensite ridiculous-inc.com.conf
$ sudo service apache2 restart
$ sudo apt-get update
$ clear
$ sudo apt-get install software-properties-common
$ sudo add-apt-repository ppa:certbot/certbot
$ clear
$ sudo apt-get update
$ sudo apt-get install python-certbot-apache
$ clear
$ sudo certbot --apache
$ history
and
<VirtualHost *:80>
DocumentRoot /var/www/ridic
ServerName ridiculous-inc.com
<Directory "/var/www/ridic">
allow from all
AllowOverride All
Order allow,deny
Options +Indexes
</Directory>
</VirtualHost>
To redirect request to port 80 to other internal port we use the following setting of virtualhost:
<VirtualHost *:80>
ServerName api.screencapdictionary.com
<Location "/">
ProxyPreserveHost On
ProxyPass http://localhost:5000/
ProxyPassReverse http://localhost:5000/
</Location>
</VirtualHost>
No comments:
Post a Comment