How to configure SimpleSAMLphp with Acquia platform? - apache

I'm following the instruction on Acquia's site https://docs.acquia.com/articles/using-simplesamlphp-acquia-cloud-site about configuring SimpleSAMLphp and it just seems the documentation is not very precise. In their documentation it says to run the following command to install SimpleSAMLphp library.
cd docroot; ln -s ../simplesamlphp/www simplesaml
And to install the Install the simplesamlphp_auth Drupal module, they linked to the simpleSAMLphp Authentication page, https://www.drupal.org/project/simplesamlphp_auth. And in the SimpleSAMLphp Installation, it's linked to the SimpleSAMLphp Installation and Configuration page, https://simplesamlphp.org/docs/stable/simplesamlphp-install. However, the instruction in this page looks just like what I've done in the second step of Acquia's documentation. Instead of extract the simplesamlphp-1.x.y alongside the docroot, it suggest to extract it inside the var folder.
Now, once I've gone through the instruction on Acquia's documentation and tried to access the simplesaml, https://mywebsite.dd:8443/simplesaml/, I got the following error:
Forbidden
You don't have permission to access /simplesaml/ on this server.
So I found this thread, Getting a 403 forbidden error for simplesaml after Apache upgrade, that talks about the error which looks like step 6 in the SimpleSAMLphp Installation and Configuration instruction. So I went to the /Applications/DevDesktop/apache/conf/extra/httpd-vhosts.conf and configured the following:
<VirtualHost *:8083>
ServerAdmin userName#mywebsite.com
DocumentRoot "/Users/userName/sites/drupalsites/docroot"
ServerName drupalsites.local
ServerAlias drupalsites.local
ErrorLog "logs/drupalsites-error_log"
CustomLog "logs/drupalsites-access_log" common
<Directory "/Users/userName/sites/drupalsites/docroot">
Options Indexes FollowSymLinks Includes ExecCGI
AllowOverride All
Require all granted
</Directory>
Alias /simplesaml simplesamlphp/www
<Directory "/Users/userName/sites/drupalsites/simplesamlphp/www">
Require all granted
</Directory>
</VirtualHost>
However, I'm still getting the same error.
Forbidden
You don't have permission to access /simplesaml/ on this server.
So, the questions are, did I go about installing SimpleSAMLphp the wrong way? Second, if not, where did I go wrong? Third, how do I resolve this error and back on track again? I have also found this documentation, https://www.chapterthree.com/blog/how-to-configure-simplesamlphp-for-drupal-8-on-acquia, that talks about setting up SimpleSAMLphp on Aquia's plaform but it's not very consistent with other documentations I've listed above. So, I'm not sure which I should follow. Any suggestion is much appreciated.

try adding this to your docroot/.htaccess
RewriteCond %{REQUEST_URI} !^/simplesaml

To be more precise with #realgt answer :
# Copy and adapt this rule to directly execute PHP files in contributed or
# custom modules or to run another PHP application in the same directory.
RewriteCond %{REQUEST_URI} !/core/modules/statistics/statistics.php$
+ # Allow access to simplesaml paths
+ RewriteCond %{REQUEST_URI} !^/simplesaml
# Deny access to any other PHP files that do not match the rules above.
RewriteRule "^.+/.*\.php$" - [F]
This is provided in this link :
https://www.chapterthree.com/blog/how-to-configure-simplesamlphp-for-drupal-8-on-acquia

Related

Can't login to phpMyAdmin on subdomain (no error message)

First of all, I am aware of all the questions here on SO with very similar titles, but none of the solutions described there worked for me.
My case is a little bit more specific than those questions. I have a domain name pointing to my own server (Ubuntu 17.04, Apache 2.4). On the server, there is a freshly installed instance of phpMyAdmin. When I'm accessing phpMyAdmin's site using domain.com/phpmyadmin it works fine, and I can log in.
What I am trying to achieve is to access phpMyAdmin from a subdomain (ex. php.domain.com). I have the virtual host set up and when I try to access the site, the login page is working just fine, but when I enter my username and password, nothing happens (as opposed to the domain.com/phpmyadmin method, which works just fine), not even an error message.
What I have tried:
Verify that session.save_path is valid and writeable
Reinstall phpMyAdmin and MySQL
The following is the apache virtual host config file for the subdomain
<VirtualHost *:80>
ServerName php.domain.com
DocumentRoot "/usr/share/phpmyadmin"
<Directory "/usr/share/phpmyadmin">
allow from all
Options None
Require all granted
</Directory>
# RewriteEngine on
# RewriteCond %{SERVER_NAME} =php.domain.com
# RewriteRule ^ http://%{SERVER_NAME}%{REQUEST_URI} [END,QSA,R=permanent]
</VirtualHost>
Why is it that I can't login from the subdomain, but I can from domain.com/phpmyadmin and what shoud I do to make it work?
Apparently all I had to do was delete the cookies in Chrome.

Apache won't autoindex

Oracle Linux 7.3 (RHEL derivative)
Apache 2.4.6
I'm setting up a repository in /srv/www for yum, scripts, and kickstart files, served via httpd. I want an auto-index, so I don't have any index.html. And, this is the only thing this internal server will do. So, httpd.conf:
DocumentRoot "/srv/www"
<Directory "/srv/www">
AllowOverride all
Options Indexes FollowSymLinks
Require all granted
</Directory>
However, I still get the error message:
[autoindex:error] [pid 12345] [client <IP address>:<port>] AH01276: Cannot serve directory /srv/www: No matching DirectoryIndex (index.html) found, and server-generated directory index forbidden by Options directive.
Except that the Options directive allows auto-indexing! I've tried Options All. I've tried Options +Indexes +FollowSymLinks. I've looked at 7 or 8 Google hits. Nothing is working.
Setting LogLevel debug doesn't increase messaging.
What have I missed?
As noted here, in the absence of an index.html (or other configured index file), the welcome page configured at /etc/httpd/conf.d/welcome.conf will take precedence over other configurations via its LocationMatch directive. Rename the file so it doesn't end in .conf and auto-indexing works.
Obviously landing in another virtualhost or Directory without indexes enabled, or a .htaccess getting in the way.
Set "AllowOverride none" first, since it is absurd to have it active if you are not using any .htaccess file (and since you have access to the main server you don't need it). Once you set AllowOverride, restart the server in case you added Indexes recently and didn't restart to apply changes.
If the issue persists, run apachectl -S and make sure you are landing in the correct virtualhost.
I just want to add that, after updating my mac to Catalina, my apache stopped working with that same error.
I had to:
uncomment the required modules (php7, rewrite, directory, etc...)
add a + sign to the Options (Options +FollowSymLinks +Multiviews +Indexes)
This worked for me.
Solution:
Ensure two apache modules are running:
mod_autoindex.so
mod_dir.so
In your case, mod_autoindex.so is running. Now enable the second one.
PS: Keep Options -Indexes. It's important. It makes sure that directory listings are disabled, as you shouldn't allow anyone to pay a visit to every directory on your server (some with rather private content such as CMS's directories).

Where do you find the interface for phpmyadmin when installed using homebrew

I installed phpmyadmin using homebrew
brew install phpmyadmin
The output came back as follows:
Note that this formula will NOT install mysql. It is not
required since you might want to get connected to a remote
database server.
Webserver configuration example (add this at the end of
your /etc/apache2/httpd.conf for instance) :
Alias /phpmyadmin /usr/local/share/phpmyadmin
<Directory /usr/local/share/phpmyadmin/>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
<IfModule mod_authz_core.c>
Require all granted
</IfModule>
<IfModule !mod_authz_core.c>
Order allow,deny
Allow from all
</IfModule>
</Directory>
Then, open http://localhost/phpmyadmin
More documentation : file:///usr/local/Cellar/phpmyadmin/4.3.11.1/share/phpmyadmin/doc/
Configuration has been copied to /usr/local/etc/phpmyadmin.config.inc.php
Don't forget to:
- change your secret blowfish
- uncomment the configuration lines (pma, pmapass ...)
==> Summary
🍺 /usr/local/Cellar/phpmyadmin/4.3.11.1: 1,898 files, 55.2M, built in 2 seconds
I updated httpd.conf with that block of details. I also updated my blowfish and uncommented the configuration lines as it states.
When I go to localhost/phpmyadmin i get a 404 error.
Any ideas where I would find the interface so I can more easily build/update my database(s).
I experienced this problem, too.
In order to use phpMyAdmin in your apache, you have to make symbolic link in /usr/local/var/www/htdocs with this command. (If you didn't changed your DocumentRoot)
cd /usr/local/var/www/htdocs
ln -s /usr/local/Cellar/phpmyadmin/4.3.11.1/share/phpmyadmin ./phpmyadmin

Change path chiliproject

I want to use a subdirectory for a chiliproject instance. Using apache passenger, I was thinking of using rewrites + alias, but then it gives me a 404. Adding a RailsBaseURI i get connection reset.
Is it routes.rb I should adapt or am I looking at the wrong place? It is working right now on https://mydomain.com but I'd like to have it on https://mydomain.com/tracker
You can use passenger directly without having to use an alias or redirection. However, Passenger requires some special configuration for that. Please see one of our guides for a complete installation example.
Generally you need to configure similar to this (cited from the linked guide):
At first, we assume you have installed ChiliProject to /srv/www/chiliproject. This is not your DocumentRoot.
You need to hint Passenger a bit here so that it correctly finds your ChiliProject. So we create a symlink from the existing DocumentRoot directory to out ChiliProject installation.
ln -s /srv/www/chiliproject/public DOCUMENTROOT/chiliproject
Now add the following directives into your existing virtual host:
# TODO: Remember to replace DOCUMENTROOT with your actual path
<Directory DOCUMENTROOT>
Options +SymLinksIfOwnerMatch
</Directory>
RailsBaseURI /chiliproject
# TODO: Remember to replace DOCUMENTROOT with your actual path
<Directory DOCUMENTROOT/chiliproject>
Options -MultiViews
Order deny,allow
Allow from all
</Directory>

Magento not accessible since tried to move to multi website setup. Apache issue?

I wish I had never seen this article:
http://www.magentocommerce.com/knowledge-base/entry/tutorial-multi-site-multi-domain-setup
I have Apache 2.2 installed on my XP machine and until a while ago I had a Magento site that I could test the development of a custom module on. I decided that I wanted to have multiple websites and multiple stores so that I could test that my modules configuration variables set at the different scopes (global, website, and store) were working as expected.
So I followed the instructions in the above Magento article. I created a website and gave it a name of “paulsplace.com”. I created a couple of Stores under that website. I then went to System/Configuration/General/Web and, with the scope set to paulsplace.com, I set the unsecured and secured URLs to http://paulsplace.com/ and https://paulsplace.com/ and hit Save Config - what a mistake!!
I got a 404 error. And now I can’t get to my magento front end or back end.
I tried a couple of things:
I added these lines to my hosts lookup file:
127.0.0.1 paulsplace.com
127.0.0.1 www.paulsplace.com
I then uncommented this line in my httpd,conf file:
Include conf/extra/httpd-hosts.conf
and added the following to the conf/extra/httpd-hosts.conf file:
<VirtualHost *:80>
ServerAdmin me#myemail.com
DocumentRoot "C:/Applications/Apache Software Foundation/Apache2.2/htdocs"
ServerName paulsplace.com
ErrorLog "logs/paulsplace.com-error.log"
CustomLog "logs/paulsplace.com-access.log" common
</VirtualHost>
and restarted Apache.
If I browse to “http://www.paulsplace.com” I now get a page that just says “It works!”. Same for “http://paulsplace.com” and “http://www.paulsplace.com/magento/index.php”.
I tried a few more things - I added this line to httpd.conf:
AccessFileName htaccess
(I did this because Windows Explorer didn’t let me create a file starting with a dot; I could do it from the command prompt, but I believe what I have done should be ok).
I changed AllowOverride to All from None:
<Directory />
Options FollowSymLinks
AllowOverride All
Order deny,allow
Deny from all
</Directory>
<Directory "C:/Applications/Apache Software Foundation/Apache2.2/htdocs">
AllowOverride All
</Directory>
and in C:\Applications\Apache Software Foundation\Apache2.2\htdocs\htaccess (a file that I created), I entered:
SetEnvIf Host www\.paulsplace\.com MAGE_RUN_CODE=pws1
SetEnvIf Host www\.paulsplace\.com MAGE_RUN_TYPE=website
SetEnvIf Host ^paulsplace\.com MAGE_RUN_CODE=pws1
SetEnvIf Host ^paulsplace\.com MAGE_RUN_TYPE=website
(pws was the value I used for the “Code” when creating my store).
Please tell me how I can put this right. I feel like I’m taking one step forward and three backward at the moment.
Any help really would be greatly appreciated.
<VirtualHost *:80>
ServerAdmin me#myemail.com
DocumentRoot "Change this to point at your magento install"
ServerName paulsplace.com
ErrorLog "logs/paulsplace.com-error.log"
CustomLog "logs/paulsplace.com-access.log" common
SetEnv MAGE_RUN_TYPE website
SetEnv MAGE_RUN_CODE pws1
</VirtualHost>
If changing anything in System Configuration borks your system, you can always clear out the bad values in the database directly, and clear your Magento cache. Do a
select * from core_config_data where value LIKE '%paulsplace.com%'
This will give you the two rows that were added when you clicked save. Remove the rows. Next, clear out all the files in
var/cache/*
to clear your cache. Then restore your Apache config to what it was before you started monkeying around. This should restore your site back to its previous state, and you can continue to experiment with things.