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> |
| 164 | We are going to host a moodle site too. Add a configuration file as below. |
| 165 | |
| 166 | {{{ |
| 167 | sudo 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 | |
| 206 | |
| 207 | = Registering your Domain Names and DNS configuration for your Domains = |
| 208 | |
| 209 | As 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 | |
| 211 | Hope 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 | |
| 213 | For the web sub-domain we will create a dummy web site with just a single webpage. Create a file as below, |