I have installed Apache, Mysql, Webmin & also configured DNS settings for the primary domain but however I want to create a staging site first .i.e. staging.domain.com and then want to make the site live.
I already checked so many articles on Digital Ocean’s forum. Every one has different approach & this all makes it very confusing.
I read these posts but it all seems to have messed up. Can some one please provide an easy way to deal with this?
Thanks in Advance.
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
Maybe use A records instead of CName…
When you create your a records, you just need to put in the sub-domain (calis) rather than the full domain (calis.kludgecruft.com)
the only other thing I have noticed is that you are using DocumentRoot /var/www/html for your top-level domain, while your other sites are sub-directories. I wonder if that could be causing some conflict.
You probably know this already, but just to check:
files in /etc/apache2/sites-enabled/ are symlinks to the files in sites-available. As such, if you were renaming your config files, you should delete all those symlinks, then rename the actual files in /sites-available/ and then re-enable all of your sites…(as opposed to just renaming symlinks in/etc/apache2/sites-enabled/)
try using <VirtualHost *:80> rather than: <VirtualHost 104.236.80.93:80>
Maybe this if you want to use .htaccess:
<VirtualHost *:80>
ServerAdmin webmaster@localhost
DocumentRoot /var/www/staging
ServerAlias www.staging.domain.com
ServerName staging.domain.com (or whatever name you gave it)
<Directory /var/www/staging>
Options Indexes FollowSymLinks MultiViews
AllowOverride all
Order allow,deny
allow from all
Require all granted
</Directory>
ErrorLog ${APACHELOGDIR}/error.log
CustomLog ${APACHELOGDIR}/error.log/access.log combined
</VirtualHost>
Maybe this if you want to use .htaccess:
<VirtualHost *:80>
ServerAdmin webmaster@localhost
DocumentRoot /var/www/staging
ServerAlias www.staging.domain.com
ServerName staging.domain.com (or whatever name you gave it)
<Directory /var/www/staging>
Options Indexes FollowSymLinks MultiViews
AllowOverride all
Order allow,deny
allow from all
Require all granted
</Directory>
ErrorLog ${APACHELOGDIR}/error.log
CustomLog ${APACHELOGDIR}/error.log/access.log combined
</VirtualHost>
Maybe this if you want to use .htaccess:
<VirtualHost *:80>
ServerAdmin webmaster@localhost
DocumentRoot /var/www/staging
ServerAlias www.staging.domain.com
ServerName staging.domain.com (or whatever name you gave it)
<Directory /var/www/staging>
Options Indexes FollowSymLinks MultiViews
AllowOverride all
Order allow,deny
allow from all
Require all granted
</Directory>
ErrorLog ${APACHELOGDIR}/error.log
CustomLog ${APACHELOGDIR}/error.log/access.log combined
</VirtualHost>
Maybe this if you want to use .htaccess:
<VirtualHost *:80>
ServerAdmin webmaster@localhost
DocumentRoot /var/www/staging
ServerAlias www.staging.domain.com
ServerName staging.domain.com (or whatever name you gave it)
<Directory /var/www/staging>
Options Indexes FollowSymLinks MultiViews
AllowOverride all
Order allow,deny
allow from all
Require all granted
</Directory>
ErrorLog ${APACHELOGDIR}/error.log
CustomLog ${APACHELOGDIR}/error.log/access.log combined
</VirtualHost>
Maybe this if you want to use .htaccess:
<VirtualHost *:80>
ServerAdmin webmaster@localhost
DocumentRoot /var/www/staging
ServerAlias www.staging.domain.com
ServerName staging.domain.com (or whatever name you gave it)
<Directory /var/www/staging>
Options Indexes FollowSymLinks MultiViews
AllowOverride all
Order allow,deny
allow from all
Require all granted
</Directory>
ErrorLog ${APACHELOGDIR}/error.log
CustomLog ${APACHELOGDIR}/error.log/access.log combined
</VirtualHost>
NOTE: the DNS record you create might take awhile to propagate, so be patient…sleep on it before panicking and re-editing all of your files…
NOTE: the DNS record you create might take awhile to propagate, so be patient…sleep on it before panicking and re-editing all of your files…
This comment has been deleted