Cannot remove registry entries after deployment - django-grappelli

I have a django-grappelli site running on Apache 2.2 using mod_wsgi 3.3 as middleware. And I am having two problems
When I try to delete a registry entry, it just do not make anything...
Also, the popup windows are not opening. It opens on the same page. Can somebody help me?
These problems are happening only on the production site (deployed on Apache)
The configurations I am using are the following:
Operating system: Windows 7 professional Edition
Apache version: 2.2
Django version: 1.4.2
Grappelli version: 2.4.2
Python version: 2.7
WSGI vversion: 3.3 win32 for python 2.7
==========================================
httpd.conf:
WSGIScriptAlias / "C:/Program Files/Apache Software Foundation/Apache2.2/htdocs/OdontoWeb/default.wsgi"
Order deny,allow
Allow from all
Alias /grappelli "C:/Program Files/Apache Software Foundation/Apache2.2/htdocs/OdontoWeb/grappelli"
Order allow,deny
Allow from all
SetHandler None
==========================================
.htaccess:
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ /site.wsgi/$1 [QSA,PT,L]
==========================================

I solve the problem.
CAUSE: When deploying the projectI was placing the folders "admin", "Grappelli" and "templates" in the project root, and setting the variable STATIC_URL on the source "settings.py" with the value '/'.
Then some javascripts could not be accessed.
SOLUTION: To solve the problem, I set the variable STATIC_URL with the value '/static/' and put the three folders within a folder called static in the production version. Hence, all functions started to operate. :D
P.S.: I also edited httpd.conf with these config:
Alias /static "C:/Program Files/Apache Software Foundation/Apache2.2/htdocs/OdontoWeb/static"
<Directory "C:/Program Files/Apache Software Foundation/Apache2.2/htdocs/OdontoWeb/static">
Order allow,deny
Allow from all
</Directory>
<Location "/static">
SetHandler None
</Location>

Related

How to configure SimpleSAMLphp with Acquia platform?

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

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

Local laravel web apps are not working properly after Ubuntu (and apache2) upgrade

After upgrading to Ubuntu 14.04 from 13.10, a new version of apache2 (2.4.7) was installed too. I moved all my local web apps from var/www to var/www/html which is the new default apache2 document root on Ubuntu 14.04.
My web apps are developed with Laravel and run on different vhosts like so: example1.dev, example2.dev. So I also changed the DocumentRoot directive in their configuration files with the correct path.
I can access the home page with no problems but any other route returns a 404 error. What do I need to change to fix this?
ps: During upgrade, the apache2.conf file was completely overwritten.
After updating your DocRoot you generally need to update this section also in your vhost files
<Directory "var/www/html/example.dev/public">
Options +MultiViews
AllowOverride All
<IfVersion < 2.3 >
Order allow,deny
Allow from all
</IfVersion>
<IfVersion >= 2.3>
Require all granted
</IfVersion>
</Directory>
(Just an example)

Deploying Mono MVC in shared hosting environment

I'm not posting on serverfault because the application is under development and I need to test it in Mono, but it could be suitable there too...
I would like not to ask if it's possible to deploy an ASP.NET MVC website on Apache2 VirtualHost, because it is, but rather if it's possible without interfering with PHP configuration.
The long question
Apache's default PHP configuration looks like this
<IfModule mod_php5.c>
AddHandler application/x-httpd-php .php4
AddHandler application/x-httpd-php .php5
AddHandler application/x-httpd-php .php
AddHandler application/x-httpd-php-source .php4s
AddHandler application/x-httpd-php-source .php5s
AddHandler application/x-httpd-php-source .phps
DirectoryIndex index.php4
DirectoryIndex index.php5
DirectoryIndex index.php
</IfModule>
And this tells Apache that .php files are PHP scripts.
OK...
Now if I enable mod_mono on server, it maps .aspx files to Mono. And that's OK.
But when I enable the test host VirtualHost with a barebone configuration that is perfect for PHP (it's based on mod_macro if you mind the dollars)
<VirtualHost *:80>
ServerName www.$name
ServerAlias $name
<IfModule mpm_itk_module>
AssignUserID $user $user
</IfModule>
ErrorLog /path/tp/$name/logs/error_log
CustomLog /path/to/$name/logs/access_log combined
DocumentRoot /path/to/$name/htdocs
ServerAdmin email#email
</VirtualHost>
Then I get a 404 error for the default controller.
I know I can, on my own test server, simply say SetHandler mono and voilà. But the question affects general-purpose hosting. Also, I could have the answer by myself: since there is no .aspx file in Razor-MVC (or better paths are mapped to controllers via routers) then I obviously get a 404 error for everything that Apache doesn't recognize as a file.
If I want to deploy this Mono application on a server run by a generalistic hosting provider that supports Mono, or vice versa if I would like to offer (on a production server) hosting for PHP and Mono too without having to change configuration according to customer's demands, could I use an Apache configuration that both satisfies Mono and runs PHP?
The shortened question
How can I configure Apache2 once in order to run both PHP and Mono MVC on the same VirtualHost without changing the configuration according to language the application is written in?
go to this configurator
http://go-mono.com/config-mod-mono/
it provide auto make config for Apache2, based on virtualHost.
Now i'm using mod_mono and mod_php5 jointly.

How to configure Apache to run CruiseControl.NET dashboard with mod_aspdotnet

I have installed CruiseControl.NET and VisualSVN Server on my development server. Rather than running CruiseControl.NET Web Dashboard off IIS, I would like to run it off the Apache that VisualSVN Sever installs. I stumbled onto this question on Stackoverflow, and it has helped a lot.
I have the following config in the http-custom.conf file in the "C:\Program Files\VisualSVN Server\conf" folder.
LoadModule aspdotnet_module bin/mod_aspdotnet.so
AddHandler asp.net asax ascx ashx asmx aspx axd config cs csproj licx rem resources resx soap vb vbproj vsdisco webinfo
<IfModule mod_aspdotnet.cpp>
AspNetMount /ccnet "C:/Program Files/CruiseControl.NET/webdashboard"
AliasMatch /ccnet/(.*\.aspx.*) "C:/Program Files/CruiseControl.NET/webdashboard/default.aspx"
Alias /ccnet/ "C:/Program Files/CruiseControl.NET/webdashboard/"
<Directory "C:/Program Files/CruiseControl.NET/webdashboard">
Options FollowSymlinks ExecCGI
# Order allow,deny
# Allow from all
DirectoryIndex default.aspx
</Directory>
AliasMatch /aspnet_client/system_web/(\d+)_(\d+)_(\d+)_(\d+)/(.*) "C:/Windows/Microsoft.NET/Framework/v$1.$2.$3/ASP.NETClientFiles/$4"
<Directory "C:/Windows/Microsoft.NET/Framework/v*/ASP.NETClientFiles">
Options FollowSymlinks
# Order allow,deny
# Allow from all
</Directory>
</IfModule>
This works fine, except http://localhost/ccnet (notice the missing trailing slash) does not bring up the CruiseControl.NET dashboard, whereas http://localhost/ccnet/ does.
Also, I have had to comment out the Order and Allow directives in the two Directory sections. The VisualSVN Service fails to start if I uncomment any of those 4 commented out directives.
What's up with that?
VisualSVN Server.exe (which is really httpd.exe) reports version number as 2.2.13.0 and mod_aspdotnet.so reports version number as 2.2.0.2006.
It's a bad idea to use mod_aspdotnet since it is not supported for three years and have some critical bugs. Another bad thing that mod_aspdotnet compiled with different settings and could be incompatible with VisualSVN Server binaries.
I recommend you to run CruiseControl.NET on IIS and then reverse proxy requests from VisualSVN Server to IIS. All required modules is already available in VisualSVN Server distribution. Just add the following lines to your httpd-custom.conf (assuming that you running IIS on port 8080)
LoadModule proxy_module bin/mod_proxy.so
LoadModule proxy_http_module bin/mod_proxy_http.so
ProxyPass /ccnet http://localhost:8080/ccnet
ProxyPassReverse /ccnet http://localhost:8080/ccnet
1/ Make sure you use the latest mod. It's name is mod_aspdotnet-2.2.0.2006-setup-r2.msi
2/ Modify the AliasMatch line as follow
AliasMatch "^/(?i)aspnet_client/system_web/(\d+)_(\d+)_(\d+)_(\d+)/(.*)" \
"C:/Windows/Microsoft.NET/Framework/v$1.$2.$3/ASP.NETClientFiles/$4"
3/ Add this line after Options FollowSymlinks ExecCGI in your webdashboard directory secction
AspNet files
4/ Add Win32DisableAcceptEx on line ... I remember one machine nedded it .. but it was only on Xp installs, not Server2003 or other edition.