In Ubuntu 2016.04's default Apache2, I tried to add a virtual host with an alias:
sudo mkdir /var/www/simplesamlphp
echo "Hello" > /var/www/simplesamlphp/index.html (as root)
sudo chown -R www-data:www-data /var/www/simplesamlphp
sudo chmod -R 755 /var/www
Second, I created /etc/apache2/sites-available/simplesamlphp.conf
:
<VirtualHost *>
ServerName simplesamlphp
DocumentRoot /var/www/simplesamlphp
SetEnv SIMPLESAMLPHP_CONFIG_DIR /var/simplesamlphp/config
Alias /simplesaml /var/simplesamlphp/www
<Directory /var/simplesamlphp/www>
<IfModule !mod_authz_core.c>
# For Apache 2.2:
Order allow,deny
Allow from all
</IfModule>
<IfModule mod_authz_core.c>
# For Apache 2.4:
Require all granted
</IfModule>
</Directory>
</VirtualHost>
Third, I added this line to /etc/hosts
:
127.0.0.1 simplesamlphp
Fourth, I ran:
sudo a2enmod rewrite
sudo a2ensite simplesamlphp.conf
sudo service apache2 restart
PROBLEM: Accessing http://simplesamlphp/simplesaml
gives The requested URL /simplesaml was not found on this server
and the following appears in /var/log/apache2/error.log
:
AH00128: File does not exist: /var/www/html/simplesaml
What did I do wrong?
By the way, I am following these instructions. Actually, I am not sure why a DocumentRoot is needed despite all web content being in /var/simplesamlphp/www
.
simplesamlphp.conf
but your file is namedsimplesaml.conf
, your commands use/var/www/simplesamlphp
and your config uses/var/simplesamlphp/www
. Maybe you should go sleep a while. – muru Nov 25 '16 at 11:33simplesamlphp
instead ofservice.example.com
. – Nicolas Raoul Nov 25 '16 at 15:10