Ubuntu : Installing Apache

Installing Apache,

root@th-ubuntu2:/home/taehee# apt update

root@th-ubuntu2:/home/taehee# apt install apache2

root@th-ubuntu2:/home/taehee# ufw allow 'Apache'

root@th-ubuntu2:/home/taehee# service apache2 status
● apache2.service - The Apache HTTP Server
   Loaded: loaded (/lib/systemd/system/apache2.service; enabled; vendor preset:
  Drop-In: /lib/systemd/system/apache2.service.d
           └─apache2-systemd.conf
   Active: active (running) since Mon 2019-04-15 09:19:48 UTC; 1min 31s ago
 Main PID: 19093 (apache2)
    Tasks: 55 (limit: 4708)
   CGroup: /system.slice/apache2.service
           ├─19093 /usr/sbin/apache2 -k start
           ├─19094 /usr/sbin/apache2 -k start
           └─19095 /usr/sbin/apache2 -k start

Apr 15 09:19:48 th-ubuntu2 systemd[1]: Starting The Apache HTTP Server...
Apr 15 09:19:48 th-ubuntu2 apachectl[19068]: AH00558: apache2: Could not reliabl
Apr 15 09:19:48 th-ubuntu2 systemd[1]: Started The Apache HTTP Server.


Enable https,
root@th-ubuntu1:/etc/apache2/sites-available# apache2ctl -M

root@th-ubuntu1:/etc/apache2/sites-available# netstat -a | egrep 'Proto|LISTEN'
tcp6       0      0 [::]:https              [::]:*                  LISTEN

root@th-ubuntu1:/etc/apache2/sites-available# openssl genrsa -out ca.key 2048

root@th-ubuntu1:/etc/apache2/sites-available# openssl x509 -req -days 365 -in ca.csr -signkey ca.key -out ca.crt

root@th-ubuntu1:/etc/apache2/sites-available# mkdir /etc/apache2/ssl

root@th-ubuntu1:/etc/apache2/sites-available# cp ca.crt ca.key ca.csr /etc/apache2/ssl/

root@th-ubuntu1:/etc/apache2/sites-available# vi /etc/apache2/sites-enabled/000-default.conf
<VirtualHost *:443>
                ServerAdmin webmaster@localhost
                DocumentRoot /var/www/html
                ErrorLog ${APACHE_LOG_DIR}/error.log
                CustomLog ${APACHE_LOG_DIR}/access.log combined
                SSLEngine on
                SSLCertificateFile /etc/apache2/ssl/ca.crt
                SSLCertificateKeyFile /etc/apache2/ssl/ca.key

</VirtualHost>

root@th-ubuntu1:/etc/apache2/sites-available# /etc/init.d/apache2 restart



Comments

Popular posts from this blog

ADFS WAP: How to configure SSO with RDWeb

Collect AzureStack Update Verbose log

Secure RDWeb using Azure Multi-Factor Authentication