In this article we would like to show how to add subdomain as virtual server for apache2 that uses PHP engine with Cloudflare DNS / CDN.
Preseted article configures Open Web Analitics that:
- was installed in own separated folder,
- will be available from:
It is necessary to configure apache2 server at first and later Cloudflare DNS.
1. apache2 server configuration
1.1. login as root to yours server,
1.2. create new configuration file in
sites-avaialble directory with command:
1.3. put inside following configuration:
<VirtualHost *:80> ServerName owa.my-domain.com DocumentRoot /var/www/html/open-web-analytics DirectoryIndex index.php </VirtualHost>
owa.my-domain.com- subdomain used with Open Web Analitics,
/var/www/html/open-web-analytics- directory path with installed Open Web Analitics,
index.php- script that runs Open Web Analitics.
Use following command:
Enabling site open-web-analytics. To activate the new configuration, you need to run: systemctl reload apache2
1.5. Reload apache2 configuration witout restarting
Run following command:
systemctl reload apache2
2. Cloudflare DNS configuration
2.1. login to Cloudflare panel: https://dash.cloudflare.com/login
2.2. select your domain on main page - will be visible after login operation
2.3. go to DNS configuration
2.4. add new DNS record by clicking to: + Add record
2.5. select following configuration:
Type: A Name: owa IPv4 address: 220.127.116.11
18.104.22.168 can be replaced by own configuration.
It will give us traffic from
https://owa.my-domain.comto server located on
22.214.171.124where virtual server described by
ServerName owa.my-domain.comwill be used.
2.6. save configuration and check if new record appeared
3. Check Open Web Analitics in Web Browser
3.1. go to following address:
3.2. as result you should see: