Jump to content

Recommended Posts

Thanks Jack - just out of interest where is the message displayed? as I have a fixed black header at the top of my pages - maybe that is hiding it - but regardless - the customer is not kicked off and can continue browsing and stay logged in.

 

Yes php5.4 removes the way sessions are handled - a lot of the register etc functions were depreciated in php5.3 and removed in php 5.4 as per : http://www.sitepoint.com/forums/showthread.php?809938-session-functions-has-been-removed-from-PHP-5-4-0


Now running on a fully modded, Mobile Friendly 2.3.4 Store with the Excellent MTS installed - See my profile for the mods installed ..... So much thanks for all the help given along the way by forum members.

Share this post


Link to post
Share on other sites

The message is displayed using a javascript popup. I intend to change that to a jquery dialog at some point to get by the popup blockers but that wouldn't be an issue in this case because the message isn't displayed until the code handles the session and that isn't happening, or so it seems.

 

Yes, I'm aware that the sessions code was changed with 5.4 but View Counter just uses the shops session handling functions so as long as they work, there shouldn't be a problem with that part of the code. But maybe the code in View Counter is changing, or treating, the sessions differently in some way that is causing the problem.

 

I do seem to recall having this problem, or one very similar to it, with installing View Counter into a CRE or oscMax shop. But that was over a year ago and I don't know what became of it. But, it seems to me it had something to do with how the sessions were being recorded. I don't think it would make a difference but you may want to check and make sure that the type of table for the View Counter tables are the same as for the others, like innoDB.

 

I'm wondering if this is the only problem you are having with the addon? Do all of the other options work? If not, that may lead to something common that might indicate the cause.

Edited by Jack_mcs

Share this post


Link to post
Share on other sites

@@Jack_mcs

 

Hi Jack - Looks like that was the problem - although the tables had been created in innoDB they were in Latin - I converted them to UTF8 and now everything is as it should be. Thank you for your patience :)


Now running on a fully modded, Mobile Friendly 2.3.4 Store with the Excellent MTS installed - See my profile for the mods installed ..... So much thanks for all the help given along the way by forum members.

Share this post


Link to post
Share on other sites

Great. I'm glad to hear it. And thank you for sticking with it. I'm sure it will help others at some point. :)

Share this post


Link to post
Share on other sites

Hi Jack....Back again....

 

Have you noticed a very noticeable slowing down on the admin side with view counter turned on?

 

I have been adding products today, and noticed that with view counter on the admin speed is almost at a crawl.....


Now running on a fully modded, Mobile Friendly 2.3.4 Store with the Excellent MTS installed - See my profile for the mods installed ..... So much thanks for all the help given along the way by forum members.

Share this post


Link to post
Share on other sites

I'm not understanding the .htaccess permissions. Right now I am

rwxr--r-- root:apache

 

If I make it writeable apache then it will be able to be written by the web server. This makes it "world" writable since the world using the public web will be able to write to my server and/or change files?

Do I have the wrong understanding of permissions?

Share this post


Link to post
Share on other sites

@@Mort-lemur It doesn't run in admin any different than on the shop side. Actually a little less because there is code to exclude parts when in admin. If you turn View Counter off in the settings does the speed pick? If so, the only thing I can think of is that your configure file doesn't have the DIR_FS_CATALOG and/or DIR_WS_ADMIN setup as expected. The only code that runs in admin for View Counter, other than when you are in the View Counter section is caused by this line in the admin/includes/application_top.php file

include(DIR_FS_CATALOG . DIR_WS_MODULES . FILENAME_VIEW_COUNTER);

If you remove that and the speed increases, then the problem is with the code on the shop side, which may help narrow it down. For what it's worth, I don't see a slow down in any of the sites I've installed it into.

Share this post


Link to post
Share on other sites

@@newburns There will generally be problems with apache as the owner but maybe that works well in your case. But the permissions should be RW-R-R (or 644). You can also add this code to your .htaccess file.

<Files .htaccess>
order allow,deny
deny from all
</Files>

Share this post


Link to post
Share on other sites

@@Jack_mcs

Understood, but what is the ownership?

If root:apache then that means apache will not be able to write to the .htaccess file and the addon will not work properly to manage the .htacess

 

I'm using default CentOS 6.5_x64 and standard Apache install. All of my file ownerships are root:apache 744 (everytime I set 644 it defaults to 744).

All folders are 755 and all files are set to 744 for my OSC install (except for the images, pub, etc. folders). Is this not proper?

Share this post


Link to post
Share on other sites

It's not standard. Files are usually 644, except for protected ones like the configure files, which are usually 444. You'll need to follow-up with your host to get the settings as they should be, or ask in the general forum, since it isn't something I offer support for in a thread like this.

Share this post


Link to post
Share on other sites

I am self hosted.

How can I remove root write permissions logged in as root?

I use

chown -R root:apache /catalog
find ./catalog -type f -print0 | xargs -0 chmod 644

However when I do ll -h, it shows rwxr--r--

That's neither here nor there, but it's a question I have.

The original issue is, what is the proper permission and ownership of .htaccess in order for the code to work? Ideally, apache must be able to write the file, but I was taught that Apache accessible files can be publicly exploited to be changed by public web users, or anyone on the web. That may be false, but I need to be sure, and I have not found contradicting information to that yet.

Share this post


Link to post
Share on other sites

Hello, Jack!

Thanks for Your contributions!

I have problems with this addon installation.

When I click in admin -> view counter-> monitor I also (as one member befor me) have just blank white page.

Second, I also have "...../not_for_use.php was not found on this server." (on diferrent optins, for example, admin -> view counter-> monitor-> Check for Updates. )

I cant figure out where is problem. I have almost clean shop - only

iOSC Mobile Version for OSC 2.3.3.

 

and Your Ultimate SEO 2-2.2d-13.

 

I checked view counter installation hmm 5 times (its really easy to install), evrth ok.

iosc and ultimate seo installations also should be ok.

maybe You have any idea?

 

 

I have latest oscommerce (2.3.3.4)

Edited by gvv

Share this post


Link to post
Share on other sites

In the monitor section, if the page is white as soon as click on Monitor, then there is a mistake in the installation. You would need to check the error log, or enable error display, to see what is causing that. If the white page doesn't appear until a while (probably 30 seconds) after you click Monitor, then the script is timing out. In that case, try changing the settings to use a small number of results and/or no flags.

 

The "not_for_use.php" is used in the color section. Are you sure you are in the Monitor section and not the Color section? You say you are in the Monitor section but you also say the monitor section just displays a white page. It can't be both.

 

The other addons you mention won't have any affect on View Monitor in admin.

Share this post


Link to post
Share on other sites

I went over the monitor section. The color section is for setting up the colors and seeing how they look. If you try to use the links there, you get the not_for_use.php. It means not for use.

Share this post


Link to post
Share on other sites

error log

when I click "monitor" it shows:

Warning: require(includes/classes/IP2Location.php) [function.require]: failed to open stream: No such file or directory in /path_to_admin_directory/view_counter.php on line 20

 

Fatal error: require() [function.require]: Failed opening required 'includes/classes/IP2Location.php' (include_path='.:/usr/share/pear:/usr/share/php') in/path_to_admin_directory/view_counter.php on line 20

 

-------------------------

when I click color it shows:

Warning: error_log(/var/log/www/tep/page_parse_time.log) [function.error-log]: failed to open stream: No such file or directory in/path_to_admin_directory/includes/classes/logger.php on line 49

Parse Time: 0.508s

Edited by Jan Zonjee
disclosure of admin directory

Share this post


Link to post
Share on other sites

also I can't block countries

and if I try to backup .htacess files error log shows:

Warning: mkdir() [function.mkdir]: Permission denied in /path_to_admin_directory/includes/functions/view_counter.php on line 644

Edited by Jan Zonjee

Share this post


Link to post
Share on other sites

error log

when I click "monitor" it shows:

Warning: require(includes/classes/IP2Location.php) [function.require]: failed to open stream: No such file or directory in /path_to_admin_directory/view_counter.php on line 20

See the fix a few pages back.

Share this post


Link to post
Share on other sites

@@Jack_mcs

For example, if I wanna create htaccess backup, I see

 

Warning: mkdir(): Permission denied in /var/www/vtu/data/www/vaciesuuznemums.lv/g/admin/includes/functions/view_counter.php on line 644

The htaccess_backup directory could not be created.

 

 

Where I have to create that directory manually?

Share this post


Link to post
Share on other sites

That's due to a limit of the server settings. You can ask your host to look at it and see if they will change the settings - some will, some won't. If it is just the creation of the directory that is the problem, then do it manually since it is a one-time thing. But if you can't create the backup files either, then you need to get your host involved.

Share this post


Link to post
Share on other sites

Now about to install and try View Counter but before I start I have noticed a possible problem. Although it is not mentioned in the install instructions the sample htaccess file has Options +FollowSymLinks. When I installed your excellent Ultimate SEO URLs addon I got a 500 error and you suggested removing Options +FollowSymLinks, which I did and it works. Will View Counter work without this?


OsC 2.3.4.1 CE Frozen   PHP 7.2   MySQL 10.1.36-MariaDB-cll-lve. Phoenix in development

Is your version of osC up to date? You'll find the latest osC community version (CE Phoenix 1.0.4.0) here.

Share this post


Link to post
Share on other sites

That is not needed. It is just a standard .htaccess file that most shops would use. If you look in the instructions, you will see all it says to add is

# view counter trap anyone trying to access admin

RewriteCond %{REQUEST_URI} "/admin/"

RewriteRule (.*) view_counter_trap.php [L]

I should add that that should only be added if the name of your admin is not admin, which it shouldn't be. Edited by Jack_mcs

Share this post


Link to post
Share on other sites

What files would contain the time format, would like to change to 12 hour.

 

Thanks

Ken


OSC v2.3.4.1 BS EDGE
Ultimate SEO

 

Share this post


Link to post
Share on other sites

If you mean the time that is displayed In the monitor section, that is formatted as it is read from the database in the admin/view_counter.php file. Search for date_format to find it.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×