Changes between Version 12 and Version 13 of Csle2022/Agenda/databaseandweb


Ignore:
Timestamp:
Nov 22, 2022, 4:10:54 PM (2 years ago)
Author:
admin
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Csle2022/Agenda/databaseandweb

    v12 v13  
    124124{{{
    125125<VirtualHost *:80>
    126     ServerName web.dhammikalalantha.com
    127     ServerAlias web.dhammikalalantha.com
    128     ServerAdmin webmaster@dhammikalalantha.com
    129     DocumentRoot /var/www/web.dhammikalalantha.com/public_html
    130 
    131     <Directory /var/www/web.dhammikalalantha.com/public_html>
     126    ServerName web.your_domain.com
     127    ServerAlias web.your_domain.com
     128    ServerAdmin webmaster@your_domain.com
     129    DocumentRoot /var/www/web.your_domain.com/public_html
     130
     131    <Directory /var/www/web.your_domain.com/public_html>
    132132        Options -Indexes +FollowSymLinks
    133133    </Directory>
    134134
    135     ErrorLog ${APACHE_LOG_DIR}/web.dhammikalalantha.com-error.log
    136     CustomLog ${APACHE_LOG_DIR}/web.dhammikalalantha.com-access.log combined
     135    ErrorLog ${APACHE_LOG_DIR}/web.your_domain.com-error.log
     136    CustomLog ${APACHE_LOG_DIR}/web.your_domain.com-access.log combined
    137137</VirtualHost>
    138138}}}
     
    146146{{{
    147147<VirtualHost *:80>
    148     ServerName wp.dhammikalalantha.com
    149     ServerAlias wp.dhammikalalantha.com
    150     ServerAdmin webmaster@wp.dhammikalalantha.com
    151     DocumentRoot /var/www/wp.dhammikalalantha.com/public_html
    152 
    153     <Directory /var/www/wp.dhammikalalantha.com/public_html>
     148    ServerName wp.your_domain.com
     149    ServerAlias wp.your_domain.com
     150    ServerAdmin webmaster@wp.your_domain.com
     151    DocumentRoot /var/www/wp.your_domain.com/public_html
     152
     153    <Directory /var/www/wp.your_domain.com/public_html>
    154154        Options -Indexes +FollowSymLinks
    155155    </Directory>
    156156
    157     ErrorLog ${APACHE_LOG_DIR}/wp.dhammikalalantha.com-error.log
    158     CustomLog ${APACHE_LOG_DIR}/wp.dhammikalalantha.com-access.log combined
     157    ErrorLog ${APACHE_LOG_DIR}/wp.your_domain.com-error.log
     158    CustomLog ${APACHE_LOG_DIR}/wp.your_domain.com-access.log combined
    159159</VirtualHost>
    160160}}}
     
    168168{{{
    169169<VirtualHost *:80>
    170     ServerName lms.dhammikalalantha.com
    171     ServerAlias lms.dhammikalalantha.com
    172     ServerAdmin webmaster@lms.dhammikalalantha.com
    173     DocumentRoot /var/www/lms.dhammikalalantha.com/public_html
    174 
    175     <Directory /var/www/lms.dhammikalalantha.com/public_html>
     170    ServerName lms.your_domain.com
     171    ServerAlias lms.your_domain.com
     172    ServerAdmin webmaster@lms.your_domain.com
     173    DocumentRoot /var/www/lms.your_domain.com/public_html
     174
     175    <Directory /var/www/lms.your_domain.com/public_html>
    176176        Options -Indexes +FollowSymLinks
    177177    </Directory>
    178178
    179     ErrorLog ${APACHE_LOG_DIR}/lms.dhammikalalantha.com-error.log
    180     CustomLog ${APACHE_LOG_DIR}/lms.dhammikalalantha.com-access.log combined
     179    ErrorLog ${APACHE_LOG_DIR}/lms.your_domain.com-error.log
     180    CustomLog ${APACHE_LOG_DIR}/lms.your_domain.com-access.log combined
    181181</VirtualHost>
    182182}}}
     
    185185
    186186{{{
    187 sudo a2ensite web.dhammikalalantha.com
    188 sudo a2ensite wp.dhammikalalantha.com
    189 sudo a2ensite lms.dhammikalalantha.com
     187sudo a2ensite web.your_domain.com
     188sudo a2ensite wp.your_domain.com
     189sudo a2ensite lms.your_domain.com
    190190}}}
    191191
     
    205205
    206206As you know we can't use any preferred domain for our services, websites as we wanted to do. First we have to register them in a relevant domain registry where usually we have to pay. In case you want a ac.lk sub domain you have to get it through LEARN. Once you get your domains registered they are to be assigned IP addresses so that they can be used in your services for hosting services, websites etc. Assigning of IP addresses to the domain names is done through DNS lookup service. This DNS service is also can be accomplished through the relevant domain registry or web hosting service. For the ac.lk domain, LEARN or your institutional network/system administrator will do that for you.
     207
     208Receiving domains costs or need the approval from the System Administrator. Hence, for this workshop we can use hosts file in your computer operating system to create any arbitrary domain for your self. Hosts file will override any public DNS but only for your own computer.
     209
     210To add domains to the hosts file edit the hosts file as below.
     211
     212{{{
     213nano /etc/hosts
     214
     215
     216127.0.0.1 localhost
     217127.0.1.1 web
     218192.248.4.70 web.your_domain.com
     219192.248.4.70 wp.your_domain.com
     220192.248.4.70 lms.your_domain.com
     221192.248.4.70 xy.your_2nd_domain.com
     222}}}
     223
     224Now you should be able to access the virtual hosts by their domain names within the computer.
     225
     226To check it you can ping to the domain or browse from the web browser.
     227
     228{{{
     229ping wp.your_domain.com
     230ping xy.your_2nd_domain.com
     231}}}
    207232
    208233= Installing Web sites/applications =
     
    595620Obtaining a new certificate
    596621Performing the following challenges:
    597 http-01 challenge for wp.dhammikalalantha.com
     622http-01 challenge for wp.your_domain.com
    598623Waiting for verification...
    599624Cleaning up challenges
    600 Created an SSL vhost at /etc/apache2/sites-available/wp.dhammikalalantha.com-le-ssl.conf
     625Created an SSL vhost at /etc/apache2/sites-available/wp.your_domain.com-le-ssl.conf
    601626Enabled Apache socache_shmcb module
    602627Enabled Apache ssl module
    603 Deploying Certificate to VirtualHost /etc/apache2/sites-available/wp.dhammikalalantha.com-le-ssl.conf
    604 Enabling available site: /etc/apache2/sites-available/wp.dhammikalalantha.com-le-ssl.conf
     628Deploying Certificate to VirtualHost /etc/apache2/sites-available/wp.your_domain.com-le-ssl.conf
     629Enabling available site: /etc/apache2/sites-available/wp.your_domain.com-le-ssl.conf
    605630
    606631Please choose whether or not to redirect HTTP traffic to HTTPS, removing HTTP access.
     
    618643
    619644{{{
    620 Redirecting vhost in /etc/apache2/sites-enabled/wp.dhammikalalantha.com.conf to ssl vhost in /etc/apache2/sites-available/wp.dhammikalalantha.com-le-ssl.conf
    621 
    622 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    623 Congratulations! You have successfully enabled https://wp.dhammikalalantha.com
     645Redirecting vhost in /etc/apache2/sites-enabled/wp.your_domain.com.conf to ssl vhost in /etc/apache2/sites-available/wp.dhammikalalantha.com-le-ssl.conf
     646
     647- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
     648Congratulations! You have successfully enabled https://wp.your_domain.com
    624649
    625650You should test your configuration at:
    626 https://www.ssllabs.com/ssltest/analyze.html?d=wp.dhammikalalantha.com
     651https://www.ssllabs.com/ssltest/analyze.html?d=wp.your_domain.com
    627652- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    628653
    629654IMPORTANT NOTES:
    630655 - Congratulations! Your certificate and chain have been saved at:
    631    /etc/letsencrypt/live/wp.dhammikalalantha.com/fullchain.pem
     656   /etc/letsencrypt/live/wp.your_domain.com/fullchain.pem
    632657   Your key file has been saved at:
    633    /etc/letsencrypt/live/wp.dhammikalalantha.com/privkey.pem
     658   /etc/letsencrypt/live/wp.your_domain.com/privkey.pem
    634659   Your cert will expire on 2023-02-20. To obtain a new or tweaked
    635660   version of this certificate in the future, simply run certbot again