Merge pull request #84 from garethgreenaway/master

Issue #76 - Hide ini files.
This commit is contained in:
Jaisen Mathai 2011-09-08 16:54:54 -07:00
commit b61d78c23d
8 changed files with 115 additions and 2 deletions

View file

@ -64,6 +64,19 @@ You'll need to make sure that you have named virtual hosts enabled in your Apach
vi /opt/local/apache2/conf/extra/virtualhosts.conf
By default, any access to ini files is denied with a "Not Found" 404 HTTP code. To enable a 404, or Forbidden return code, change the following lines in the virtual host file.
Uncomment:
# 403 Forbidden for ini files
#RewriteRule \.ini$ - [F,NC]
Comment:
# 404 Not Found for ini files
AliasMatch \.ini$ /404
You can put the `NameVirtualHost` directive at the top of the file.
NameVirtualHost *

View file

@ -70,6 +70,18 @@ Now you'll need to replace instances of `/path/to/openphoto/html/directory` with
vi /etc/apache2/vhosts.d/yourdomain.com.conf
By default, any access to ini files is denied with a "Not Found" 404 HTTP code. To enable a 404, or Forbidden return code, change the following lines in the virtual host file.
Uncomment:
# 403 Forbidden for ini files
#RewriteRule \.ini$ - [F,NC]
Comment:
# 404 Not Found for ini files
AliasMatch \.ini$ /404
### PHP
You should also verify that your `php.ini` file has a few important values set correctly.

View file

@ -73,6 +73,18 @@ Now you'll need to replace instances of `/path/to/openphoto/html/directory` with
vi /etc/apache2/sites-enabled/openphoto-vhost.conf
By default, any access to ini files is denied with a "Not Found" 404 HTTP code. To enable a 404, or Forbidden return code, change the following lines in the virtual host file.
Uncomment:
# 403 Forbidden for ini files
#RewriteRule \.ini$ - [F,NC]
Comment:
# 404 Not Found for ini files
AliasMatch \.ini$ /404
### PHP
You should also verify that your `php.ini` file has a few important values set correctly.

View file

@ -0,0 +1,60 @@
OpenPhoto / Installation for Ubuntu
=======================
#### OpenPhoto, a photo service for the masses
### Prerequisites
#### Cloud Accounts
Before setting up your server you'll need to make sure you have your cloud accounts set up. If you're using Amazon then make sure you've enabled both S3 and SimpleDb.
* http://aws.amazon.com/simpledb/
* http://aws.amazon.com/s3/
### Starting up an OpenPhoto EC2 Instance
1. Sign Into AWS Management Console.
1. Click AMIs under Images.
1. Search for openphoto-instance.
1. Select the latest version by date or version.
1. Click Launch.
1. Click through EC2 options.
1. Ensure selected security group allow HTTP & SSH access.
1. Click back to Instances and wait for new instance to finish starting.
1. Once started, click on the new instance in the web interface, copy the public DNS information.
### Launching your OpenPhoto site
Now you're ready to launch your OpenPhoto site. Point your browser to your new EC2 host and you'll be taken to a setup screen. You'll need your cloud account credentiato continue.
Once you complete the 3 steps your site will be up and running and you'll be redirected there. The _setup_ screen won't show up anymore. If for any reason you want to go through the setup again you will need to delete the generated config file and refresh your browser.
rm /var/www/yourdomain.com/src/configs/generated/settings.ini
**ENJOY!**
### TroubleShooting
#### Can't write to config directory
Open a terminal or SSH client, using your amazon ec2 ssh public key, ssh into the instance as the ubuntu user using the public DNS information for your instance.
ssh -i amazon-key.pem ubuntu@new-instance.amazonaws.com
Verify the apache user has write access to the /home/ubuntu/openphoto/src/configs directory.
cd /home/ubuntu/openphoto/src/
ls -ld ./configs
drwxr-xr-x 3 www-data www-data 4096 2011-08-20 02:37 configs

View file

@ -6,8 +6,10 @@ OpenPhoto / Guides
1. [Installation on OSX using MacPorts][guideinstallosxmacports]
1. [Installation on SUSE][guideinstallsuse]
1. [Installation on Ubuntu with Cherokee][guideinstallubuntucherokee]
1. [Installation via Amazon EC2 OpenPhoto AMI][guideinstallamazonec2]
[guideinstallubuntuapache]: guides/InstallationUbuntuApache.markdown
[guideinstallosxmacports]: guides/InstallationOSXMacports.markdown
[guideinstallsuse]: guides/InstallationSUSE.markdown
[guideinstallubuntucherokee]: guides/InstallationUbuntuCherokee.markdown
[guideinstallamazonec2]: guides/InstallationUsingOpenPhotoEC2-AMI.markdown

View file

@ -12,6 +12,9 @@
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)\?*$ index.php?__route__=/$1 [L,QSA]
# 403 Forbidden for ini files
#RewriteRule \.ini$ - [F,NC]
AddOutputFilterByType DEFLATE text/plain
AddOutputFilterByType DEFLATE text/html
AddOutputFilterByType DEFLATE text/css
@ -21,6 +24,9 @@
BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
</Directory>
# 404 Not Found for ini files
AliasMatch \.ini$ /404
ExpiresActive On
ExpiresByType text/javascript "A31536000"
ExpiresByType application/x-javascript "A31536000"

View file

@ -11,6 +11,9 @@
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)\?*$ index.php?__route__=/$1 [L,QSA]
# 403 Forbidden for ini files
#RewriteRule \.ini$ - [F,NC]
AddOutputFilterByType DEFLATE text/plain
AddOutputFilterByType DEFLATE text/html
AddOutputFilterByType DEFLATE text/css
@ -20,6 +23,9 @@
BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
</Directory>
# 404 Not Found for ini files
AliasMatch \.ini$ /404
ExpiresActive On
ExpiresByType text/javascript "A31536000"
ExpiresByType application/x-javascript "A31536000"

View file

@ -29,7 +29,8 @@ class SetupController
$imageLibs['GD'] = 'GD';
$errors = self::verifyRequirements($imageLibs);
if($errors !== true)
if(count($errors) > 0)
$step = 0;
else
$errors = '';
@ -338,7 +339,8 @@ class SetupController
$generatedDir = "{$configDir}/generated";
if(file_exists($generatedDir) && is_writable($generatedDir) && !empty($imageLibs))
return true;
# No errors, return empty array
return $errors;
$user = exec("whoami");
if(empty($user))