Ubuntu
apt-get install apache2
Suppress warning message
Could not reliably determine the server's fully qualified domain name
Add at the bottom of /etc/apache2/apache2.conf
ServerName server_domain_or_IP
e.g. echo "ServerName 127.0.0.1" >> /etc/apache2/apache2.conf
Check for syntax errors:
apache2ctl configtest
Restart Apache to implement your changes:
service apache2 restart
apache2ctl restart
Make sure that UFW has an application profile for Apache like so:
# ufw app list
Available applications:
Apache
Apache Full
Apache Secure
If you look at the Apache Full profile, it should show that it enables traffic to ports 80 and 443:
# ufw app info "Apache Full"
Profile: Apache Full
Title: Web Server (HTTP,HTTPS)
Description: Apache v2 is the next generation of the omnipresent Apache web
server.
Ports:
80,443/tcp
Allow incoming traffic for this profile:
ufw allow in "Apache Full"
Check by visiting: http://localhost/
Stop Nginx interference (if exist) service nginx stop
https://addons.mozilla.org/en-US/firefox/addon/cors-everywhere/
In /etc/apache2/apache2.conf
Change
AllowOverride All
i.e.
<Directory /var/www/>
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>
Run command
a2enmod rewrite
Coppying files to:
/var/www/html/
Gracefully reload its configuration
service apache2 reload
Testing content negotiation with curl
, e.g.:
curl -H "Accept: application/rdf+xml" -L http://150.203.213.249/v0.1
curl -LH "Accept: application/ld+json" http://150.203.213.249/v1.0
curl -LH "Accept: application/n-triples" http://localhost/v1.0
curl -H "Accept: text/turtle" -L http://150.203.213.249/v1.0