i am using cakephp and i need load Module rewrite , but i can not accessing to httpd.conf.
there is way to solve this problem ?
by thanks.
Its not a possibility if you do not have access to conf files.
Modules have to be loaded when Apache start. Nothing cam be done WRT this after Apache has started.
mod_so is used to load modules. Although DSO(Dynamic Shared Object) is used, a restart to the server is required.
from Dynamic Shared Object (DSO) Support:
The DSO support for loading individual Apache modules is based on a module named mod_so which must be statically compiled into the Apache core. It is the only module besides core which cannot be put into a DSO itself. Practically all other distributed Apache modules can then be placed into a DSO by individually enabling the DSO build for them via configure's --enable-module=shared option as discussed in the install documentation. After a module is compiled into a DSO named mod_foo.so you can use mod_so's LoadModule command in your httpd.conf file to load this module at server startup or restart.
If your host has enabled it, you can place an .htaccess file in your CakePHP directory. Its contents must be the same as the ones you would want to write into the httpd.conf file. An example might be:
<IfModule mod_rewrite.c>
RewriteEngine On
# Add your rewrite rules here
RewriteRule ^/somepage$ somepage.php
</IfModule>
Related
We have an older ubuntu 14 server that is currently working and has apache2 running on and I'm attempting to install an open idc module to get SSO working at our company. I know...Ubuntu 14 is old, but that's a whole other can of worms...
When I run
apachectl -M
It successfully shows auth_openidc_module (shared)
I also verified that ‘auth_openidc.conf’ is in my /etc/apache2/mods-enabled directory
However when I add
in my apache2.conf :
LoadModule auth_openidc_module module/mod_auth_openidc.so
include mods-enabled/auth_openidc.conf
<Location / >
AuthType openid-connect
Require valid-user
</Location>
and perform a 'apachectl -M' command I get the following error.
'Syntax error on line 57 of /etc/apache2/apache2.conf: Cannot load module/mod_auth_openidc.so into server: /etc/apache2/module/mod_auth_openidc.so: cannot open shared object file: No such file or directory
Action '-M' failed.'
Another point of confusion, I don't see any directory named 'auth_openidc_module' or any .so file anywhere within Apache. I have seen some posts that the .so files might be in '/usr/lib64/httpd/modules' but my lib64 directory is blank...
I'm a newbie to all of this...what am I missing?
So I don't have it working successfully yet, but I did get the error 'can't find' error fixed. The directory for modules on our server was '/usr/lib/apache2/modules/' NOT '/usr/lib64/httpd/modules'
I have a server on which I want to run multiple wildcard vhosts, with their own modperl environment.
Each vhost needs to run it's own startup script to define custom include paths.
In a normal vhost configuration, I can do the following...
<VirtualHost *:80>
ServerName web1.myserver.com
Define ApplicationRoot /websites/web1
DocumentRoot ${ApplicationRoot}
PerlSetEnv PERL_DOC_ROOT ${ApplicationRoot}
PerlOptions +Parent
PerlPostConfigRequire /websites/lib/startup.pl
...
My startup.pl script can then use the PERL_DOC_ROOT environment variable to dynamically configure custom lib paths.
This works fine with multiple vhosts sections. They each have their own #INC defined, and everything resolves correctly.
Is there some way I can translate this to a wildcard vhost configuration. I'd like users to be able to access *.myserver.com, and it will use the hostname to figure out which documentroot to use, and will run the startup.pl to define lib paths based on this folder.
I know I can use something like this...
VirtualDocumentRoot /websites/%1/
to dynamically set the document root, but if I try to use %1 in any other declarations it is not understood. Also the startup.pl would need to run when the site is first requested, rather than when the config file is first loaded.
Is this possible at all? Or would I need to somehow dynamically rewrite the config files each time a new virtual directory is added.
I realised I'm overcomplicating it. I don't need to use wildcard vhosts. Since I'll be using Jenkins to create the vhosts directories, I can also get it to dynamically create config files to match.
I'm developing a website and having development environment as Ubuntu 14.04, PHP 5.5.9, Apache 2.4.7. My issue is if some want accessing a file like http://domain.com/robots(without extension) then I should avoid but I've to allow if some tries to access http://domain.com/robots.txt(with extension).
Now in both ways I'm able to access files, I want to avoid this when user haven't given extension of the file using .htaccess or apache configuration file.
My previous environment was Apache 2.2 and PHP 5.3.10 at the time with default Apache configuration it was working as expected but after upgrade its not working as expected and due lack of knowledge on Apache configuration I'm unable to pick those lines of code.
Add following line in .htaccess
Options -Multiviews
I am trying to get my OSX MacPorts install of Apache to NOT show directory listings. I have tried various configurations of the "options" directive in the httpd.conf file with no luck. When I go to the site, it still lists the root directory (there is no index file at the moment.)
Apache has been restarted after each change.
There is no .htaccess file in the / directory, so there shouldn't be anything overriding.
This is driving me crazy!
So basically something is overriding your config. From the documentation of apache we can read that Options is can be placed in various context: server config, virtual host, directory, .htaccess.
httpd.conf is read first, so if You provided the configuration properly there, it means that it is overridden somewhere else
How did You do enter the options in the config ? In the most basic variant it should be.
<Directory /path>
Options -Indexes
</Directory>
Here what you should do:
check module configurations in modules for Options Indexes
check the main virtualhost definition, probably called default or 000-default
If it still does not help, add Options -Indexes to your virtualhost directly (provided you have not done it already). Or add it to the .htaccess file in your directory (allowing Options in .htaccess needs to be switched on)[as suggested in comments]
I am trying to install typo3 as per the instructions but I have a bit of a puzzle to solve.
It seems apache denies access to any files I try to access via any symbolic link in the site root directory. I have changed permissions from SymLinksIfOwnerMatch to FollowSymLinks and no joy.
I'm working on mac OSX (SL) and installing in my user's "Sites" directory. I can access any files in this CMS directory via the web browser just not anything through symbolic links.
I hope konsolenfreddy's comment was helpful already. I am trying to round things up here:
First check if the symlinks work from terminal and/or the filesystem in general.
Also, if you use absolute paths, the whole path from root to the file in question must be readable by the Apache user. *
If yes, check if the AllowOverride option is set for your webserver (or if applyable for the virtual host) For debugging you can set AllowOverride All in either apache2.conf, httpd.conf or in sites-available/default
If yes, check if FollowSymlinks is aktivated in any of the files responsible for your webroot, starting with apache2 working yourself down to the .htaccess files.
Try changing file permissions on the symlink file and the target directory (or files)
Try creating your own symlink and see what happens when you call it in the browser.
* Check this answer at askubuntu.com for more hints.
Ok I eventually solved it. In OSX the final file that governs access of sites installed in user directories is the last Include line in the apache2/conf/extra/httpd-userdir.conffile. Once I changed that my problems went away.
Thanks to all the people that replied my questions.