xampp for window path reference issue - apache

I had to reformat and reinstall XP a while ago which works just dandy.
My issue is that I never re-installed xampp until today (newest version). Going to "localhost/project" works fine. I can see the site but css and images aren't working. Localhost is reading my "/" path references inside the project folders as root "htdocs".
For those who will mention it: I removed the "/" in my php files and the links and reference to styles worked fine, but within the css files, any "../" reference failed.
I think there was a reason for the preceeding "/", but I have since forgotten.
Any have any ideas? None on my searches turn up anything useful.

did you copy your old xampp installation into the same path on your new XP? if not, you have to change the httpd.conf perhaps as apache uses some variables in there to calculate relative paths.
you could also try to use opera dragonfly or another debugger to see errors in your browser

Related

Where is the right place to configure my Apache vhosts in OSX?

I updated my laptop from Mojave to Catalina last night, and this morning I realised that I had lost all my Apache vhosts, my vhost file was replaced with the default file.
I had all my vhosts in /usr/local/etc/httpd/extra/httpd-vhosts.conf
I would like to know which is the right way to do this (store my vhosts), so I (hopefully) won't lost my vhosts in a future update.
Thanks!!
P.D. I'm using "native" Apache, not Homebrew.
Catalina moved the root directory files as part of the upgrade. See https://apple.stackexchange.com/questions/371852/where-does-the-upgrade-to-macos-catalina-move-root-directory-files
From the answer: This took me a long time to figure out, but any file that was formerly at, e.g., /my-cool-directory was moved to /Users/Shared/Relocated Items/Security/my-cool-directory.
You might try checking in your /Users/Shared/Relocated Items/Security folder for your original Apache files.
It depends on what you do include in your httpd.conf file.
You can try use a custom created vhosts file eg. Include /private/etc/apache2/extra/mycustom-httpd-vhosts.conf next time.
After the last catalina update my custom files where not moved out of their places.
I had the same issue with updating to catalina. All my changes were gone.
By default the httpd.conf includes config files in the other directory:
Include /private/etc/apache2/other/*.conf
I place my vhosts and userdir configs in this directory now. It looks like it works just fine. Another custom file I had in there was not touched by the update.

VQmod not working for open cart admin

I am having the most frustrating issue with VQmod. I moved my OpenCart store from a Godaddy VPS to Rackspace's Cloud Sites. The move went fine and everything works properly except the VQmod's on the admin panel. None of them load. No errors in the log files, no admin cache files in the cache dir, no php errors.
Things I have tried:
Cleared all cache Changed admin folder to 755
reinstalled VQmod tried both manually and using the installer with fresh index.php files
Removed all XML files and tried to load only one at a time
Cursed loudly at my computer repeatedly.
Please Help! OC version 1.5.6 VQmod 2.5.1
For those that want the solution to this, the issue was that the config.php files were both using relative paths instead of the full paths for OpenCart's various directories. They should always be full paths, or resolved with realpath() in the config.php files themselves
My case was a bit different. I checked the permissions, paths, all the regular stuff that comes to mind first. I even walked step by step through the manual installation guide.
The Opencart copy in question is shared across several environments using git. Long story short, the mods.cache and checked.cache were not added to .gitignore right away, and when I finally did that, I emptied both of them just to make sure Opencart will write new content based on my current environment. Turns out, since mods.cache was empty, Opencart believed there are no mods available.
Solution: delete both vqmod/mods.cache and vqmod/checked.cache.
Update: here are some similar issues:
https://github.com/vqmod/vqmod/issues/32
https://github.com/vqmod/vqmod/issues/3
The vqmod/vqmod/wiki/Troubleshooting guide, as of now, does not make it obvious the files should've been deleted, neither does the vqmod/vqmod/wiki/Installing-vQmod-on-OpenCart, and there doesn't seem to be any way to contirbute. vQmod fails silently, without producing any notifications, warnings, or simply detecting the issue and rebuilding the cache files. I've spent few hours trying to figure out what's wrong.

Apache returning 404 for requests inside /javascript directory

I have a project with several sub-directories. Everything works just fine, except if I try to access files inside the /root/javascript directory, I get a 404. The files do in fact exist, and I am in fact typing the path correctly. If I simply rename the directory I can then access the files. Rename it back, and I get the 404 again. VHost file works fine. No .htaccess files involved.
Apache version: 2.4.9
OS: Ubuntu 13.10
After much searching and trying different things, here's what the problem came down to:
By default, Apache 2.4 on Ubuntu enables a config file called javascript-common, which redirects any requests to files inside /javascript (that is, a directory at the root of your project called 'javascript') to /usr/share/javascript.
Solution 1
Use the following command to disable the javascript-common configuration file:
a2disconfig javascript-common
Solution 2
Add your JavaScript files inside that /usr/share/javascript directory. That way Apache will actually find those files and no 404 will be returned. One benefit of doing things this way is that you won't need multiple copies of the same files (jquery.js, etc.js) that multiple projects use...
Solution 3
Delete the directory /usr/share/javascript, and create a symbolic link that points to your project's /javascript directory. Keep in mind that if you have more than one project (vhost file), they will all serve from the same JavaScript file from the original project. In other words, this is probably not the best solution...
The a2disconfig solution didn't work for me, but then through some searching, I realized that the javascript-common is something that can be uninstalled.
So I fixed the problem by removing javascript-common:
sudo apt-get remove javascript-common
I'm not sure the point of this package, or why it would be installed automatically, but I'm glad that my javascript files are loading again!
I am running Ubuntu 14.04.1 LTS with the lamp-server bundle
Encountering the same problem, I found a similar answer resolved it.
sudo a2disconf javascript-common
sudo service apache2 restart
After the a2disconf (and note it is apparently now a2disconf and not a2disconfig)
I did get a message to execute "sudo service apache2 reload"
the reload did not resolve the issue... thus the restart
as an aside -- I cannot imagine what the developers were thinking when they loaded this little gem -- some of my javascript files might be viable across domains... but certainly not all !
You could just override /javascript alias in your .conf to reflect what you want:
Alias /javascript /my_custom_dir

Apache Installation

I just installed Apache 2.2.x in my windows 7 x64. everything seemed okey and I am getting the "It works!" page. However when I tried to edit the index.html in htdocs and I display localhost again it just says "It works!" it didnt show the modifications that I did on the file. Is this an indication of something wrong with my installation?
I believe to change the index.html in win7x64 , you need to run your editor as an administrator , as it is located in program files folder , and to change anything in program files folder or any folder under it you need to run the editor as admin
Double check that your browser isn't caching the default page. After you make a change to your index.html, clear your browser cache and try again.
If that still doesn't work, ensure you're not editing the wrong index.html file; the default site may be pointing to a different location than the one you're editing. (I'd guess the issue is the browser cache, however...)
Ctrl-F5 the page for hard refresh.
If same page is there:
A) you're editing the wrong index.html/php file.
B) you're making edits that don't change the output.
If you can't get it to work, I suggest you install a full WAMP package.

Firefox loads old versions of changed files from apache

So, I'm running an apache server on linux. Sometimes, Firefox decides to not load the new version of a file after I edited it. For example, right now I have a .js file wich is loaded dynamicly. It had a bug, wich I corrected (I checked with Chromium), but when the file is loaded in Firefox, it still has the bug! When looking at the response header of the ajax request, I see the code of the file BEFORE it was changed. But that code doesn't exist anymore... I had this happen with CSS files too.
When I rename the file to something else, it loads the right stuff, but as soon as I rename it to the old name, it starts loading an old version of the file again!
I restarted apache2, but that didn't change anything.
I checked for file permissions too, no problem there as far as I could tell (I changed all files' permissions to rwxrwxrwx to be sure).
When accessing with an other browser, it works fine!
In previous cases, the next day or so, the problem would have vanished, but I can't always just stop for a day in what I'm doing...
This is caused by browser cache,
you can consider to use url with version parameter,
like http://yourdomain.com/js/some.js?v=$version,
and update the $version whenever you update a css/js