Your server is set to not follow symlinks. Add this line:
Options +FollowSymLinks -SymLinksIfOwnerMatch
to your http.conf. For more info: http://www.hackersgarage.com/symbolic-link-not-allowed-or-link-target-not-accessible.html
You will also need to add browse access for others to each folder, all the way up to /home/somekittens/Dropbox/Project/Joomla/. i.e.
sudo chmod o+x /home
sudo chmod o+x /home/somekittens
chmod o+x /home/somekittens/Dropbox
chmod o+x /home/somekittens/Dropbox/Project
chmod o+x /home/somekittens/Dropbox/Project/Joomla
There are two things around.
One is whether Apache is allowed to follow symlinks. Is you link a symlink via ln -s? It is the recommended way but it might be a security issue in some servers and it is disabled many times.
See https://superuser.com/questions/244245/how-do-i-get-apache-to-follow-symlinks for more info on that topic but esentially you need AllowOverride None
as here:
<Directory />
Options FollowSymLinks
</Directory>
Other topic is the permissions.
Windows Partition
As it is a Windows directory (it seems so) the best option will be to follow this guide http://ubuntuforums.org/showthread.php?t=1604251:
Essentially it recommends you to edit the /etc/fstab
The line should be like this one:
/dev/sdb5 /media/Software ntfs-3g defaults, ..., umask=227 0 0
The interesting part is the umask. I will recommend to put the last digit as 6 or 7 for allowing Apache to access.
The recommended way is to use UUID. The steps are:
0) Make a backup of fstab (just in case ;))
sudo cp /etc/fstab /etc/fstab.bak
1) Get the UUID of your hard-drive:
sudo blkid
2) Add the line in fstab
It should be something like this:
UUID=$you_uuid /media/Software ntfs-3g defaults,user,auto,utf8
I have added auto so that it auto mounts. If you don't want that use noauto instead.
This will give it full permission. If you prefer different permissions use dmask=000,fmask=111
as options. Instead of the it uses different numbers than chmod
. If you want you can add also uid=100,gid=100
with the wanted another uid or gid.
References:
https://help.ubuntu.com/community/Fstab
How to automount NTFS partitions?
http://ubuntuforums.org/showthread.php?t=283131
Linux/Unix Partition (if not using Windows partitions)
If it is not a Windows partition the permissions should be in the standard linux way.
The best option is to change the permission of that directory. I will do it in this way:
chgrp -R www-data /media/Software/Program Files/wamp/www/
Also you will need read permission (maybe write) for that directory. It is done in this way:
chmod g+r /media/Software/Program Files/wamp/www
For also adding write:
chmod g+rw /media/Software/Program Files/wamp/www
But again that won't work if the partition is a NTFS partition because Windows do not store permission in the disk in this way.
Best Answer
1. You should configure your /etc/hosts file like that:
Where
test-site
is the second "localhost". Andmy-hostname
is the "System hostname" defined in/etc/hostname
.2. You should define and enable a Virtual Host (VH):
There is a default HTTP VH. It's placed in
/etc/apache2/sites-available/
. The filename is000-default.conf
. You have to edit it (you can rename it, if you want, or make some other .conf files, based on it) and after that you have to enable it.You can enable it manually through creation of "soft, symbolic link":
Or you can use Apache2 tool called a2ensite, which make the same:
Let's assume there has 3 Virtual Hosts, enabled SSL, and registered private domain (SOS.info for an example):
And one which is created for the purposes of this topic:
The content of First 2 VHs is:
$ cat /etc/apache2/sites-available/
http.SOS.info.conf
This one redirects all HTTP requests to HTTPS.
$ cat /etc/apache2/sites-available/
https.SOS.info.conf
This is the HTTPS VH.
The content of these two files can be posted in one file, but in this case their management (
a2ensite
/a2dissite
)will be more difficult.The third Virtual Host is that, which is created for our purposes:
$ cat /etc/apache2/sites-available/
http.test-site.conf
3. With this configuration you should access:
On the main example you should access and:
Try to open the site in the web browser or just try (in the terminal) with next commands:
Of course, you need to have some
index.html
pages in their DocumentRoot :)4. You need properly configured `/etc/apache2/apache2.conf`.
Ii is good idea to spend some time to improve your server's security. These manuals are about the security configuration: 1st and 2nd. Here you can get free SSL certificate. These sites will help you to check your progress: 1st and 2nd.
According to above security manuals
/etc/apache2/apache2.conf
file must looks like:5. Set up the Firewall.
To allow/deny external access to your web server you can use UFW (Uncomplicated Firewall):
To allow only
tcp
protocol use:You can use and the port number directly:
Just in case you can reload the "rules table":
You can use and UFW's GUI interface, called gufw.
Choice the
Office
profile. It will set:Status:ON
,Incoming:Deny
andOutgoing:Allow
and add your rules.6. If you have a router don't forget to forward some ports:
If you have a router and you want your web server to be accessible from Internet, don’t forget to add some port forwarding. Something like this.