Changes between Version 7 and Version 8 of Csle2022/Agenda/databaseandweb


Ignore:
Timestamp:
Nov 16, 2022, 10:53:55 AM (2 years ago)
Author:
admin
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Csle2022/Agenda/databaseandweb

    v7 v8  
    139139}}}
    140140
    141 Similarly do the necessary configurations for the domain sales.
    142 
    143 {{{
    144 sudo nano /etc/apache2/sites-available/sales.your_domain.com.conf
     141Similarly do the necessary configurations for the sub-domain wp.
     142
     143{{{
     144sudo nano /etc/apache2/sites-available/wp.your_domain.com.conf
    145145}}}
    146146
    147147{{{
    148148<VirtualHost *:80>
    149     ServerName sales.dhammikalalantha.com
    150     ServerAlias sales.dhammikalalantha.com
    151     ServerAdmin webmaster@sales.dhammikalalantha.com
    152     DocumentRoot /var/www/sales.dhammikalalantha.com/public_html
    153 
    154     <Directory /var/www/sales.dhammikalalantha.com/public_html>
     149    ServerName wp.dhammikalalantha.com
     150    ServerAlias wp.dhammikalalantha.com
     151    ServerAdmin webmaster@wp.dhammikalalantha.com
     152    DocumentRoot /var/www/wp.dhammikalalantha.com/public_html
     153
     154    <Directory /var/www/wp.dhammikalalantha.com/public_html>
    155155        Options -Indexes +FollowSymLinks
    156156        AllowOverride All
    157157    </Directory>
    158158
    159     ErrorLog ${APACHE_LOG_DIR}/sales.dhammikalalantha.com-error.log
    160     CustomLog ${APACHE_LOG_DIR}/sales.dhammikalalantha.com-access.log combined
     159    ErrorLog ${APACHE_LOG_DIR}/wp.dhammikalalantha.com-error.log
     160    CustomLog ${APACHE_LOG_DIR}/wp.dhammikalalantha.com-access.log combined
    161161</VirtualHost>
    162162}}}
    163163
     164We are going to host a moodle site too. Add a configuration file as below.
     165
     166{{{
     167sudo nano /etc/apache2/sites-available/lms.your_domain.com.conf
     168}}}
     169
     170{{{
     171<VirtualHost *:80>
     172    ServerName lms.dhammikalalantha.com
     173    ServerAlias lms.dhammikalalantha.com
     174    ServerAdmin webmaster@lms.dhammikalalantha.com
     175    DocumentRoot /var/www/lms.dhammikalalantha.com/public_html
     176
     177    <Directory /var/www/lms.dhammikalalantha.com/public_html>
     178        Options -Indexes +FollowSymLinks
     179        AllowOverride All
     180    </Directory>
     181
     182    ErrorLog ${APACHE_LOG_DIR}/lms.dhammikalalantha.com-error.log
     183    CustomLog ${APACHE_LOG_DIR}/lms.dhammikalalantha.com-access.log combined
     184</VirtualHost>
     185}}}
     186
    164187Once we do the configurations we have to enable the created sites as below,
    165188
    166189{{{
    167190sudo a2ensite web.dhammikalalantha.com
    168 sudo a2ensite sales.dhammikalalantha.com
     191sudo a2ensite wp.dhammikalalantha.com
     192sudo a2ensite lms.dhammikalalantha.com
    169193}}}
    170194
     
    180204
    181205Now we are done with configurations of apache virtual hosting.
     206
     207= Registering your Domain Names and DNS configuration for your Domains =
     208
     209As 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.
     210
     211Hope in someway you registered and setup DNS for the domain which you are going to use in your apache server. Now from any network you are able access your apache server hosted web sites through own domain. But we are not completely done. We have to install web sites in your server. Here we will see how to do that. We are going to install a static web site, Wordpress and Moodle in our servers.
     212
     213For the web sub-domain we will create a dummy web site with just a single webpage. Create a file as below,
    182214
    183215{{{
     
    198230}}}
    199231
    200 Also create a similar page for the sales sub-domain.
    201 
    202 Once created with a sample web site we have to change ownership of the directories to the web server user.
     232Once created with the site we have to change ownership of the directories to the web server user.
    203233
    204234{{{
     
    206236}}}
    207237
    208 Now that you have your virtual hosts configured, you can test your setup by going to the domains that you configured in your web browser. Below will be the output for the sites we created.
     238Now that you have your site created and you can test your site by going to the domains in your web browser. Below will be the output for the site we created.
    209239
    210240[[Image(https://ws.learn.ac.lk/raw-attachment/wiki/Csle2022/Agenda/databaseandweb/web4.png)]]