change apache2 default directory
basically I followed the ISPconfig setup found in the Linode library.
I would like to change the Apache2 default page from /var/www to /var/www/mywebsite
I have tried doing may things. Some required me deploying a new Linux distribution.
The closest I got I think is adding some code under
and then restarting apache2
AllowOverride None
Order allow,deny
allow from all
#####This is the line I added
RedirectMatch ^/$ /mywebsite/
But I got a 403 Forbidden error
Can anyone help please?
Thanks
2 Replies
Now I'm not sure exactly how ISPconfig does things, but a standard Apache2 install comes with the home directory pointing at /var/www however it looks like your server already has virtual hosts enabled. Virtual hosts allow you to host multiple sites on one server and point folders in any directory to the internet.
Now it looks like you could possibly use just mod_rewrite and a basic install of Apache2 to accomplish what you want, but you already have virtual hosts configured so I say use them!
Here is a great tutorial that should get you up to speed in no time. Be patient! Apache2 can be frustrating but it seems like every day I learn something new about it!
In sites-available, you should have a file called default. If you edit this you will find a bunch of references to /var/www
Change these to /var/www/mywebsite and save this file
Create the directory mywebsite in /var/www
Add a dummy index.html file with just a bit of text in it
Restart Apache and give it a go
See if this gets you started