By richgcook
Hi folks,
I have added two domains to my droplet (rd-ck.com and braw.io) – both seem to be set up correctly.
I’m then running rd-ck.com from the /var/www/html/ directory and braw.io from the /var/www/braw.io/ directory. I also have a sub-domain set up dev.rd-ck.com which seems to be working fine.
I have just added a braw.io.conf file to /etc/apache2/sites-available, and enabled the .conf file using a2ensite and this is what it contains:
<VirtualHost *:80>
ServerAdmin webmaster@localhost
ServerName braw.io
DocumentRoot /var/www/braw.io
<Directory /var/www/braw.io/>
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
<IfModule mod_dir.c>
DirectoryIndex index.php index.pl index.cgi index.html index.xhtml index.htm
</IfModule>
RewriteEngine on
RewriteCond %{SERVER_NAME} =braw.io
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
</VirtualHost>
However it braw.io seems to be showing the contents of /var/www/html/ and not /var/www/braw.io/
I have ran a apache2ctl -S command and this is the output:
root@dev:~# apache2ctl -S
AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1. Set the 'ServerName' directive globally to suppress this message
VirtualHost configuration:
*:443 is a NameVirtualHost
default server rd-ck.com (/etc/apache2/sites-enabled/000-default-le-ssl.conf:2)
port 443 namevhost rd-ck.com (/etc/apache2/sites-enabled/000-default-le-ssl.conf:2)
alias www.rd-ck.com
port 443 namevhost dev.rd-ck.com (/etc/apache2/sites-enabled/dev.rd-ck.com-le-ssl.conf:2)
*:80 is a NameVirtualHost
default server 127.0.1.1 (/etc/apache2/sites-enabled/000-default.conf:1)
port 80 namevhost 127.0.1.1 (/etc/apache2/sites-enabled/000-default.conf:1)
port 80 namevhost braw.io (/etc/apache2/sites-enabled/braw.io.conf:1)
port 80 namevhost dev.rd-ck.com (/etc/apache2/sites-enabled/dev.rd-ck.com.conf:1)
ServerRoot: "/etc/apache2"
Main DocumentRoot: "/var/www/html"
Main ErrorLog: "/var/log/apache2/error.log"
Mutex watchdog-callback: using_defaults
Mutex rewrite-map: using_defaults
Mutex ssl-stapling-refresh: using_defaults
Mutex ssl-stapling: using_defaults
Mutex ssl-cache: using_defaults
Mutex default: dir="/var/lock/apache2" mechanism=fcntl
Mutex mpm-accept: using_defaults
PidFile: "/var/run/apache2/apache2.pid"
Define: DUMP_VHOSTS
Define: DUMP_RUN_CFG
User: name="www-data" id=33
Group: name="www-data" id=33
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
This comment has been deleted
Hello,
Indeed as azaraks you could try creating a Vhost for port 443. In order to do that you would need an SSL certificate.
I would suggest just using Let’s Encrypt and certbot, that way certbot would generate the Vhost for port 443 automatically for you.
You could follow the steps on how to do that here:
Regards, Bobby
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.