PDA

View Full Version : How to allow .htaccess file


Skprorok
22nd June 2009, 13:42
Can someone tell me step by step how to allow .htaccess file? I need it for mod-rewrite.

Thank you:)

till
22nd June 2009, 14:37
This is allowed and configured by default, no changes nescessary.

Skprorok
22nd June 2009, 20:06
This is allowed and configured by default, no changes nescessary.

Thank for answer, but when I copy .htaccess file to /web10/ folder and refresh page, I get Internal server error.

till
22nd June 2009, 20:07
Then check the exact error message in the error message of the logfile. I'am sure that your .htaccess file contains other settings beside mod_rewrite rules.

Skprorok
27th June 2009, 11:14
Then check the exact error message in the error message of the logfile. I'am sure that your .htaccess file contains other settings beside mod_rewrite rules.

But when i copy .htaccess to /web10/web/ directory, I can't see it in the dir. It will disappear.

.htaccess file contains only mod_rewrite rules.s

till
27th June 2009, 12:05
The is there and uploaded correctly but your FTP client or pureftpd hides hidden files (files that start with a dot). Take a look at the settings of the ftp client and the pureftpd configuration file.

Skprorok
27th June 2009, 12:21
The is there and uploaded correctly but your FTP client or pureftpd hides hidden files (files that start with a dot). Take a look at the settings of the ftp client and the pureftpd configuration file.

Mustn't I allow mod-rewrite in Apache directives when I'm adding a website?

till
27th June 2009, 12:23
Mustn't I allow mod-rewrite in Apache directives when I'm adding a website?

No. Mod_rewrite is alaways enabled. But this has nothing to do with your original problem.

Skprorok
27th June 2009, 12:37
No. Mod_rewrite is alaways enabled. But this has nothing to do with your original problem.

my .htaccess file contains this:

RewriteEngine On
RewriteRule ^uzivatel/(.*) /index.php?id=8&user_name=$1 [QSA]
RewriteRule ^(.*)/(.*).xml /index.php?id=$1 [QSA]

Where is error log of the website?

till
27th June 2009, 12:38
In the log directory of the website.

Skprorok
27th June 2009, 12:40
In the log directory of the website.

Log directory? I have only log file there. But it is empty

till
27th June 2009, 12:41
If the error.log file is empty then there are no errors. Check on the shell with the "ls -la" command if you placed the .htaccess file in the correct directory, the "web" directory.

Skprorok
27th June 2009, 12:47
If the error.log file is empty then there are no errors. Check on the shell with the "ls -la" command if you placed the .htaccess file in the correct directory, the "web" directory.

Yes. It is in the correct "web" directory. i can access it with command
nano /var/www/client/client0/web10/web/.htaccess

Skprorok
27th June 2009, 12:56
If the error.log file is empty then there are no errors. Check on the shell with the "ls -la" command if you placed the .htaccess file in the correct directory, the "web" directory.

And it isn't "error.log" file but only "log" file in the /var/www/clients/client0/web10/log

till
27th June 2009, 12:57
And you are sure that this .htaccess works? Have you tested it on another server successfully. In most scripts you have something like "RewriteCond ...." before the rules.

till
27th June 2009, 12:58
And it isn't "error.log" file but only "log" file in the /var/www/clients/client0/web10/log

log is a directory and not a file. Go into the log directory, there is the error.log file.

Skprorok
27th June 2009, 13:04
log is a directory and not a file. Go into the log directory, there is the error.log file.

.htaccess works on another servers.

I went to "error.log" file and i found errors:
"RewriteEngine is not allowed here"

What now?

till
27th June 2009, 13:06
Remove the rewrite engine line as the rwrite engine is enabled already. If this wont work, simply copy the whole content of the .htaccess file into the apache directives field of the site and then delete the .htaccess file.

Skprorok
27th June 2009, 13:10
Remove the rewrite engine line as the rwrite engine is enabled already. If this wont work, simply copy the whole content of the .htaccess file into the apache directives field of the site and then delete the .htaccess file.

What if it still doesn't work?

till
27th June 2009, 13:14
And you have tested this exact .htaccess file on another server without doing any modifications in it and you do not receibve any error messages in the error log anymore?

Skprorok
4th August 2009, 15:46
And you have tested this exact .htaccess file on another server without doing any modifications in it and you do not receibve any error messages in the error log anymore?

I have tested this exact .htaccess file on another server without any modifications and I don't recieve any error...

When i copy content of .htaccess file to Apache directives it still doesn't works.

rlischer
6th August 2009, 22:51
I have tested this exact .htaccess file on another server without any modifications and I don't recieve any error...

When i copy content of .htaccess file to Apache directives it still doesn't works.

I am having the same problem. I used a working .htaccess file from a working site and I am trying to duplicate the site on my new server. If I delete it I can see the site, but then I guess mod_rewrite stops working in that folder.

till
6th August 2009, 22:54
If you dont use the eaxct same application then you dont have the same eror! Without writing exact error descriptions, nobody is able to help you.

If something dont work in a website, look into the error log of the website.

rlischer
6th August 2009, 23:06
If you dont use the eaxct same application then you dont have the same eror! Without writing exact error descriptions, nobody is able to help you.

If something dont work in a website, look into the error log of the website.

I know I don't have the same app, but .php is not working correctly for me.

my error with .htaccess:

[Thu Aug 06 15:50:21 2009] [alert] [client 66.42.xxx.xxx] /var/www/clients/client4/web6/web/calls/.htaccess: Options not allowed here

without the .htaccess

[Thu Aug 06 16:04:48 2009] [error] [client 66.42.xxx.xxx] File does not exist: /var/www/clients/client4/web6/web/calls/admin-add-user, referer: http://www.mysite.net/calls/admin.php

till
6th August 2009, 23:08
Ok, then move the "Options ...." lines from the .htaccess file to the apache directives field of the website. And plese dont post to other threads, make your own thraed for your own problem.

rlischer
6th August 2009, 23:11
Ok, then move the "Options ...." lines from the .htaccess file to the apache directives field of the website. And plese dont post to other threads, make your own thraed for your own problem.

I don't know what "apache directives" are. I just wanted to subscribe to this thread to see if he ever found a solution. I do have another thread and you were helping over there. Thanks

Skprorok
7th August 2009, 01:01
Ok, then move the "Options ...." lines from the .htaccess file to the apache directives field of the website. And plese dont post to other threads, make your own thraed for your own problem.


I tried to copy content of .htaccess file to Apache directives, but it still doesn't working. And i dont have any errors in error.log.

dxr
7th August 2009, 10:46
ISPConfig has disabled .htaccess per default. You need add this directive to httpd.conf:


<Directory />
AllowOverride All
</Directory>


And all your .htaccess will star work. BUT Till said me:

Setting these things in .htaccess is not allowed for security reasons
as it would allow poaple e.g. to
enable disabled functions too. Instead, just add the line:
php_value memory_limit 128M
in the apache directives field in ispconfig.

http://us2.php.net/configuration.changes
http://us2.php.net/manual/en/ini.list.php

Php disable some directives for only setup in php.ini, i think allow .htaccess is not a security reason, ISPConfig has other security problems more importants.

For example 'Magento' need change some php directives in .htaccess, but its disabled, i think is very hard for the user change .htaccess from the control panel every time he need change it, or install new CMS, etc...

till
7th August 2009, 10:52
With "Allow override all" you can change also the interpreter for any file ending e.g. .php files, so you can esily come around any restrictions on the system. Enebling the overriding for everything is not recommended on systms that run websites for customers.

dxr
7th August 2009, 10:55
With "Allow override all" you can change also the interpreter for any file ending e.g. .php files, so you can esily come around any restrictions on the system. Enebling the overriding for everything is not recommended on systms that run websites for customers.

Show me examples, please.

Imagine my server with 50 websites and htaccess with "Allowoverride All"

How to can hack other websites from localhost or to do unstable the server.

till
7th August 2009, 11:36
I have sent you an email.

Skprorok
7th August 2009, 12:21
So is there any solution to allow .htaccess?

dxr
7th August 2009, 12:25
So is there any solution to allow .htaccess?

We are discussing by email. We will post the possible solution or conclusion.

till
7th August 2009, 13:06
So is there any solution to allow .htaccess?

Edit the file:

/usr/local/ispconfig/server/conf/vhost.conf.master

and change the lines:

AllowOverride Indexes AuthConfig Limit FileInfo

to

AllowOverride All

Then every new or updated website will allow overriding. Please be aware that this might allow customers to enable e.g. php if it is not enabled for a website.

Skprorok
7th August 2009, 13:11
Edit the file:

/usr/local/ispconfig/server/conf/vhost.conf.master

and change the lines:

AllowOverride Indexes AuthConfig Limit FileInfo

to

AllowOverride All

Then every new or updated website will allow overriding. Please be aware that this might allow customers to enable e.g. php if it is not enabled for a website.

I can't find line: AllowOverride Indexes AuthConfig Limit FileInfo in /usr/local/ispconfig/server/conf/vhost.conf.master . I can only find AllowOverride Indexes AuthConfig Limit
Thanks. And how I can update site?

till
7th August 2009, 13:13
Edit a setting in the site and click on save.

Skprorok
7th August 2009, 13:23
Edit a setting in the site and click on save.

Yes. It's going

Thanks

dxr
7th August 2009, 13:25
Till,

Better solution is create a option for enable or disable AllowOveride all from ispconfig, and add this config in every vhost confiuguration.

The customers wont can enable php if they have disabled htaccess permision for this domain.

What do you think?

till
7th August 2009, 13:57
This is already in the roadmap for 3.0.2 as feature request:

http://bugtracker.ispconfig.org/index.php?do=roadmap&project=3

dxr
7th August 2009, 14:09
Perfect ;D

orasis
12th September 2010, 00:15
hello, I am having same problem.

I installed Joomla 1.5 to a site (web1) and when I upload a .htaccess file via ftp of the same user the .htaccess gets disappeared. Just cause I got the ispconfig running on a laptop on lan if I go to /var/www/example.bounceme.net/web I can see the .htaccess file with permissions to web1, client1. I access ftp from a windows machine using filezilla and this is the first time I see something like this. I mean I use it for years on my host without a problem. I don't find some option on the ftp client to show or hide hidden files, I searched all the program (there is actually something on a menu to Force Showing Hidden Files, but nothing).

I wanna simulate my host's behavior to ispconfig and use .htaccess but it keeps disappearing whatever I do on the ftp.

I saw till's advice above that says:

Edit the file:
/usr/local/ispconfig/server/conf/vhost.conf.master
and change the lines:
AllowOverride Indexes AuthConfig Limit FileInfo
to
AllowOverride All

.. but I cannot find such lines in that file.

any help appreciated
thanks so much !

till
12th September 2010, 19:59
I saw till's advice above that says:

Edit the file:
/usr/local/ispconfig/server/conf/vhost.conf.master
and change the lines:
AllowOverride Indexes AuthConfig Limit FileInfo
to
AllowOverride All

.. but I cannot find such lines in that file.

This advice was for older ispconfig releases, it does not apply to the verion that you have installed. In current ISPCinfig releases, AllowOverride is always set to "All" by default.

I wanna simulate my host's behavior to ispconfig and use .htaccess but it keeps disappearing whatever I do on the ftp.

Files that strat with a dot are hidden file son linux. So it is normal that you dont see it but this does not mean that it is disappered.

If you use the commad:

ls -la

on the shell, then you will see hiffen files. If you want to see hidden files with FTP too, then you can configure it in your FTP server:

http://www.faqforge.com/linux/controlpanels/ispconfig3/how-to-display-hidden-files-with-pure-ftpd-on-debian-an-ubuntu-linux/

orasis
13th September 2010, 00:45
haaaaaaaa ! you are the man :)
works !

thanks !!!!!!!