RE: subdomain with www is not working !!!!
08-07-2018, 03:39 PM
(This post was last modified: 08-07-2018, 03:43 PM by mungujakisa.)
(08-07-2018, 03:08 PM)yusha Wrote: Yeah I have seen that file. Please Give me step by step method if it works for you
Note: Be careful while editing the vhosts file, this can cause apache to stop working if edited wrongly! Also I'm on Ubuntu, I hope it works on CentOS
You can do this by performing the following steps:
- Open /etc/sentora/configs/apache/httpd-vhosts.conf using your favourite editor (I prefer nano). Scroll down till you find the record for your subdomain, which will look like #DOMAIN: sub.domain.com
- Add a new line under the "ServerName" line
Code:ServerAlias www.sub.domain.com
- save the file and exit the editor.
- Go to your host DNS editor (not the one of Sentora) and add an A record. If your subdomain is sub.domain.com, then the A record should be "sub" (leave quotes out) and point to your public IP address. Your DNS should already have a www entry for your main domain, so you can leave it as it is or add it if missing.
- Restart Apache. For me since I'm on ubuntu, I use
Code:service apache2 restart
- Test and see if it works. If it doesn't, you may need to clear your cache; for me I tested on another browser instead of clearing my cache and losing temporary files, it works perfectly.
***********************************************
SAMUEL AVOLA MUNGUJAKISA *
CEO, Bero Computers *
www.berocomputers.com *
+256754086797 *
+256780585402 *
***************************** *
SAMUEL AVOLA MUNGUJAKISA *
CEO, Bero Computers *
www.berocomputers.com *
+256754086797 *
+256780585402 *
***************************** *