User Tools

Site Tools


computers:apache_server_configuration

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
computers:apache_server_configuration [2018/12/17 11:44] chkuocomputers:apache_server_configuration [2022/11/02 16:04] (current) chkuo
Line 92: Line 92:
  
 </file> </file>
 +
 +===== Update =====
 +
 +<code bash>
 +# for Ubuntu 20.04.5 LTS; 2022/11/02
 +# to update beyond Apache/2.4.41
 +$ apache2 -v
 +Server version: Apache/2.4.41 (Ubuntu)
 +Server built:   2022-06-14T13:30:55
 +$ sudo add-apt-repository ppa:ondrej/apache2 
 +$ sudo apt update
 +$ sudo apt install apache2
 +$ apache2 -v
 +Server version: Apache/2.4.54 (Ubuntu)
 +Server built:   2022-06-08T15:59:07
 +$ systemctl status apache2
 +$ sudo systemctl start apache2
 +$ sudo systemctl enable apache2
 +</code>
  
 ===== Password protection ===== ===== Password protection =====
Line 115: Line 134:
   * install:   * install:
 <code bash> <code bash>
-$ sudo apt-get update +# require snapd; pre-installed on Ubuntu 20.04 
-$ sudo apt-get install software-properties-common +# remove the pre-installed cerbot (if present) 
-$ sudo add-apt-repository universe +$ sudo apt remove certbot 
-$ sudo add-apt-repository ppa:certbot/certbot +# install certbot using snap 
-$ sudo apt-get update +$ sudo snap install --classic certbot 
-$ sudo apt-get install python-certbot-apache +# get a certificate; two options 
 +# (1) get a certificate without changing the Apache configuration  
 +$ sudo certbot certonly --apache 
 +# (2) get a certificate and have certbot edit the Apache configuration  
 +$ sudo certbot --apache 
 +
 +# check status 
 +$ sudo systemctl status certbot.timer 
 +# test renewal 
 +$ sudo certbot renew --dry-run 
 +# manual renewal; not recommended 
 +# better to put '/usr/bin/certbot renew --quiet' in crontab 
 +$ sudo certbot renew 
 +# enable ssl 
 +$ sudo a2enmod ssl
 </code> </code>
     * modify ''/etc/apache2/sites-available/000-default.conf'' accordingly     * modify ''/etc/apache2/sites-available/000-default.conf'' accordingly
Line 127: Line 160:
  ServerAdmin admin@example.com  ServerAdmin admin@example.com
 </file> </file>
-    * execute 
-<code bash> 
-$ sudo certbot --apache 
-</code> 
  
  
 +  * SSL test: [[https://www.ssllabs.com/ssltest/]]
 ===== PHP ===== ===== PHP =====
 ==== Info ==== ==== Info ====
Line 204: Line 234:
 sudo htpasswd -c /var/www/webdav/passwd.dav test sudo htpasswd -c /var/www/webdav/passwd.dav test
 # change the ownership and permissions # change the ownership and permissions
-sudo chown www-data:admin /var/www/webdav/passwd.dav+sudo chown www-data:adm /var/www/webdav/passwd.dav
 sudo chmod 640 /var/www/webdav/passwd.dav sudo chmod 640 /var/www/webdav/passwd.dav
 # backup the vhost configuration # backup the vhost configuration
Line 239: Line 269:
  
 ==== References ==== ==== References ====
 +  * [[https://www.digitalocean.com/community/tutorials/how-to-install-the-apache-web-server-on-ubuntu-20-04]]
   * [[https://www.digitalocean.com/community/tutorials/how-to-install-the-apache-web-server-on-ubuntu-18-04]]   * [[https://www.digitalocean.com/community/tutorials/how-to-install-the-apache-web-server-on-ubuntu-18-04]]
  
  
computers/apache_server_configuration.1545018274.txt.gz · Last modified: 2018/12/17 11:44 by chkuo