I often find I need to quickly share files with the general public or selected friends. As such I have setup Online Shares with Apache. Continuing our example I will put put a public and private share on krypton as follows,
www.krypton.com/shared/ - accessible by everyone
www.krypton.com/shared.private/ - only accessible by specific people
Also if possible, this setup should allow the website admins to do the setup without the need for the server admin to come in and perform root actions.
Assuming you are logged in as a Staff User created in the Setup Ubuntu Linux Base Server,
Shared - Public Share Folder
cd /home/www.krypton.com sudo mkdir shared # Browseable folder to drop content to share with others sudo mkdir shared.private # Browser password protected folder to drop content to share with others via .htaccess sudo mkdir keys # Place to store keys for protected folder cd /home sudo chown -R serveradmin:wgkryptonian ./www.krypton.com/shared/ sudo chmod -R 775 www.krypton.com/shared/ # Only svradm and users in the kryptonian group can manage. Apache(other's) still need to be able to read and browse.
Here is the original host file,
<VirtualHost *:80> ServerAdmin webmaster@localhost ServerName www.krypton.com ServerAlias www.krypton.com DocumentRoot /home/www.krypton.com/www # This restrictive a precedence for ALL directory blocks. <Directory /> Options FollowSymLinks # This prevents use of .htaccess AllowOverride None </Directory> # Main location of static content for the websites. <Directory /home/www.krypton.com/www/> Options +MultiViews Order Allow,Deny Allow from all </Directory> Alias /shared/ "/home/www.krypton.com/shared" Alias /shared "/home/www.krypton.com/shared" <Directory /home/www.krypton.com/shared> # Make this folder browseable Options +Indexes </Directory> ErrorLog /var/log/apache2/www.krypton.com.error.log # Possible values include: debug, info, notice, warn, error, crit, alert, emerg. LogLevel warn CustomLog /var/log/apache2/www.krypton.com.access.log combined </VirtualHost>
Here is the host file with the Alias updates,
<VirtualHost *:80>
ServerAdmin webmaster@localhost
ServerName www.krypton.com
ServerAlias www.krypton.com
DocumentRoot /home/www.krypton.com/www
# This restrictive a precedence for ALL directory blocks.
<Directory />
Options FollowSymLinks
# This prevents use of .htaccess
AllowOverride None
</Directory>
# Main location of static content for the websites.
<Directory /home/www.krypton.com/www/>
Options +MultiViews
Order Allow,Deny
Allow from all
</Directory>
Alias /shared/ "/home/www.krypton.com/shared"
Alias /shared "/home/www.krypton.com/shared"
<Directory /home/www.krypton.com/shared>
# Make this folder browseable
Options +Indexes
</Directory>
ErrorLog /var/log/apache2/www.krypton.com.error.log
# Possible values include: debug, info, notice, warn, error, crit, alert, emerg.
LogLevel warn
CustomLog /var/log/apache2/www.krypton.com.access.log combined
</VirtualHost>