change apache2 default directory

I have an Ubuntu 10.04 LTS profile, apache2, ISPconfig installed…

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 in /etc/apache2/sites-enabled

and then restarting apache2


Options Indexes FollowSymLinks MultiViews

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

Methinks you should read up on what you are trying to do!

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!

http://httpd.apache.org/docs/2.2/vhosts/examples.html

Generally, but maybe not always, the default site in Apache is a vhost these days. (My Debian was)

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

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct