htaccess

I am trying to protect a folder under the wwwroot of an sc installation

in this folder i have put the .htaccess and the .htpasswd file

here is my htaccess:

AuthType Basic
AuthName “Usert Login”
AuthUserFile C:\Program Files (x86)\NetMake\v81\wwwroot\my_folder_to_protect/.htpasswd
Require valid-user

it does not work. It lets me to enter without asking for credentials in the htpasswd file. don’t understand

Is there some setting in the Apache of SC environment prevening to use htaccess control?

Thanks

well, it could be for many reasons… using htaccess on windows is very tricky
check this:
1- first why for God sake you need protect that folder!!! that is development environment
2- windows can’t store this file name with leading dot (.) this is for hidden files in Linux, if you have to use it, and you have your local server supprting it, then only way is to copy it there somehow…
3- your folder to protect you need the htaccess file there, not the htpasswd file… while passwd file should be in a safe place on the server, say, on C:\xxxx it is recommended to have this file somewhere not accessible from the web
4- make sure the htaccess has no extension, windows does have extensions by default, you can use folder options to display the extensions for known files… make sure you have exact file name

search google for using htaccess on windows, and have more idea how it works… i remember drove me crazy long time back until got it working fine on windows

HI Regarding this:

1- first why for God sake you need protect that folder!!! that is development environment

As a matter of fact it’s actually my production environment because i was struggling trying to set up a production environment on windows server, the SC support suggested me to use the installer from SC to set a proper environment (apache+php) perfectly suitable for SC applications. In other words they made me to use the installer package like a bundle (xampp, uniform) except that i I would not have used SC there.
So i did. i don’t use development environment on that machine (i use development on another machine where i have my SC license) so i do not need the license there (production). i only use it for its apache+php environment. By the way, if you have some suggestions or a guide to set up an apache+php environment under windows server that works smoothly with SC applications it’s great!!

3- your folder to protect you need the htaccess file there, not the htpasswd file… while passwd file should be in a safe place on the server, say, on C:\xxxx it is recommended to have this file somewhere not accessible from the web

Yes i also did this, i have put the paswd file somewhere else but it did not work anyway.

4- make sure the htaccess has no extension, windows does have extensions by default, you can use folder options to display the extensions for known files… make sure you have exact file name

Checked

I will do a more extensive search.

Thanks

sure scriptcase could run on your PC, and same time you can have your xampp on the same PC to test your projects!! i guess you should make efforts in achieveing this, not having htaccess work… development enionrment should be accessable to you and you should be free having it at your desposal,

let me me help you, what did you do earlier that scriptcase didn’t work with you on Windows?? what windows you have? what is the PC specs we are talking about?

thanks, since you are so kind i will try yo explain better:
i am not trying to achieve htccess control on my development environment. my development environment is on my laptop where i have my SC license running, no trouble with this. let’s forget this machine :slight_smile:

All my questions regard my production server which is another machine running windows server 2008 R2. On this server i have mysql server community edition installed from oracle.
After that, i have tried to install the remaining part of the puzzle: a complete Apache+php environment. And here start the troubles.

On this server i have tried for many days to set up an environment (apache+php) suitable for applications developed with SC, first following this guide
https://suporte.scriptcase.com.br/index.php?/Knowledgebase/Article/View/677/0/setting-environment-manually-php-56---windows
But didn’t work at all. It always gave me not found!!

then, tired of this i switched trying with bundles like:

  • xampp: since i already have mysql server installed, i installed only the apache+php modules but didn’t work at all. The applications did not work.

-Uniform server: same as xampp, i installed only apache + php but uniform now has php 7 and this gave me problems because SC is not compatible with php 7 and my applications did not work (i.e. Ajax text auto-complete did not work to say the least)

So, after some days struggling, SC support suggested me to use on the production server the installation package of SC which would have prepared a complete apache+php environment perfectly working for publish applications developed with SC.
SInce I would not have needed to use development on that machine (production server) they told me to erase the “scriptcase” folder from the path C:\Program Files (x86)\NetMake\v81\wwwroot of the newly installed package. this would have left me with the apache+php environment working, which is what i wanted.
I followed this instructions and, as a matter of fact since then i have an environment pefectly woking on production server.

Now, my initial question arises because apart from the folder where i publish my application, i wanted to set an htaccess protection on another folder and use it as some kind of stage area with a minimum protection. And here comes my initial question.
rememeber i am always talking about my production server.

I know this has been a work around from the beginning and i am not happy with this, but i could not afford to loose time, i had to focus on development.

I hope now i made myself clear and thank you again for your time, i don’t take it fro granted.

aha, okay, leaving your development because you are happy with it, lets stick to your production environment

assuming you have a server with wins server 2008 R2, that will be accissable for end users, just make sure you have one apache and one php version… you don’t need specefic stuff to run applications developed with scriptcase

for example, i have the same windows 2008 Rs and other server 2012… i just use one xampp package has php 5.3.8 and is running prerfect, don’t even remember which mysql version is there! i didn’t do anything in particular… just installed the xampp to my C on the server, and eparated the htdocs folder (from document root in apache) this way even the .htaccess works perfect… i put the passwd file in c:\passwords and htdocs are in c:\htdocs while the main xamp is in c:\xampp

if there is a chance to remove all servers stuff from your windows server and start over, use clean xampp package with this php version mentioned, it is so far running all scriptcase applications without issues…

again, it has nothing to do with your development or your scriptcase folder… once you publish the application, it should work independent on any server that has php+mysql, at least version 5.3.8 as i mentioned above

Ok Thanks for your help.
i will try as soon i have time to experiment this.I am also considering to switch towards mariaDB and i wonder if my SC license for mysql work with it.

hello, i read somewhere that is support mariaDB…not sure of details

for me when using xampp, it comes now with mariaDB and apps developed with sc work ok on xampp with mariaDB

good luck

I will run some tests on my linux vm. From what I see it should be ok. I was thinking that in case you want to sell your software can not be based on mysql community edition but you need a commercial license

irrelatvie, mysql is powerful and reliable, customer can be convinced, depends on budget as well, afaik also mariaDB is free of cost license