I need help figuring out how to set up simple static website using Apache

June 14, 2018 370 views

I am a complete newbie in terms of servers and unix systems. I have bought a domain, made a droplet and followed these 2 tutorials:
I have also configured nameservers more than 24 hours ago & set up A records for both "domain" and "www.domain".

All possible tools say that my domain belongs to my droplet. However, the demo page is accessible only by droplet's IP address. I have tried seemingly everything.


<VirtualHost *:80>
    ServerAdmin mkeinviii@gmail.com
    ServerName domain.com
    ServerAlias www.domain.com
    DocumentRoot /var/www/domain.com/public_html
    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined


ServerRoot "/etc/apache2"
ServerName domain.com
Mutex file:${APACHE_LOCK_DIR} default
Timeout 300
KeepAlive On
MaxKeepAliveRequests 100
KeepAliveTimeout 5
HostnameLookups Off
ErrorLog ${APACHE_LOG_DIR}/error.log
LogLevel warn
IncludeOptional mods-enabled/*.load
IncludeOptional mods-enabled/*.conf
Include ports.conf
<Directory />
    Options FollowSymLinks
    AllowOverride None
    Require all denied
<Directory /usr/share>
    AllowOverride None
    Require all granted
<Directory /var/www/>
    Options Indexes FollowSymLinks
    AllowOverride None
    Require all granted
AccessFileName .htaccess
<FilesMatch "^\.ht">
    Require all denied
LogFormat "%v:%p %h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" vhost_combined
LogFormat "%h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" combined
LogFormat "%h %l %u %t \"%r\" %>s %O" common
LogFormat "%{Referer}i -> %U" referer
LogFormat "%{User-agent}i" agent
IncludeOptional conf-enabled/*.conf
IncludeOptional sites-enabled/*.conf

1 comment
  • I cannot answer because it gets rejected as spam. So i'll update here.
    It works, now! DNS took longer to update than expected, probably.

Be the first one to answer this question.