I am trying to install Phabricator on Centos, I have followed all steps of installation, but I am getting Request parameter '__path__' is not set. Your rewrite rules are not configured correctly.
Bellow is the virtual host entries.
<VirtualHost *:80>
ServerAdmin test#test.com
ServerName phabricator.test.com
DocumentRoot /var/www/html/myapps/phabricator/webroot/
RewriteEngine on
RewriteRule ^/rsrc/(.*) - [L,QSA]
RewriteRule ^/favicon.ico - [L,QSA]
RewriteRule ^(.*)$ /index.php?__path__=$1 [B,L,QSA]
ErrorLog logs/phabricator.test.com-error_log
CustomLog logs/phabricator.test.com-access_log common
<Directory "/var/www/html/myapps/phabricator/webroot/">
Order allow,deny
Allow from all
</Directory>
Any help would be appreciated.
RewriteRule ^(.*)$ /index.php?__path__=$1 [B,L,QSA]
I just kept above line in virtual host. Have removed following lines and restarted apache. Its working now for me.
RewriteRule ^/rsrc/(.*) - [L,QSA]
RewriteRule ^/favicon.ico - [L,QSA]
I'm running phabricator on a centos7 system with apache 2.4.6.
You could use something like this:
NameVirtualHost *:443
<VirtualHost 192.168.0.1:443>
SSLEngine on
SSLCertificateFile /etc/pki/tls/certs/mycert.crt
SSLCertificateKeyFile /etc/pki/tls/private/mykey.pem
ServerName phabricator.myside.local
ServerAlias hostname.myside.local
# Change this to the path where you put 'phabricator' when you checked it
# out from GitHub when following the Installation Guide.
#
# Make sure you include "/webroot" at the end!
DocumentRoot /opt/phabricator/webroot
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteRule ^/rsrc/(.*) - [L,QSA]
RewriteRule ^/favicon.ico - [L,QSA]
RewriteRule ^(.*)$ /index.php?__path__=$1 [B,L,QSA]
</IfModule>
<Directory "/opt/phabricator/webroot">
Require all granted
</Directory>
## mod_php5 directives
<IfModule mod_php5.c>
php_admin_flag engine On
php_value upload_max_filesize 256M
php_value post_max_size 256M
php_value output_buffering 16384
php_admin_value date.timezone 'Europe/Berlin'
php_value include_path '.:/opt/PHPExcel/Classes/'
php_value memory_limit 256M
php_value always_populate_raw_post_data -1
</IfModule>
<LocationMatch "\.(?i:os)$">
ForceType application/octet-stream
Header set Content-Disposition attachment
</LocationMatch>
</VirtualHost>
Reduce the post_max_size and upload_max_filesize depending on your needs. We had some big binaries nested in the git repositories, so we had to increase it :)
Related
I am trying to run laravel from a subfolder but my routes are incorrect.
My main page is loading correctly at mysite.co.uk/folder & the login auth works but it redirects me to mysite.co.uk. If I manually navigate to mysite.com/folder it is logged in correctly but all of the routes are messed up.
mysite.com/page is working but mysite.co.uk/folder/page gives me a 500 internal server error.
.htaccess
<IfModule mod_rewrite.c>
<IfModule mod_negotiation.c>
Options -MultiViews
</IfModule>
RewriteEngine On
# Redirect Trailing Slashes If Not A Folder...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)/$ /$1 [L,R=301]
# Handle Front Controller...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ folder/index.php [L]
</IfModule>
apache.conf
ServerName dev.mysite.co.uk
ServerAlias www.dev.mysite.co.uk
ServerAdmin info#dev.mysite.co.uk
DocumentRoot /home/admin/web/dev.mysite.co.uk/public_html
ScriptAlias /cgi-bin/ /home/admin/web/dev.mysite.co.uk/cgi-bin/
Alias /vstats/ /home/admin/web/dev.mysite.co.uk/stats/
Alias /error/ /home/admin/web/dev.mysite.co.uk/document_errors/
#SuexecUserGroup admin admin
CustomLog /var/log/apache2/domains/dev.mysite.co.uk.bytes bytes
CustomLog /var/log/apache2/domains/dev.mysite.co.uk.log combined
ErrorLog /var/log/apache2/domains/dev.mysite.co.uk.error.log
<Directory /home/admin/web/dev.mysite.co.uk/public_html>
AllowOverride All
SSLRequireSSL
Options +Includes -Indexes +ExecCGI
php_admin_value open_basedir /home/admin/web/dev.mysite.co.uk:/home/admin/tmp
php_admin_value upload_tmp_dir /home/admin/tmp
php_admin_value session.save_path /home/admin/tmp
</Directory>
<Directory /home/admin/web/dev.mysite.co.uk/stats>
AllowOverride All
</Directory>
SSLEngine on
SSLVerifyClient none
SSLCertificateFile /home/admin/conf/web/ssl.dev.mysite.co.uk.crt
SSLCertificateKeyFile /home/admin/conf/web/ssl.dev.mysite.co.uk.key
SSLCertificateChainFile /home/admin/conf/web/ssl.dev.mysite.co.uk.ca
<IfModule mod_ruid2.c>
RMode config
RUidGid admin admin
RGroups www-data
</IfModule>
<IfModule itk.c>
AssignUserID admin admin
</IfModule>
IncludeOptional /home/admin/conf/web/sapache2.dev.mysite.co.uk.conf*
You can simple change, inside the apache.conf, the
DocumentRoot
to:
/home/admin/web/dev.mysite.co.uk/public_html/folder
So you simple set the Root-Directory to the main site and don't need any further modifications.
I have Ubuntu 14.04.3 LTS server on hyper-v virtual machine.
Mysql 14.14
Apache 2.4.7
php 5.5.9
Owncloud 8.1.3.0
After an unexpected shutdown of vm, main page have redirect loop. All attempts to modify htaccess not successful (i try deleted it, redirect remains). The following configuration of htaccess
<IfModule mod_headers.c>
<IfModule mod_fcgid.c>
<IfModule mod_setenvif.c>
SetEnvIfNoCase ^Authorization$ "(.+)" XAUTHORIZATION=$1
RequestHeader set XAuthorization %{XAUTHORIZATION}e env=XAUTHORIZATION
</IfModule>
</IfModule>
<IfModule mod_env.c>
# Add security and privacy related headers
Header set X-Content-Type-Options "nosniff"
Header set X-XSS-Protection "1; mode=block"
Header set X-Robots-Tag "none"
Header set X-Frame-Options "SAMEORIGIN"
SetEnv modHeadersAvailable true
</IfModule>
# Add cache control for CSS and JS files
<FilesMatch "\.(css|js)$">
Header set Cache-Control "max-age=7200, public"
</FilesMatch>
</IfModule>
<IfModule mod_php5.c>
php_value upload_max_filesize 10G
php_value post_max_size 10G
php_value memory_limit 512M
php_value mbstring.func_overload 0
php_value always_populate_raw_post_data -1
php_value default_charset 'UTF-8'
php_value output_buffering off
<IfModule mod_env.c>
SetEnv htaccessWorking true
</IfModule>
</IfModule>
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteRule .* - [env=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
RewriteRule ^\.well-known/host-meta /public.php?service=host-meta [QSA,L]
RewriteRule ^\.well-known/host-meta\.json /public.php?service=host-meta-json [QSA,L]
RewriteRule ^\.well-known/carddav /remote.php/carddav/ [R=301,L]
RewriteRule ^\.well-known/caldav /remote.php/caldav/ [R=301,L]
RewriteRule ^apps/calendar/caldav\.php remote.php/caldav/ [QSA,L]
RewriteRule ^apps/contacts/carddav\.php remote.php/carddav/ [QSA,L]
RewriteRule ^remote/(.*) remote.php [QSA,L]
RewriteRule ^(build|tests|config|lib|3rdparty|templates)/.* - [R=404,L]
RewriteRule ^(\.|autotest|occ|issue|indie|db_|console).* - [R=404,L]
</IfModule>
<IfModule mod_mime.c>
AddType image/svg+xml svg svgz
AddEncoding gzip svgz
</IfModule>
<IfModule mod_dir.c>
DirectoryIndex index.php index.html
</IfModule>
AddDefaultCharset utf-8
Options -Indexes
<IfModule pagespeed_module>
ModPagespeed Off
</IfModule>
ErrorDocument 403 /core/templates/403.php
ErrorDocument 404 /core/templates/404.php
And apache config
<VirtualHost *:80>
#ServerName ***
ServerAdmin ***
DocumentRoot /var/www/owncloud
<Directory /var/www/owncloud>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Require all granted
</Directory>
LogLevel warn
ErrorLog ${APACHE_LOG_DIR}/owncloud-error.log
CustomLog ${APACHE_LOG_DIR}/owncloud-access.log combined
</VirtualHost>
DROP TABLE oc_storagecharts2;
DROP TABLE oc_storagecharts2_uconf;
rm -rf /var/www/owncloud/apps/storagecharts2
This helped me.
OK, so I know that nearly every variety of this question has been asked and answered on this forum, and many others, but I just can't seem to get it right. My hope is that if I provide enough specifics, including the process I'm following, that someone will be able to spot my error and correct me. Here goes!
The Specifics
Drupal multi-site
Apache web server
Sites provisioned by Aegir
What I want to accomplish vs what I have accomplished
I want to direct all http and https traffic to https://www.example.com. The following examples marked with a + have been accomplished; the one marked with - eludes me:
+ http://example.com -> https://www.example.com
+ http://www.example.com -> https://www.example.com
+ https://www.example.com -> https://www.example.com #redundant, but at least we know it works
- https://example.com -> https://www.example.com
What I'm doing
Each site has a vhost file generated by Aegir, and each of these vhost files contains two VirtualHost directives:
<VirtualHost 0.0.0.0:443>
<VirtualHost *:80>
I've modified example.com's vhost file to include the following code under the <VirtualHost *:80> directive, which has successfully achieved the three working examples above:
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{HTTP_HOST} ^example\.com$ [NC]
RewriteRule (.*) https://www.example.com$1 [R=301,L]
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}
</IfModule>
The Problem
What I can't seem to figure out is how to enact the https://example.com -> https://www.example.com rewrite. I've tried many examples found on the Internet under both the <VirtualHost 0.0.0.0:443> and <VirtualHost *:80> directives with no luck.
Also, I'm reloading Apache and clearing my browser's cache after each edit of the vhost file. Any insight, guidance or correction would be much appreciated.
Thanks to all!
Edit:
Below is a redacted version of my vhost file:
<VirtualHost 0.0.0.0:443>
DocumentRoot /var/www/drupal
ServerName example
SetEnv db_type mysql
SetEnv db_name example
SetEnv db_user example
SetEnv db_passwd 1234567
SetEnv db_host somedb
SetEnv db_port 1234
# Enable SSL handling.
SSLEngine on
SSLCertificateFile /ssl.d/example/example.crt
SSLCertificateKeyFile /ssl.d/example/example.key
SSLCertificateChainFile /ssl.d/example/example_chain.crt
ServerAlias example.com
ServerAlias www.example.com
<IfModule mod_rewrite.c>
RewriteEngine on
# this isn't working; neither has anything else that I've tried here.
RewriteCond %{HTTP_HOST} !^www\.
RewriteRule ^(.*)$ https://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
</IfModule>
# Extra configuration from modules:
# Error handler for Drupal > 4.6.7
<Directory "/var/www/drupal/sites/example/files">
<Files *>
SetHandler This_is_a_Drupal_security_line_do_not_remove
</Files>
Options None
Options +FollowSymLinks
# If we know how to do it safely, disable the PHP engine entirely.
<IfModule mod_php5.c>
php_flag engine off
</IfModule>
</Directory>
# Prevent direct reading of files in the private dir.
# This is for Drupal7 compatibility, which would normally drop
# a .htaccess in those directories, but we explicitly ignore those
<Directory "/var/www/drupal/sites/example/private/" >
<Files *>
SetHandler This_is_a_Drupal_security_line_do_not_remove
</Files>
Deny from all
Options None
Options +FollowSymLinks
# If we know how to do it safely, disable the PHP engine entirely.
<IfModule mod_php5.c>
php_flag engine off
</IfModule>
</Directory>
</VirtualHost>
<VirtualHost *:80>
DocumentRoot /var/www/drupal
ServerName example
SetEnv db_type mysql
SetEnv db_name example
SetEnv db_user example
SetEnv db_passwd 1234567
SetEnv db_host somedb
SetEnv db_port 1234
ServerAlias example.com
ServerAlias www.example.com
<IfModule mod_rewrite.c>
# these rules work for everything except:
# https://example.com -> https://www.example.com
RewriteCond %{HTTP_HOST} ^example\.com$ [NC]
RewriteRule (.*) https://www.example.com$1 [R=301,L]
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}
</IfModule>
# Extra configuration from modules:
# Error handler for Drupal > 4.6.7
<Directory "/var/www/drupal/sites/example/files">
<Files *>
SetHandler This_is_a_Drupal_security_line_do_not_remove
</Files>
Options None
Options +FollowSymLinks
# If we know how to do it safely, disable the PHP engine entirely.
<IfModule mod_php5.c>
php_flag engine off
</IfModule>
</Directory>
# Prevent direct reading of files in the private dir.
# This is for Drupal7 compatibility, which would normally drop
# a .htaccess in those directories, but we explicitly ignore those
<Directory "/var/www/drupal/sites/example/private/" >
<Files *>
SetHandler This_is_a_Drupal_security_line_do_not_remove
</Files>
Deny from all
Options None
Options +FollowSymLinks
# If we know how to do it safely, disable the PHP engine entirely.
<IfModule mod_php5.c>
php_flag engine off
</IfModule>
</Directory>
</VirtualHost>
OK now I get it with the content of your virtualhost.
This is not valid:
RewriteCond %{HTTP_HOST} !^www\.
RewriteRule ^(.*)$ https://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
Actually you can't use %{HTTP_HOST} or %{REQUEST_URI} in the RewriteRule part
That's why it's redirecting you to a non-existent host, hence the connection refused error.
You should use this rule in the ssl virtualhost:
RewriteEngine on
RewriteCond %{HTTP_HOST} ^example\.com$ [NC]
RewriteRule (.*) https://www.example.com$1 [R=301,L]
And this one in the non ssl one:
RewriteEngine on
RewriteCond %{HTTPS} off
RewriteRule (.*) https://www.example.com$1 [R=301,L]
HTH
I have two apache servers both have identical settings, I cloned the apache config files, and changed the ServerName part only. When I type mysite.com/somestuff it should rewrite to index.php it does it on my old server, but not my new. I have made sure the .htaccess is there when I do mysite.com/index.php/somestuff it works, but like my first site I need it to work with mysite.com/somestuff.
I am really banging my head against the wall here is my .htaccess and apache config file
#.htaccess file
<IfModule mod_rewrite.c>
Options +FollowSymlinks
RewriteEngine On
RewriteCond %{ENV:REDIRECT_STATUS} ^$
RewriteRule ^app\.php(/(.*)|$) %{CONTEXT_PREFIX}/$2 [R=301,L]
RewriteCond %{REQUEST_FILENAME} -f
RewriteRule .? - [L]
RewriteCond %{REQUEST_URI}::$1 ^(/.+)(.+)::\2$
RewriteRule ^(.*) - [E=BASE:%1]
RewriteRule .? %{ENV:BASE}index.php/ [L]
</IfModule>
<IfModule !mod_rewrite.c>
<IfModule mod_alias.c>
RedirectMatch 302 ^/$ /index.php/
</IfModule>
</IfModule>
<IfModule mod_headers.c>
Header set Access-Control-Allow-Origin "*"
</IfModule>
Now for my apache config
<VirtualHost *:80>
ServerAdmin user#host.com
ServerName mysite.com
DocumentRoot /home/richardw/www/halogen/web
<Directory />
Options FollowSymLinks
AllowOverride All
</Directory>
<Directory /home/richardw/www/halogen/web/>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
My apologizes if this is a repost, but I've been searching all over and i'm about to lose it.
When you go to http://mysite.com/, are you redirected to http://mysite.com/index.php/?
If this is happening, that means mod_rewrite is not loaded in your new server. You need to make sure it's loaded in your apache's server config file. See this answer for some instructions on how that works for apache.
The reason why the redirect is working is because of this container:
<IfModule !mod_rewrite.c>
<IfModule mod_alias.c>
RedirectMatch 302 ^/$ /index.php/
</IfModule>
</IfModule>
This essentially says "if mod_rewrite is not loaded", then if mod_alias is loaded, it redirects the root request to /index.php/. So if the redirect is happening, mod_rewrite is not loaded.
Have you try to comment or remove this line
Options +FollowSymlinks
in your .htaccess?
Trying to set up a ReviewBoard server, using apache 2.2 with fastcgi on Windows 7 (no, Linux isn't an option). I'm using (basically) the default httpd.conf, with mod_fcgid and mod_rewrite loaded, and
Include C:\mars\reviews\conf\apache-fastcgi.conf added at the bottom. This too is the default, excepting the Order, Allow, and +Indexes. The trouble is, when I attempt to load the site, I get 403 for / (which, according to the rewrite rule, would become reviewboard.fcgi). I added +Indexes to prove that yes, in fact, I can access those directories, so it doesn`t appear to be a permissions problem.
When I add ExecCgi, those 403 errors turn into 404 errors! I'm at my wits end, and over my head.
The contents of C:\mars\reviews\conf\apache-fastcgi.conf (with ServerName redacted):
<IfModule mod_fcgid.c>
AddHandler fcgid-script .fcgi
</IfModule>
<IfModule mod_fastcgi.c>
AddHandler fastcgi-script .fcgi
FastCGIServer "c:/mars/reviews/htdocs/reviewboard.fcgi" -socket "c:/mars/reviews/tmp/fastcgi.sock"
</IfModule>
<VirtualHost *:80>
ServerName #redacted
DocumentRoot "c:/mars/reviews/htdocs"
# Alias static media requests to filesystem
Alias /media "c:/mars/reviews/htdocs/media"
Alias /errordocs "c:/mars/reviews/htdocs/errordocs"
# Error handlers
ErrorDocument 500 /errordocs/500.html
<Directory "c:/mars/reviews/htdocs">
Options +Indexes
AllowOverride All
Order allow,deny
Allow from all
</Directory>
# Direct all other requests to the fastcgi server
RewriteEngine on
<IfModule mod_fcgid.c>
RewriteRule ^/(media.*)$ /$1 [QSA,L,PT]
RewriteRule ^/(errordocs.*)$ /$1 [QSA,L,PT]
</IfModule>
<IfModule mod_fastcgi.c>
RewriteRule ^/(media.*)$ /$1 [QSA,L,PT]
RewriteRule ^/(errordocs.*)$ /$1 [QSA,L,PT]
</IfModule>
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^/(.*)$ /reviewboard.fcgi/$1 [QSA,L]
</VirtualHost>
What on Earth is going wrong here??
It seems to me, that you have mod_fcgid installed, but FastCGIServer-statement is in mod_fastcgi-section. I'd started here.
After speaking with Christian Hammond at ReviewBoard, he pointed me to this django ticket. It turns out that django doesn't support FastCGI on Windows!